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 | ||
6 | import javax.swing.*; | |
7 | import javax.swing.border.Border; | |
8 | import java.util.stream.Stream; | |
9 | ||
10 | public class PanelGeneral extends JPanel { | |
11 | ||
12 | public static final Border MARGIN = BorderFactory.createEmptyBorder(0,0,2,0); | |
13 | ||
14 | private final JCheckBox checkboxIsCheckingUpdate = new JCheckBox("Check update at startup", MediatorHelper.model().getMediatorUtils().getPreferencesUtil().isCheckingUpdate()); | |
15 | private final JCheckBox checkboxIsReportingBugs = new JCheckBox("Report unhandled exceptions", MediatorHelper.model().getMediatorUtils().getPreferencesUtil().isReportingBugs()); | |
16 | private final JCheckBox checkboxIs4K = new JCheckBox("Enable high-definition mode for 4K screens (need a restart)", MediatorHelper.model().getMediatorUtils().getPreferencesUtil().is4K()); | |
17 | | |
18 | public PanelGeneral(PanelPreferences panelPreferences) { | |
19 |
1
1. <init> : removed call to javax/swing/JCheckBox::setToolTipText → NO_COVERAGE |
this.checkboxIsReportingBugs.setToolTipText("Send unhandled exception to developer in order to fix issues."); |
20 |
1
1. <init> : removed call to javax/swing/JCheckBox::setToolTipText → NO_COVERAGE |
this.checkboxIs4K.setToolTipText("Upscale GUI by factor 2.5 for compatibility with high-definition screens"); |
21 | ||
22 | Stream.of( | |
23 | this.checkboxIsCheckingUpdate, | |
24 | this.checkboxIsReportingBugs, | |
25 | this.checkboxIs4K | |
26 | ) | |
27 |
2
1. <init> : removed call to java/util/stream/Stream::forEach → NO_COVERAGE 2. lambda$new$0 : removed call to javax/swing/JCheckBox::addActionListener → NO_COVERAGE |
.forEach(button -> button.addActionListener(panelPreferences.getActionListenerSave())); |
28 | ||
29 | var labelOrigin = new JLabel("<html><b>Settings and behaviors</b></html>"); | |
30 |
1
1. <init> : removed call to javax/swing/JLabel::setBorder → NO_COVERAGE |
labelOrigin.setBorder(PanelGeneral.MARGIN); |
31 | ||
32 | var groupLayout = new GroupLayout(this); | |
33 |
1
1. <init> : removed call to com/jsql/view/swing/panel/preferences/PanelGeneral::setLayout → NO_COVERAGE |
this.setLayout(groupLayout); |
34 | ||
35 |
1
1. <init> : removed call to javax/swing/GroupLayout::setHorizontalGroup → NO_COVERAGE |
groupLayout.setHorizontalGroup( |
36 | groupLayout | |
37 | .createSequentialGroup() | |
38 | .addGroup( | |
39 | groupLayout | |
40 | .createParallelGroup(GroupLayout.Alignment.LEADING, false) | |
41 | .addComponent(labelOrigin) | |
42 | .addComponent(this.checkboxIsCheckingUpdate) | |
43 | .addComponent(this.checkboxIsReportingBugs) | |
44 | .addComponent(this.checkboxIs4K) | |
45 | ) | |
46 | ); | |
47 | ||
48 |
1
1. <init> : removed call to javax/swing/GroupLayout::setVerticalGroup → NO_COVERAGE |
groupLayout.setVerticalGroup( |
49 | groupLayout | |
50 | .createSequentialGroup() | |
51 | .addGroup( | |
52 | groupLayout | |
53 | .createParallelGroup(GroupLayout.Alignment.BASELINE) | |
54 | .addComponent(labelOrigin) | |
55 | ) | |
56 | .addGroup( | |
57 | groupLayout | |
58 | .createParallelGroup(GroupLayout.Alignment.BASELINE) | |
59 | .addComponent(this.checkboxIsCheckingUpdate) | |
60 | ) | |
61 | .addGroup( | |
62 | groupLayout | |
63 | .createParallelGroup(GroupLayout.Alignment.BASELINE) | |
64 | .addComponent(this.checkboxIsReportingBugs) | |
65 | ) | |
66 | .addGroup( | |
67 | groupLayout | |
68 | .createParallelGroup(GroupLayout.Alignment.BASELINE) | |
69 | .addComponent(this.checkboxIs4K) | |
70 | ) | |
71 | ); | |
72 | } | |
73 | ||
74 | | |
75 | // Getter and setter | |
76 | | |
77 | public JCheckBox getCheckboxIsCheckingUpdate() { | |
78 |
1
1. getCheckboxIsCheckingUpdate : replaced return value with null for com/jsql/view/swing/panel/preferences/PanelGeneral::getCheckboxIsCheckingUpdate → NO_COVERAGE |
return this.checkboxIsCheckingUpdate; |
79 | } | |
80 | ||
81 | public JCheckBox getCheckboxIsReportingBugs() { | |
82 |
1
1. getCheckboxIsReportingBugs : replaced return value with null for com/jsql/view/swing/panel/preferences/PanelGeneral::getCheckboxIsReportingBugs → NO_COVERAGE |
return this.checkboxIsReportingBugs; |
83 | } | |
84 | ||
85 | public JCheckBox getCheckboxIs4K() { | |
86 |
1
1. getCheckboxIs4K : replaced return value with null for com/jsql/view/swing/panel/preferences/PanelGeneral::getCheckboxIs4K → NO_COVERAGE |
return this.checkboxIs4K; |
87 | } | |
88 | } | |
Mutations | ||
19 |
1.1 |
|
20 |
1.1 |
|
27 |
1.1 2.2 |
|
30 |
1.1 |
|
33 |
1.1 |
|
35 |
1.1 |
|
48 |
1.1 |
|
78 |
1.1 |
|
82 |
1.1 |
|
86 |
1.1 |