BorderlessTabButtonUI.java

1
/*******************************************************************************
2
 * Copyhacked (H) 2012-2020.
3
 * This program and the accompanying materials
4
 * are made available under no term at all, use it like
5
 * you want, but share and discuss about it
6
 * every time possible with every body.
7
 *
8
 * Contributors:
9
 *      ron190 at ymail dot com - initial implementation
10
 *******************************************************************************/
11
package com.jsql.view.swing.ui;
12
13
import com.jsql.view.swing.util.UiUtil;
14
15
import javax.swing.*;
16
import javax.swing.plaf.UIResource;
17
import javax.swing.plaf.basic.BasicArrowButton;
18
import javax.swing.plaf.metal.MetalTabbedPaneUI;
19
import java.awt.*;
20
21
/**
22
 * Tab UI to remove inner borders on empty tabbedpane and force header height on Linux.
23
 */
24
public class BorderlessTabButtonUI extends MetalTabbedPaneUI {
25
    
26
    @Override
27
    protected JButton createScrollButton(int direction) {
28
        
29 4 1. createScrollButton : negated conditional → NO_COVERAGE
2. createScrollButton : negated conditional → NO_COVERAGE
3. createScrollButton : negated conditional → NO_COVERAGE
4. createScrollButton : negated conditional → NO_COVERAGE
        if (direction != SOUTH && direction != NORTH && direction != EAST && direction != WEST) {
30
            
31
            throw new IllegalArgumentException("Direction must be one of: SOUTH, NORTH, EAST or WEST");
32
        }
33
34 1 1. createScrollButton : replaced return value with null for com/jsql/view/swing/ui/BorderlessTabButtonUI::createScrollButton → NO_COVERAGE
        return new ScrollableTabButton(direction);
35
    }
36
    
37
    private static class ScrollableTabButton extends BasicArrowButton implements UIResource, SwingConstants {
38
        
39
        public ScrollableTabButton(int direction) {
40
            
41
            super(
42
                direction,
43
                UiUtil.COLOR_DEFAULT_BACKGROUND,
44
                UIManager.getColor("TabbedPane.darkShadow"),
45
                new Color(122, 138, 153),
46
                UIManager.getColor("TabbedPane.highlight")
47
            );
48
            
49 1 1. <init> : removed call to com/jsql/view/swing/ui/BorderlessTabButtonUI$ScrollableTabButton::setBorder → NO_COVERAGE
            this.setBorder(BorderFactory.createEmptyBorder());
50 1 1. <init> : removed call to com/jsql/view/swing/ui/BorderlessTabButtonUI$ScrollableTabButton::setOpaque → NO_COVERAGE
            this.setOpaque(false);
51 1 1. <init> : removed call to com/jsql/view/swing/ui/BorderlessTabButtonUI$ScrollableTabButton::setBorderPainted → NO_COVERAGE
            this.setBorderPainted(false);
52
        }
53
    }
54
}

Mutations

29

1.1
Location : createScrollButton
Killed by : none
negated conditional → NO_COVERAGE

2.2
Location : createScrollButton
Killed by : none
negated conditional → NO_COVERAGE

3.3
Location : createScrollButton
Killed by : none
negated conditional → NO_COVERAGE

4.4
Location : createScrollButton
Killed by : none
negated conditional → NO_COVERAGE

34

1.1
Location : createScrollButton
Killed by : none
replaced return value with null for com/jsql/view/swing/ui/BorderlessTabButtonUI::createScrollButton → NO_COVERAGE

49

1.1
Location : <init>
Killed by : none
removed call to com/jsql/view/swing/ui/BorderlessTabButtonUI$ScrollableTabButton::setBorder → NO_COVERAGE

50

1.1
Location : <init>
Killed by : none
removed call to com/jsql/view/swing/ui/BorderlessTabButtonUI$ScrollableTabButton::setOpaque → NO_COVERAGE

51

1.1
Location : <init>
Killed by : none
removed call to com/jsql/view/swing/ui/BorderlessTabButtonUI$ScrollableTabButton::setBorderPainted → NO_COVERAGE

Active mutators

Tests examined


Report generated by PIT 1.16.1