CheckBoxMenuItemIconCustom.java

1
package com.jsql.view.swing.tree;
2
3
import javax.swing.*;
4
import javax.swing.plaf.UIResource;
5
import javax.swing.plaf.metal.MetalLookAndFeel;
6
import java.awt.*;
7
import java.io.Serializable;
8
9
public class CheckBoxMenuItemIconCustom implements Icon, UIResource, Serializable {
10
11
    @Override
12
    public void paintIcon(Component component, Graphics graphics, int x, int y) {
13
        
14
        AbstractButton abstractButton = (AbstractButton) component;
15
        ButtonModel model = abstractButton.getModel();
16
17
        boolean isSelected = model.isSelected();
18
        boolean isEnabled = model.isEnabled();
19
        boolean isPressed = model.isPressed();
20
        boolean isArmed = model.isArmed();
21
22 1 1. paintIcon : removed call to java/awt/Graphics::translate → NO_COVERAGE
        graphics.translate(x, y);
23
24 1 1. paintIcon : negated conditional → NO_COVERAGE
        if (isEnabled) {
25
            
26 2 1. paintIcon : negated conditional → NO_COVERAGE
2. paintIcon : negated conditional → NO_COVERAGE
            if (isPressed || isArmed) {
27
                
28 1 1. paintIcon : removed call to java/awt/Graphics::setColor → NO_COVERAGE
                graphics.setColor(MetalLookAndFeel.getControlInfo());
29 1 1. paintIcon : removed call to java/awt/Graphics::drawLine → NO_COVERAGE
                graphics.drawLine(0, 0, 8, 0);
30 1 1. paintIcon : removed call to java/awt/Graphics::drawLine → NO_COVERAGE
                graphics.drawLine(0, 0, 0, 8);
31 1 1. paintIcon : removed call to java/awt/Graphics::drawLine → NO_COVERAGE
                graphics.drawLine(8, 2, 8, 8);
32 1 1. paintIcon : removed call to java/awt/Graphics::drawLine → NO_COVERAGE
                graphics.drawLine(2, 8, 8, 8);
33
34 1 1. paintIcon : removed call to java/awt/Graphics::setColor → NO_COVERAGE
                graphics.setColor(MetalLookAndFeel.getPrimaryControl());
35
36
            } else {
37
                
38 1 1. paintIcon : removed call to java/awt/Graphics::setColor → NO_COVERAGE
                graphics.setColor(MetalLookAndFeel.getControlDarkShadow());
39 1 1. paintIcon : removed call to java/awt/Graphics::drawLine → NO_COVERAGE
                graphics.drawLine(0, 0, 8, 0);
40 1 1. paintIcon : removed call to java/awt/Graphics::drawLine → NO_COVERAGE
                graphics.drawLine(0, 0, 0, 8);
41 1 1. paintIcon : removed call to java/awt/Graphics::drawLine → NO_COVERAGE
                graphics.drawLine(8, 2, 8, 8);
42 1 1. paintIcon : removed call to java/awt/Graphics::drawLine → NO_COVERAGE
                graphics.drawLine(2, 8, 8, 8);
43
44 1 1. paintIcon : removed call to java/awt/Graphics::setColor → NO_COVERAGE
                graphics.setColor(MetalLookAndFeel.getControlHighlight());
45
            }
46
47 1 1. paintIcon : removed call to java/awt/Graphics::drawLine → NO_COVERAGE
            graphics.drawLine(1, 1, 7, 1);
48 1 1. paintIcon : removed call to java/awt/Graphics::drawLine → NO_COVERAGE
            graphics.drawLine(1, 1, 1, 7);
49 1 1. paintIcon : removed call to java/awt/Graphics::drawLine → NO_COVERAGE
            graphics.drawLine(9, 1, 9, 9);
50 1 1. paintIcon : removed call to java/awt/Graphics::drawLine → NO_COVERAGE
            graphics.drawLine(1, 9, 9, 9);
51
52
        } else {
53
            
54 1 1. paintIcon : removed call to java/awt/Graphics::setColor → NO_COVERAGE
            graphics.setColor(MetalLookAndFeel.getMenuDisabledForeground());
55 1 1. paintIcon : removed call to java/awt/Graphics::drawRect → NO_COVERAGE
            graphics.drawRect(0, 0, 8, 8);
56
        }
57
58 1 1. paintIcon : negated conditional → NO_COVERAGE
        if (isSelected) {
59 1 1. paintIcon : removed call to com/jsql/view/swing/tree/CheckBoxMenuItemIconCustom::drawSelected → NO_COVERAGE
            this.drawSelected(component, graphics, abstractButton, model, isEnabled);
60
        }
61
62 3 1. paintIcon : removed call to java/awt/Graphics::translate → NO_COVERAGE
2. paintIcon : removed negation → NO_COVERAGE
3. paintIcon : removed negation → NO_COVERAGE
        graphics.translate(-x, -y);
63
    }
64
65
    private void drawSelected(Component component, Graphics graphics, AbstractButton abstractButton, ButtonModel model, boolean isEnabled) {
66
        
67 1 1. drawSelected : negated conditional → NO_COVERAGE
        if (isEnabled) {
68 3 1. drawSelected : negated conditional → NO_COVERAGE
2. drawSelected : negated conditional → NO_COVERAGE
3. drawSelected : negated conditional → NO_COVERAGE
            if (model.isArmed() || (component instanceof JMenu && model.isSelected())) {
69 1 1. drawSelected : removed call to java/awt/Graphics::setColor → NO_COVERAGE
                graphics.setColor(MetalLookAndFeel.getMenuSelectedForeground());
70
            } else {
71 1 1. drawSelected : removed call to java/awt/Graphics::setColor → NO_COVERAGE
                graphics.setColor(abstractButton.getForeground());
72
            }
73
        } else {
74 1 1. drawSelected : removed call to java/awt/Graphics::setColor → NO_COVERAGE
            graphics.setColor(MetalLookAndFeel.getMenuDisabledForeground());
75
        }
76
77 1 1. drawSelected : removed call to java/awt/Graphics::drawLine → NO_COVERAGE
        graphics.drawLine(2, 2, 2, 6);
78 1 1. drawSelected : removed call to java/awt/Graphics::drawLine → NO_COVERAGE
        graphics.drawLine(3, 2, 3, 6);
79 1 1. drawSelected : removed call to java/awt/Graphics::drawLine → NO_COVERAGE
        graphics.drawLine(4, 4, 8, 0);
80 1 1. drawSelected : removed call to java/awt/Graphics::drawLine → NO_COVERAGE
        graphics.drawLine(4, 5, 9, 0);
81
    }
82
83
    @Override
84
    public int getIconWidth() {
85 1 1. getIconWidth : replaced int return with 0 for com/jsql/view/swing/tree/CheckBoxMenuItemIconCustom::getIconWidth → NO_COVERAGE
        return 10;
86
    }
87
88
    @Override
89
    public int getIconHeight() {
90 1 1. getIconHeight : replaced int return with 0 for com/jsql/view/swing/tree/CheckBoxMenuItemIconCustom::getIconHeight → NO_COVERAGE
        return 10;
91
    }
92
}

Mutations

22

1.1
Location : paintIcon
Killed by : none
removed call to java/awt/Graphics::translate → NO_COVERAGE

24

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

26

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

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

28

1.1
Location : paintIcon
Killed by : none
removed call to java/awt/Graphics::setColor → NO_COVERAGE

29

1.1
Location : paintIcon
Killed by : none
removed call to java/awt/Graphics::drawLine → NO_COVERAGE

30

1.1
Location : paintIcon
Killed by : none
removed call to java/awt/Graphics::drawLine → NO_COVERAGE

31

1.1
Location : paintIcon
Killed by : none
removed call to java/awt/Graphics::drawLine → NO_COVERAGE

32

1.1
Location : paintIcon
Killed by : none
removed call to java/awt/Graphics::drawLine → NO_COVERAGE

34

1.1
Location : paintIcon
Killed by : none
removed call to java/awt/Graphics::setColor → NO_COVERAGE

38

1.1
Location : paintIcon
Killed by : none
removed call to java/awt/Graphics::setColor → NO_COVERAGE

39

1.1
Location : paintIcon
Killed by : none
removed call to java/awt/Graphics::drawLine → NO_COVERAGE

40

1.1
Location : paintIcon
Killed by : none
removed call to java/awt/Graphics::drawLine → NO_COVERAGE

41

1.1
Location : paintIcon
Killed by : none
removed call to java/awt/Graphics::drawLine → NO_COVERAGE

42

1.1
Location : paintIcon
Killed by : none
removed call to java/awt/Graphics::drawLine → NO_COVERAGE

44

1.1
Location : paintIcon
Killed by : none
removed call to java/awt/Graphics::setColor → NO_COVERAGE

47

1.1
Location : paintIcon
Killed by : none
removed call to java/awt/Graphics::drawLine → NO_COVERAGE

48

1.1
Location : paintIcon
Killed by : none
removed call to java/awt/Graphics::drawLine → NO_COVERAGE

49

1.1
Location : paintIcon
Killed by : none
removed call to java/awt/Graphics::drawLine → NO_COVERAGE

50

1.1
Location : paintIcon
Killed by : none
removed call to java/awt/Graphics::drawLine → NO_COVERAGE

54

1.1
Location : paintIcon
Killed by : none
removed call to java/awt/Graphics::setColor → NO_COVERAGE

55

1.1
Location : paintIcon
Killed by : none
removed call to java/awt/Graphics::drawRect → NO_COVERAGE

58

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

59

1.1
Location : paintIcon
Killed by : none
removed call to com/jsql/view/swing/tree/CheckBoxMenuItemIconCustom::drawSelected → NO_COVERAGE

62

1.1
Location : paintIcon
Killed by : none
removed call to java/awt/Graphics::translate → NO_COVERAGE

2.2
Location : paintIcon
Killed by : none
removed negation → NO_COVERAGE

3.3
Location : paintIcon
Killed by : none
removed negation → NO_COVERAGE

67

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

68

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

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

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

69

1.1
Location : drawSelected
Killed by : none
removed call to java/awt/Graphics::setColor → NO_COVERAGE

71

1.1
Location : drawSelected
Killed by : none
removed call to java/awt/Graphics::setColor → NO_COVERAGE

74

1.1
Location : drawSelected
Killed by : none
removed call to java/awt/Graphics::setColor → NO_COVERAGE

77

1.1
Location : drawSelected
Killed by : none
removed call to java/awt/Graphics::drawLine → NO_COVERAGE

78

1.1
Location : drawSelected
Killed by : none
removed call to java/awt/Graphics::drawLine → NO_COVERAGE

79

1.1
Location : drawSelected
Killed by : none
removed call to java/awt/Graphics::drawLine → NO_COVERAGE

80

1.1
Location : drawSelected
Killed by : none
removed call to java/awt/Graphics::drawLine → NO_COVERAGE

85

1.1
Location : getIconWidth
Killed by : none
replaced int return with 0 for com/jsql/view/swing/tree/CheckBoxMenuItemIconCustom::getIconWidth → NO_COVERAGE

90

1.1
Location : getIconHeight
Killed by : none
replaced int return with 0 for com/jsql/view/swing/tree/CheckBoxMenuItemIconCustom::getIconHeight → NO_COVERAGE

Active mutators

Tests examined


Report generated by PIT 1.16.1