CheckBoxIcon.java

1
package com.jsql.view.swing.ui;
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 CheckBoxIcon implements Icon, UIResource, Serializable {
10
11
    private static final int CONTROL_SIZE = 12;
12
13
    private void paintOceanIcon(Component c, Graphics g, int x, int y) {
14
        
15
        ButtonModel model = ((JCheckBoxMenuItem) c).getModel();
16
17 1 1. paintOceanIcon : removed call to java/awt/Graphics::translate → NO_COVERAGE
        g.translate(x, y);
18
        
19
        int w = this.getIconWidth();
20
        int h = this.getIconHeight();
21
        
22 1 1. paintOceanIcon : negated conditional → NO_COVERAGE
        if (model.isEnabled()) {
23
            
24 2 1. paintOceanIcon : negated conditional → NO_COVERAGE
2. paintOceanIcon : negated conditional → NO_COVERAGE
            if (model.isPressed() && model.isArmed()) {
25
                
26 1 1. paintOceanIcon : removed call to java/awt/Graphics::setColor → NO_COVERAGE
                g.setColor(MetalLookAndFeel.getControlShadow());
27 1 1. paintOceanIcon : removed call to java/awt/Graphics::fillRect → NO_COVERAGE
                g.fillRect(0, 0, w, h);
28 1 1. paintOceanIcon : removed call to java/awt/Graphics::setColor → NO_COVERAGE
                g.setColor(MetalLookAndFeel.getControlDarkShadow());
29 1 1. paintOceanIcon : removed call to java/awt/Graphics::fillRect → NO_COVERAGE
                g.fillRect(0, 0, w, 2);
30 2 1. paintOceanIcon : removed call to java/awt/Graphics::fillRect → NO_COVERAGE
2. paintOceanIcon : Replaced integer subtraction with addition → NO_COVERAGE
                g.fillRect(0, 2, 2, h - 2);
31 3 1. paintOceanIcon : Replaced integer subtraction with addition → NO_COVERAGE
2. paintOceanIcon : removed call to java/awt/Graphics::fillRect → NO_COVERAGE
3. paintOceanIcon : Replaced integer subtraction with addition → NO_COVERAGE
                g.fillRect(w - 1, 1, 1, h - 1);
32 3 1. paintOceanIcon : removed call to java/awt/Graphics::fillRect → NO_COVERAGE
2. paintOceanIcon : Replaced integer subtraction with addition → NO_COVERAGE
3. paintOceanIcon : Replaced integer subtraction with addition → NO_COVERAGE
                g.fillRect(1, h - 1, w - 2, 1);
33
                
34 1 1. paintOceanIcon : negated conditional → NO_COVERAGE
            } else if (model.isRollover()) {
35
                
36 1 1. paintOceanIcon : removed call to java/awt/Graphics::setColor → NO_COVERAGE
                g.setColor(MetalLookAndFeel.getControlDarkShadow());
37 3 1. paintOceanIcon : Replaced integer subtraction with addition → NO_COVERAGE
2. paintOceanIcon : removed call to java/awt/Graphics::drawRect → NO_COVERAGE
3. paintOceanIcon : Replaced integer subtraction with addition → NO_COVERAGE
                g.drawRect(0, 0, w - 1, h - 1);
38 1 1. paintOceanIcon : removed call to java/awt/Graphics::setColor → NO_COVERAGE
                g.setColor(MetalLookAndFeel.getPrimaryControl());
39 3 1. paintOceanIcon : Replaced integer subtraction with addition → NO_COVERAGE
2. paintOceanIcon : removed call to java/awt/Graphics::drawRect → NO_COVERAGE
3. paintOceanIcon : Replaced integer subtraction with addition → NO_COVERAGE
                g.drawRect(1, 1, w - 3, h - 3);
40 3 1. paintOceanIcon : Replaced integer subtraction with addition → NO_COVERAGE
2. paintOceanIcon : removed call to java/awt/Graphics::drawRect → NO_COVERAGE
3. paintOceanIcon : Replaced integer subtraction with addition → NO_COVERAGE
                g.drawRect(2, 2, w - 5, h - 5);
41
                
42
            } else {
43
                
44 1 1. paintOceanIcon : removed call to java/awt/Graphics::setColor → NO_COVERAGE
                g.setColor(MetalLookAndFeel.getControlDarkShadow());
45 3 1. paintOceanIcon : Replaced integer subtraction with addition → NO_COVERAGE
2. paintOceanIcon : Replaced integer subtraction with addition → NO_COVERAGE
3. paintOceanIcon : removed call to java/awt/Graphics::drawRect → NO_COVERAGE
                g.drawRect(0, 0, w - 1, h - 1);
46
            }
47
            
48 1 1. paintOceanIcon : removed call to java/awt/Graphics::setColor → NO_COVERAGE
            g.setColor(MetalLookAndFeel.getControlInfo());
49
            
50
        } else {
51
            
52 1 1. paintOceanIcon : removed call to java/awt/Graphics::setColor → NO_COVERAGE
            g.setColor(MetalLookAndFeel.getControlDarkShadow());
53 3 1. paintOceanIcon : Replaced integer subtraction with addition → NO_COVERAGE
2. paintOceanIcon : Replaced integer subtraction with addition → NO_COVERAGE
3. paintOceanIcon : removed call to java/awt/Graphics::drawRect → NO_COVERAGE
            g.drawRect(0, 0, w - 1, h - 1);
54
        }
55
        
56 3 1. paintOceanIcon : removed call to java/awt/Graphics::translate → NO_COVERAGE
2. paintOceanIcon : removed negation → NO_COVERAGE
3. paintOceanIcon : removed negation → NO_COVERAGE
        g.translate(-x, -y);
57
        
58 1 1. paintOceanIcon : negated conditional → NO_COVERAGE
        if (model.isSelected()) {
59 1 1. paintOceanIcon : removed call to com/jsql/view/swing/ui/CheckBoxIcon::drawCheck → NO_COVERAGE
            this.drawCheck(g, x, y);
60
        }
61
    }
62
    
63
    protected void drawCheck(Graphics g, int x, int y) {
64
        
65 3 1. drawCheck : Replaced integer addition with subtraction → NO_COVERAGE
2. drawCheck : removed call to java/awt/Graphics::fillRect → NO_COVERAGE
3. drawCheck : Replaced integer addition with subtraction → NO_COVERAGE
        g.fillRect(x + 3, y + 5, 2, CheckBoxIcon.CONTROL_SIZE - 8);
66 7 1. drawCheck : Replaced integer addition with subtraction → NO_COVERAGE
2. drawCheck : Replaced integer addition with subtraction → NO_COVERAGE
3. drawCheck : Replaced integer subtraction with addition → NO_COVERAGE
4. drawCheck : Replaced integer addition with subtraction → NO_COVERAGE
5. drawCheck : Replaced integer subtraction with addition → NO_COVERAGE
6. drawCheck : Replaced integer addition with subtraction → NO_COVERAGE
7. drawCheck : removed call to java/awt/Graphics::drawLine → NO_COVERAGE
        g.drawLine(x + CheckBoxIcon.CONTROL_SIZE - 4, y + 3, x + 5, y + CheckBoxIcon.CONTROL_SIZE - 6);
67 7 1. drawCheck : Replaced integer subtraction with addition → NO_COVERAGE
2. drawCheck : Replaced integer addition with subtraction → NO_COVERAGE
3. drawCheck : Replaced integer subtraction with addition → NO_COVERAGE
4. drawCheck : Replaced integer addition with subtraction → NO_COVERAGE
5. drawCheck : removed call to java/awt/Graphics::drawLine → NO_COVERAGE
6. drawCheck : Replaced integer addition with subtraction → NO_COVERAGE
7. drawCheck : Replaced integer addition with subtraction → NO_COVERAGE
        g.drawLine(x + CheckBoxIcon.CONTROL_SIZE - 4, y + 4, x + 5, y + CheckBoxIcon.CONTROL_SIZE - 5);
68
    }
69
70
    @Override
71
    public void paintIcon(Component c, Graphics g, int x, int y) {
72 1 1. paintIcon : removed call to com/jsql/view/swing/ui/CheckBoxIcon::paintOceanIcon → NO_COVERAGE
        this.paintOceanIcon(c, g, x, y);
73
    }
74
75
    @Override
76
    public int getIconWidth() {
77 1 1. getIconWidth : replaced int return with 0 for com/jsql/view/swing/ui/CheckBoxIcon::getIconWidth → NO_COVERAGE
        return CheckBoxIcon.CONTROL_SIZE;
78
    }
79
80
    @Override
81
    public int getIconHeight() {
82 1 1. getIconHeight : replaced int return with 0 for com/jsql/view/swing/ui/CheckBoxIcon::getIconHeight → NO_COVERAGE
        return CheckBoxIcon.CONTROL_SIZE;
83
    }
84
}

Mutations

17

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

22

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

24

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

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

26

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

27

1.1
Location : paintOceanIcon
Killed by : none
removed call to java/awt/Graphics::fillRect → NO_COVERAGE

28

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

29

1.1
Location : paintOceanIcon
Killed by : none
removed call to java/awt/Graphics::fillRect → NO_COVERAGE

30

1.1
Location : paintOceanIcon
Killed by : none
removed call to java/awt/Graphics::fillRect → NO_COVERAGE

2.2
Location : paintOceanIcon
Killed by : none
Replaced integer subtraction with addition → NO_COVERAGE

31

1.1
Location : paintOceanIcon
Killed by : none
Replaced integer subtraction with addition → NO_COVERAGE

2.2
Location : paintOceanIcon
Killed by : none
removed call to java/awt/Graphics::fillRect → NO_COVERAGE

3.3
Location : paintOceanIcon
Killed by : none
Replaced integer subtraction with addition → NO_COVERAGE

32

1.1
Location : paintOceanIcon
Killed by : none
removed call to java/awt/Graphics::fillRect → NO_COVERAGE

2.2
Location : paintOceanIcon
Killed by : none
Replaced integer subtraction with addition → NO_COVERAGE

3.3
Location : paintOceanIcon
Killed by : none
Replaced integer subtraction with addition → NO_COVERAGE

34

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

36

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

37

1.1
Location : paintOceanIcon
Killed by : none
Replaced integer subtraction with addition → NO_COVERAGE

2.2
Location : paintOceanIcon
Killed by : none
removed call to java/awt/Graphics::drawRect → NO_COVERAGE

3.3
Location : paintOceanIcon
Killed by : none
Replaced integer subtraction with addition → NO_COVERAGE

38

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

39

1.1
Location : paintOceanIcon
Killed by : none
Replaced integer subtraction with addition → NO_COVERAGE

2.2
Location : paintOceanIcon
Killed by : none
removed call to java/awt/Graphics::drawRect → NO_COVERAGE

3.3
Location : paintOceanIcon
Killed by : none
Replaced integer subtraction with addition → NO_COVERAGE

40

1.1
Location : paintOceanIcon
Killed by : none
Replaced integer subtraction with addition → NO_COVERAGE

2.2
Location : paintOceanIcon
Killed by : none
removed call to java/awt/Graphics::drawRect → NO_COVERAGE

3.3
Location : paintOceanIcon
Killed by : none
Replaced integer subtraction with addition → NO_COVERAGE

44

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

45

1.1
Location : paintOceanIcon
Killed by : none
Replaced integer subtraction with addition → NO_COVERAGE

2.2
Location : paintOceanIcon
Killed by : none
Replaced integer subtraction with addition → NO_COVERAGE

3.3
Location : paintOceanIcon
Killed by : none
removed call to java/awt/Graphics::drawRect → NO_COVERAGE

48

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

52

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

53

1.1
Location : paintOceanIcon
Killed by : none
Replaced integer subtraction with addition → NO_COVERAGE

2.2
Location : paintOceanIcon
Killed by : none
Replaced integer subtraction with addition → NO_COVERAGE

3.3
Location : paintOceanIcon
Killed by : none
removed call to java/awt/Graphics::drawRect → NO_COVERAGE

56

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

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

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

58

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

59

1.1
Location : paintOceanIcon
Killed by : none
removed call to com/jsql/view/swing/ui/CheckBoxIcon::drawCheck → NO_COVERAGE

65

1.1
Location : drawCheck
Killed by : none
Replaced integer addition with subtraction → NO_COVERAGE

2.2
Location : drawCheck
Killed by : none
removed call to java/awt/Graphics::fillRect → NO_COVERAGE

3.3
Location : drawCheck
Killed by : none
Replaced integer addition with subtraction → NO_COVERAGE

66

1.1
Location : drawCheck
Killed by : none
Replaced integer addition with subtraction → NO_COVERAGE

2.2
Location : drawCheck
Killed by : none
Replaced integer addition with subtraction → NO_COVERAGE

3.3
Location : drawCheck
Killed by : none
Replaced integer subtraction with addition → NO_COVERAGE

4.4
Location : drawCheck
Killed by : none
Replaced integer addition with subtraction → NO_COVERAGE

5.5
Location : drawCheck
Killed by : none
Replaced integer subtraction with addition → NO_COVERAGE

6.6
Location : drawCheck
Killed by : none
Replaced integer addition with subtraction → NO_COVERAGE

7.7
Location : drawCheck
Killed by : none
removed call to java/awt/Graphics::drawLine → NO_COVERAGE

67

1.1
Location : drawCheck
Killed by : none
Replaced integer subtraction with addition → NO_COVERAGE

2.2
Location : drawCheck
Killed by : none
Replaced integer addition with subtraction → NO_COVERAGE

3.3
Location : drawCheck
Killed by : none
Replaced integer subtraction with addition → NO_COVERAGE

4.4
Location : drawCheck
Killed by : none
Replaced integer addition with subtraction → NO_COVERAGE

5.5
Location : drawCheck
Killed by : none
removed call to java/awt/Graphics::drawLine → NO_COVERAGE

6.6
Location : drawCheck
Killed by : none
Replaced integer addition with subtraction → NO_COVERAGE

7.7
Location : drawCheck
Killed by : none
Replaced integer addition with subtraction → NO_COVERAGE

72

1.1
Location : paintIcon
Killed by : none
removed call to com/jsql/view/swing/ui/CheckBoxIcon::paintOceanIcon → NO_COVERAGE

77

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

82

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

Active mutators

Tests examined


Report generated by PIT 1.16.1