CheckBoxMenuItemIconCustom.java

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

Mutations

20

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

22

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

23

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

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

24

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

25

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

26

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

27

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

28

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::setColor → NO_COVERAGE

32

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

33

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::drawLine → NO_COVERAGE

35

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

36

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

38

1.1
Location : paintIcon
Killed by : none
removed call to java/awt/Graphics::setColor → 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

43

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::drawLine → NO_COVERAGE

46

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::drawRect → NO_COVERAGE

50

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

51

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

53

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

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

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

57

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

58

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

59

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

61

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

64

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

67

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

68

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

69

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

70

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

75

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

80

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

Active mutators

Tests examined


Report generated by PIT 1.22.1