1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
package issrg.test; |
8 |
|
|
9 |
|
import java.awt.Dimension; |
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
@author |
15 |
|
|
|
|
| 0% |
Uncovered Elements: 104 (104) |
Complexity: 6 |
Complexity Density: 0.19 |
|
16 |
|
public class SATJDialog extends javax.swing.JDialog { |
17 |
|
int satlevel; |
18 |
|
|
|
|
| 0% |
Uncovered Elements: 14 (14) |
Complexity: 1 |
Complexity Density: 0.07 |
|
19 |
0
|
public SATJDialog(java.awt.Frame parent, boolean modal) {... |
20 |
0
|
super(parent, modal); |
21 |
0
|
initComponents(); |
22 |
|
|
23 |
0
|
arrayy=new java.awt.Label[]{label1,label2,label3,label4,label5}; |
24 |
0
|
label1.setEnabled(false); |
25 |
0
|
jLabel1.setText("Logging: "+ label5.getText()+ ": "+label4.getText()+": "+label3.getText()+": "+label2.getText()); |
26 |
0
|
this.setTitle("Choose SAT Level"); |
27 |
0
|
this.setModal(true); |
28 |
0
|
this.setLocation (0,0); |
29 |
0
|
this.setBounds(0,0,500,400); |
30 |
0
|
this.setEnabled(true); |
31 |
0
|
this.setFocusable(true); |
32 |
0
|
this.setFocusTraversalKeysEnabled(true); |
33 |
0
|
this.toFront(); |
34 |
0
|
this.setVisible(true); |
35 |
|
|
36 |
|
} |
37 |
|
|
38 |
|
|
39 |
|
|
40 |
|
|
41 |
|
|
42 |
|
|
43 |
|
|
|
|
| 0% |
Uncovered Elements: 44 (44) |
Complexity: 1 |
Complexity Density: 0.02 |
|
44 |
0
|
private void initComponents() {... |
45 |
0
|
jSlider1 = new javax.swing.JSlider(); |
46 |
0
|
label4 = new java.awt.Label(); |
47 |
0
|
label3 = new java.awt.Label(); |
48 |
0
|
label5 = new java.awt.Label(); |
49 |
0
|
label2 = new java.awt.Label(); |
50 |
0
|
label1 = new java.awt.Label(); |
51 |
0
|
jLabel1 = new javax.swing.JLabel(); |
52 |
0
|
jToggleButton3 = new javax.swing.JToggleButton(); |
53 |
0
|
jToggleButton2 = new javax.swing.JToggleButton(); |
54 |
|
|
55 |
0
|
getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout()); |
56 |
|
|
57 |
0
|
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); |
58 |
0
|
setTitle("SATLevel"); |
59 |
0
|
setModal(true); |
60 |
0
|
jSlider1.setMajorTickSpacing(1); |
61 |
0
|
jSlider1.setMaximum(4); |
62 |
0
|
jSlider1.setOrientation(javax.swing.JSlider.VERTICAL); |
63 |
0
|
jSlider1.setPaintLabels(true); |
64 |
0
|
jSlider1.setPaintTicks(true); |
65 |
0
|
jSlider1.setSnapToTicks(true); |
66 |
0
|
jSlider1.addMouseListener(new java.awt.event.MouseAdapter() { |
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
67 |
0
|
public void mouseReleased(java.awt.event.MouseEvent evt) {... |
68 |
0
|
jSlider1MouseReleased(evt); |
69 |
|
} |
70 |
|
}); |
71 |
|
|
72 |
0
|
getContentPane().add(jSlider1, new org.netbeans.lib.awtextra.AbsoluteConstraints(40, 10, -1, -1)); |
73 |
|
|
74 |
0
|
label4.setText("Acess Deny"); |
75 |
0
|
getContentPane().add(label4, new org.netbeans.lib.awtextra.AbsoluteConstraints(100, 50, -1, 30)); |
76 |
|
|
77 |
0
|
label3.setText("Policy changes"); |
78 |
0
|
getContentPane().add(label3, new org.netbeans.lib.awtextra.AbsoluteConstraints(100, 100, -1, -1)); |
79 |
|
|
80 |
0
|
label5.setText("Acess Grants"); |
81 |
0
|
getContentPane().add(label5, new org.netbeans.lib.awtextra.AbsoluteConstraints(100, 10, -1, -1)); |
82 |
|
|
83 |
0
|
label2.setText("ShutDown/StartUp"); |
84 |
0
|
getContentPane().add(label2, new org.netbeans.lib.awtextra.AbsoluteConstraints(100, 140, -1, 30)); |
85 |
|
|
86 |
0
|
label1.setText("No Info"); |
87 |
0
|
getContentPane().add(label1, new org.netbeans.lib.awtextra.AbsoluteConstraints(100, 190, -1, -1)); |
88 |
|
|
89 |
0
|
jLabel1.setText(" "); |
90 |
0
|
getContentPane().add(jLabel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 260, -1, -1)); |
91 |
|
|
92 |
0
|
jToggleButton3.setText("Cancel"); |
93 |
0
|
jToggleButton3.setMaximumSize(new java.awt.Dimension(53, 23)); |
94 |
0
|
jToggleButton3.setMinimumSize(new java.awt.Dimension(53, 23)); |
95 |
0
|
jToggleButton3.addMouseListener(new java.awt.event.MouseAdapter() { |
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
96 |
0
|
public void mouseClicked(java.awt.event.MouseEvent evt) {... |
97 |
0
|
jToggleButton3MouseClicked(evt); |
98 |
|
} |
99 |
|
}); |
100 |
|
|
101 |
0
|
getContentPane().add(jToggleButton3, new org.netbeans.lib.awtextra.AbsoluteConstraints(350, 120, -1, -1)); |
102 |
|
|
103 |
0
|
jToggleButton2.setText("OK"); |
104 |
0
|
jToggleButton2.setMaximumSize(new java.awt.Dimension(53, 23)); |
105 |
0
|
jToggleButton2.setMinimumSize(new java.awt.Dimension(53, 23)); |
106 |
0
|
jToggleButton2.addMouseListener(new java.awt.event.MouseAdapter() { |
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
107 |
0
|
public void mouseClicked(java.awt.event.MouseEvent evt) {... |
108 |
0
|
jToggleButton2MouseClicked(evt); |
109 |
|
} |
110 |
|
}); |
111 |
|
|
112 |
0
|
getContentPane().add(jToggleButton2, new org.netbeans.lib.awtextra.AbsoluteConstraints(350, 90, 70, -1)); |
113 |
|
|
114 |
0
|
pack(); |
115 |
|
} |
116 |
|
|
|
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
117 |
0
|
private void jToggleButton2MouseClicked(java.awt.event.MouseEvent evt) {... |
118 |
|
|
119 |
0
|
satlevel=jSlider1.getValue(); |
120 |
0
|
this.setVisible(false); |
121 |
|
} |
122 |
|
|
|
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
123 |
0
|
private void jToggleButton3MouseClicked(java.awt.event.MouseEvent evt) {... |
124 |
|
|
125 |
0
|
this.dispose(); |
126 |
0
|
System.exit(-1); |
127 |
|
} |
128 |
|
|
|
|
| 0% |
Uncovered Elements: 12 (12) |
Complexity: 2 |
Complexity Density: 0.2 |
|
129 |
0
|
private void jSlider1MouseReleased(java.awt.event.MouseEvent evt) {... |
130 |
|
|
131 |
|
|
132 |
|
|
133 |
0
|
if(jSlider1.getValue()==0){ |
134 |
0
|
label1.setEnabled(true); |
135 |
0
|
label2.setEnabled(false); |
136 |
0
|
label3.setEnabled(false); |
137 |
0
|
label4.setEnabled(false); |
138 |
0
|
label5.setEnabled(false); |
139 |
|
} else{ |
140 |
0
|
label1.setEnabled(false); |
141 |
0
|
turnOffAbove(jSlider1.getValue(),4); |
142 |
0
|
turnOnBelow(jSlider1.getValue(),0); |
143 |
|
|
144 |
|
} |
145 |
0
|
showOnNames(); |
146 |
|
} |
|
|
| 0% |
Uncovered Elements: 4 (4) |
Complexity: 2 |
Complexity Density: 1 |
|
147 |
0
|
void turnOffAbove(int x,int maximum){... |
148 |
0
|
for(int i=x;i<=maximum;i++) |
149 |
0
|
arrayy[i].setEnabled(false); |
150 |
|
} |
151 |
|
|
|
|
| 0% |
Uncovered Elements: 4 (4) |
Complexity: 2 |
Complexity Density: 1 |
|
152 |
0
|
void turnOnBelow(int x,int minimum){... |
153 |
0
|
for(int i=x;i>minimum;i--){ |
154 |
0
|
arrayy[i].setEnabled(true); |
155 |
|
} |
156 |
|
} |
157 |
|
|
|
|
| 0% |
Uncovered Elements: 8 (8) |
Complexity: 3 |
Complexity Density: 0.75 |
|
158 |
0
|
void showOnNames(){... |
159 |
0
|
jLabel1.setText("Logging: "); |
160 |
0
|
for(int i=0;i<5;i++) |
161 |
0
|
if(arrayy[i].isEnabled()) |
162 |
0
|
jLabel1.setText(jLabel1.getText()+ ": "+arrayy[i].getText()); |
163 |
|
} |
164 |
|
|
165 |
|
|
166 |
|
@param |
167 |
|
|
168 |
|
|
169 |
|
|
170 |
|
|
171 |
|
|
172 |
|
|
173 |
|
|
174 |
|
|
175 |
|
|
176 |
|
|
177 |
|
private javax.swing.JLabel jLabel1; |
178 |
|
private javax.swing.JSlider jSlider1; |
179 |
|
private javax.swing.JToggleButton jToggleButton2; |
180 |
|
private javax.swing.JToggleButton jToggleButton3; |
181 |
|
private java.awt.Label label1; |
182 |
|
private java.awt.Label label2; |
183 |
|
private java.awt.Label label3; |
184 |
|
private java.awt.Label label4; |
185 |
|
private java.awt.Label label5; |
186 |
|
|
187 |
|
private java.awt.Label[] arrayy; |
188 |
|
} |