PanelGeneral.java

1
package com.jsql.view.swing.panel.preferences;
2
3
import com.jsql.view.swing.panel.PanelPreferences;
4
import com.jsql.view.swing.util.MediatorHelper;
5
import org.apache.commons.lang3.StringUtils;
6
7
import javax.swing.*;
8
import java.util.stream.Stream;
9
10
public class PanelGeneral extends JPanel {
11
12
    private final JCheckBox checkboxIsCheckingUpdate = new JCheckBox(StringUtils.EMPTY, MediatorHelper.model().getMediatorUtils().getPreferencesUtil().isCheckingUpdate());
13
    private final JCheckBox checkboxIsReportingBugs = new JCheckBox(StringUtils.EMPTY, MediatorHelper.model().getMediatorUtils().getPreferencesUtil().isReportingBugs());
14
    private final JCheckBox checkboxIs4K = new JCheckBox(StringUtils.EMPTY, MediatorHelper.model().getMediatorUtils().getPreferencesUtil().is4K());
15
    
16
    public PanelGeneral(PanelPreferences panelPreferences) {
17
        
18 1 1. <init> : removed call to com/jsql/view/swing/panel/preferences/PanelGeneral::setBorder → NO_COVERAGE
        this.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0));
19
        
20 1 1. <init> : removed call to javax/swing/JCheckBox::setFocusable → NO_COVERAGE
        this.getCheckboxIsCheckingUpdate().setFocusable(false);
21
        var labelIsCheckingUpdate = new JButton("Check update at startup");
22 1 1. <init> : removed call to javax/swing/JButton::addActionListener → NO_COVERAGE
        labelIsCheckingUpdate.addActionListener(actionEvent -> {
23
            
24 2 1. lambda$new$0 : removed call to javax/swing/JCheckBox::setSelected → NO_COVERAGE
2. lambda$new$0 : negated conditional → NO_COVERAGE
            this.getCheckboxIsCheckingUpdate().setSelected(!this.getCheckboxIsCheckingUpdate().isSelected());
25 1 1. lambda$new$0 : removed call to java/awt/event/ActionListener::actionPerformed → NO_COVERAGE
            panelPreferences.getActionListenerSave().actionPerformed(null);
26
        });
27
        
28
        var tooltipIsReportingBugs = "Send unhandled exception to developer in order to fix issues.";
29 1 1. <init> : removed call to javax/swing/JCheckBox::setToolTipText → NO_COVERAGE
        this.getCheckboxIsReportingBugs().setToolTipText(tooltipIsReportingBugs);
30 1 1. <init> : removed call to javax/swing/JCheckBox::setFocusable → NO_COVERAGE
        this.getCheckboxIsReportingBugs().setFocusable(false);
31
        var labelIsReportingBugs = new JButton("Report unhandled exceptions");
32 1 1. <init> : removed call to javax/swing/JButton::setToolTipText → NO_COVERAGE
        labelIsReportingBugs.setToolTipText(tooltipIsReportingBugs);
33 1 1. <init> : removed call to javax/swing/JButton::addActionListener → NO_COVERAGE
        labelIsReportingBugs.addActionListener(actionEvent -> {
34
            
35 2 1. lambda$new$1 : negated conditional → NO_COVERAGE
2. lambda$new$1 : removed call to javax/swing/JCheckBox::setSelected → NO_COVERAGE
            this.getCheckboxIsReportingBugs().setSelected(!this.getCheckboxIsReportingBugs().isSelected());
36 1 1. lambda$new$1 : removed call to java/awt/event/ActionListener::actionPerformed → NO_COVERAGE
            panelPreferences.getActionListenerSave().actionPerformed(null);
37
        });
38
        
39
        var tooltipIs4K = "Upscale GUI by factor 2.5 for compatibility with high-definition screens";
40 1 1. <init> : removed call to javax/swing/JCheckBox::setToolTipText → NO_COVERAGE
        this.getCheckboxIs4K().setToolTipText(tooltipIs4K);
41 1 1. <init> : removed call to javax/swing/JCheckBox::setFocusable → NO_COVERAGE
        this.getCheckboxIs4K().setFocusable(false);
42
        var labelIs4K = new JButton("Enable high-definition mode for 4K screens (need a restart)");
43 1 1. <init> : removed call to javax/swing/JButton::setToolTipText → NO_COVERAGE
        labelIs4K.setToolTipText(tooltipIs4K);
44 1 1. <init> : removed call to javax/swing/JButton::addActionListener → NO_COVERAGE
        labelIs4K.addActionListener(actionEvent -> {
45
            
46 2 1. lambda$new$2 : removed call to javax/swing/JCheckBox::setSelected → NO_COVERAGE
2. lambda$new$2 : negated conditional → NO_COVERAGE
            this.getCheckboxIs4K().setSelected(!this.getCheckboxIs4K().isSelected());
47 1 1. lambda$new$2 : removed call to java/awt/event/ActionListener::actionPerformed → NO_COVERAGE
            panelPreferences.getActionListenerSave().actionPerformed(null);
48
        });
49
        
50
        var groupLayout = new GroupLayout(this);
51 1 1. <init> : removed call to com/jsql/view/swing/panel/preferences/PanelGeneral::setLayout → NO_COVERAGE
        this.setLayout(groupLayout);
52
        
53
        Stream.of(
54
            this.checkboxIsCheckingUpdate,
55
            this.checkboxIsReportingBugs,
56
            this.checkboxIs4K
57
        )
58 2 1. <init> : removed call to java/util/stream/Stream::forEach → NO_COVERAGE
2. lambda$new$3 : removed call to javax/swing/JCheckBox::addActionListener → NO_COVERAGE
        .forEach(button -> button.addActionListener(panelPreferences.getActionListenerSave()));
59
        
60
        Stream.of(
61
            labelIsCheckingUpdate,
62
            labelIsReportingBugs,
63
            labelIs4K
64
        )
65 1 1. <init> : removed call to java/util/stream/Stream::forEach → NO_COVERAGE
        .forEach(label -> {
66
            
67 1 1. lambda$new$4 : removed call to javax/swing/JButton::setHorizontalAlignment → NO_COVERAGE
            label.setHorizontalAlignment(SwingConstants.LEFT);
68 1 1. lambda$new$4 : removed call to javax/swing/JButton::setBorderPainted → NO_COVERAGE
            label.setBorderPainted(false);
69 1 1. lambda$new$4 : removed call to javax/swing/JButton::setContentAreaFilled → NO_COVERAGE
            label.setContentAreaFilled(false);
70
        });
71
        
72
        groupLayout
73 1 1. <init> : removed call to javax/swing/GroupLayout::setHorizontalGroup → NO_COVERAGE
        .setHorizontalGroup(
74
            groupLayout
75
            .createSequentialGroup()
76
            .addGroup(
77
                groupLayout
78
                .createParallelGroup(GroupLayout.Alignment.TRAILING, false)
79
                .addComponent(this.checkboxIsCheckingUpdate)
80
                .addComponent(this.checkboxIsReportingBugs)
81
                .addComponent(this.checkboxIs4K)
82
            )
83
            .addGroup(
84
                groupLayout
85
                .createParallelGroup()
86
                .addComponent(labelIsCheckingUpdate)
87
                .addComponent(labelIsReportingBugs)
88
                .addComponent(labelIs4K)
89
            )
90
        );
91
92
        groupLayout
93 1 1. <init> : removed call to javax/swing/GroupLayout::setVerticalGroup → NO_COVERAGE
        .setVerticalGroup(
94
            groupLayout
95
            .createSequentialGroup()
96
            .addGroup(
97
                groupLayout
98
                .createParallelGroup(GroupLayout.Alignment.BASELINE)
99
                .addComponent(this.checkboxIsCheckingUpdate)
100
                .addComponent(labelIsCheckingUpdate)
101
            )
102
            .addGroup(
103
                groupLayout
104
                .createParallelGroup(GroupLayout.Alignment.BASELINE)
105
                .addComponent(this.checkboxIsReportingBugs)
106
                .addComponent(labelIsReportingBugs)
107
            )
108
            .addGroup(
109
                groupLayout
110
                .createParallelGroup(GroupLayout.Alignment.BASELINE)
111
                .addComponent(this.checkboxIs4K)
112
                .addComponent(labelIs4K)
113
            )
114
        );
115
    }
116
117
    
118
    // Getter and setter
119
    
120
    public JCheckBox getCheckboxIsCheckingUpdate() {
121 1 1. getCheckboxIsCheckingUpdate : replaced return value with null for com/jsql/view/swing/panel/preferences/PanelGeneral::getCheckboxIsCheckingUpdate → NO_COVERAGE
        return this.checkboxIsCheckingUpdate;
122
    }
123
124
    public JCheckBox getCheckboxIsReportingBugs() {
125 1 1. getCheckboxIsReportingBugs : replaced return value with null for com/jsql/view/swing/panel/preferences/PanelGeneral::getCheckboxIsReportingBugs → NO_COVERAGE
        return this.checkboxIsReportingBugs;
126
    }
127
128
    public JCheckBox getCheckboxIs4K() {
129 1 1. getCheckboxIs4K : replaced return value with null for com/jsql/view/swing/panel/preferences/PanelGeneral::getCheckboxIs4K → NO_COVERAGE
        return this.checkboxIs4K;
130
    }
131
}

Mutations

18

1.1
Location : <init>
Killed by : none
removed call to com/jsql/view/swing/panel/preferences/PanelGeneral::setBorder → NO_COVERAGE

20

1.1
Location : <init>
Killed by : none
removed call to javax/swing/JCheckBox::setFocusable → NO_COVERAGE

22

1.1
Location : <init>
Killed by : none
removed call to javax/swing/JButton::addActionListener → NO_COVERAGE

24

1.1
Location : lambda$new$0
Killed by : none
removed call to javax/swing/JCheckBox::setSelected → NO_COVERAGE

2.2
Location : lambda$new$0
Killed by : none
negated conditional → NO_COVERAGE

25

1.1
Location : lambda$new$0
Killed by : none
removed call to java/awt/event/ActionListener::actionPerformed → NO_COVERAGE

29

1.1
Location : <init>
Killed by : none
removed call to javax/swing/JCheckBox::setToolTipText → NO_COVERAGE

30

1.1
Location : <init>
Killed by : none
removed call to javax/swing/JCheckBox::setFocusable → NO_COVERAGE

32

1.1
Location : <init>
Killed by : none
removed call to javax/swing/JButton::setToolTipText → NO_COVERAGE

33

1.1
Location : <init>
Killed by : none
removed call to javax/swing/JButton::addActionListener → NO_COVERAGE

35

1.1
Location : lambda$new$1
Killed by : none
negated conditional → NO_COVERAGE

2.2
Location : lambda$new$1
Killed by : none
removed call to javax/swing/JCheckBox::setSelected → NO_COVERAGE

36

1.1
Location : lambda$new$1
Killed by : none
removed call to java/awt/event/ActionListener::actionPerformed → NO_COVERAGE

40

1.1
Location : <init>
Killed by : none
removed call to javax/swing/JCheckBox::setToolTipText → NO_COVERAGE

41

1.1
Location : <init>
Killed by : none
removed call to javax/swing/JCheckBox::setFocusable → NO_COVERAGE

43

1.1
Location : <init>
Killed by : none
removed call to javax/swing/JButton::setToolTipText → NO_COVERAGE

44

1.1
Location : <init>
Killed by : none
removed call to javax/swing/JButton::addActionListener → NO_COVERAGE

46

1.1
Location : lambda$new$2
Killed by : none
removed call to javax/swing/JCheckBox::setSelected → NO_COVERAGE

2.2
Location : lambda$new$2
Killed by : none
negated conditional → NO_COVERAGE

47

1.1
Location : lambda$new$2
Killed by : none
removed call to java/awt/event/ActionListener::actionPerformed → NO_COVERAGE

51

1.1
Location : <init>
Killed by : none
removed call to com/jsql/view/swing/panel/preferences/PanelGeneral::setLayout → NO_COVERAGE

58

1.1
Location : <init>
Killed by : none
removed call to java/util/stream/Stream::forEach → NO_COVERAGE

2.2
Location : lambda$new$3
Killed by : none
removed call to javax/swing/JCheckBox::addActionListener → NO_COVERAGE

65

1.1
Location : <init>
Killed by : none
removed call to java/util/stream/Stream::forEach → NO_COVERAGE

67

1.1
Location : lambda$new$4
Killed by : none
removed call to javax/swing/JButton::setHorizontalAlignment → NO_COVERAGE

68

1.1
Location : lambda$new$4
Killed by : none
removed call to javax/swing/JButton::setBorderPainted → NO_COVERAGE

69

1.1
Location : lambda$new$4
Killed by : none
removed call to javax/swing/JButton::setContentAreaFilled → NO_COVERAGE

73

1.1
Location : <init>
Killed by : none
removed call to javax/swing/GroupLayout::setHorizontalGroup → NO_COVERAGE

93

1.1
Location : <init>
Killed by : none
removed call to javax/swing/GroupLayout::setVerticalGroup → NO_COVERAGE

121

1.1
Location : getCheckboxIsCheckingUpdate
Killed by : none
replaced return value with null for com/jsql/view/swing/panel/preferences/PanelGeneral::getCheckboxIsCheckingUpdate → NO_COVERAGE

125

1.1
Location : getCheckboxIsReportingBugs
Killed by : none
replaced return value with null for com/jsql/view/swing/panel/preferences/PanelGeneral::getCheckboxIsReportingBugs → NO_COVERAGE

129

1.1
Location : getCheckboxIs4K
Killed by : none
replaced return value with null for com/jsql/view/swing/panel/preferences/PanelGeneral::getCheckboxIs4K → NO_COVERAGE

Active mutators

Tests examined


Report generated by PIT 1.16.1