1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
|
21 |
|
package jalview.jbgui; |
22 |
|
|
23 |
|
import java.awt.BorderLayout; |
24 |
|
import java.awt.Color; |
25 |
|
import java.awt.FlowLayout; |
26 |
|
import java.awt.Font; |
27 |
|
import java.awt.GridLayout; |
28 |
|
import java.awt.event.ActionEvent; |
29 |
|
import java.awt.event.ActionListener; |
30 |
|
|
31 |
|
import javax.swing.JButton; |
32 |
|
import javax.swing.JCheckBoxMenuItem; |
33 |
|
import javax.swing.JComboBox; |
34 |
|
import javax.swing.JInternalFrame; |
35 |
|
import javax.swing.JLabel; |
36 |
|
import javax.swing.JMenu; |
37 |
|
import javax.swing.JMenuBar; |
38 |
|
import javax.swing.JMenuItem; |
39 |
|
import javax.swing.JPanel; |
40 |
|
import javax.swing.event.MenuEvent; |
41 |
|
import javax.swing.event.MenuListener; |
42 |
|
|
43 |
|
import jalview.util.ImageMaker.TYPE; |
44 |
|
import jalview.util.MessageManager; |
45 |
|
|
|
|
| 72.5% |
Uncovered Elements: 41 (149) |
Complexity: 34 |
Complexity Density: 0.3 |
|
46 |
|
public class GPCAPanel extends JInternalFrame |
47 |
|
{ |
48 |
|
private static final Font VERDANA_12 = new Font("Verdana", 0, 12); |
49 |
|
|
50 |
|
protected JComboBox<String> xCombobox = new JComboBox<>(); |
51 |
|
|
52 |
|
protected JComboBox<String> yCombobox = new JComboBox<>(); |
53 |
|
|
54 |
|
protected JComboBox<String> zCombobox = new JComboBox<>(); |
55 |
|
|
56 |
|
protected JMenu viewMenu = new JMenu(); |
57 |
|
|
58 |
|
protected JCheckBoxMenuItem showLabels = new JCheckBoxMenuItem(); |
59 |
|
|
60 |
|
protected JMenu associateViewsMenu = new JMenu(); |
61 |
|
|
62 |
|
protected JLabel statusBar = new JLabel(); |
63 |
|
|
64 |
|
protected JPanel statusPanel = new JPanel(); |
65 |
|
|
66 |
|
protected JMenuItem originalSeqData; |
67 |
|
|
68 |
|
protected JMenuItem outputAlignment; |
69 |
|
|
70 |
|
protected JMenu doClustering; |
71 |
|
|
72 |
|
|
73 |
|
|
74 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
75 |
0 |
public GPCAPanel()... |
76 |
|
{ |
77 |
0 |
this(8); |
78 |
|
} |
79 |
|
|
|
|
| 88.9% |
Uncovered Elements: 1 (9) |
Complexity: 3 |
Complexity Density: 0.43 |
|
80 |
2 |
public GPCAPanel(int dim)... |
81 |
|
{ |
82 |
2 |
try |
83 |
|
{ |
84 |
2 |
jbInit(); |
85 |
|
} catch (Exception e) |
86 |
|
{ |
87 |
0 |
e.printStackTrace(); |
88 |
|
} |
89 |
|
|
90 |
18 |
for (int i = 1; i <= dim; i++) |
91 |
|
{ |
92 |
16 |
xCombobox.addItem("dim " + i); |
93 |
16 |
yCombobox.addItem("dim " + i); |
94 |
16 |
zCombobox.addItem("dim " + i); |
95 |
|
} |
96 |
|
} |
97 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (92) |
Complexity: 1 |
Complexity Density: 0.01 |
|
98 |
2 |
private void jbInit() throws Exception... |
99 |
|
{ |
100 |
2 |
setFrameIcon(null); |
101 |
2 |
setName("jalview-"+this.getClass().getName()); |
102 |
2 |
this.getContentPane().setLayout(new BorderLayout()); |
103 |
2 |
JPanel jPanel2 = new JPanel(); |
104 |
2 |
jPanel2.setLayout(new FlowLayout()); |
105 |
2 |
JLabel jLabel1 = new JLabel(); |
106 |
2 |
jLabel1.setFont(VERDANA_12); |
107 |
2 |
jLabel1.setText("x="); |
108 |
2 |
JLabel jLabel2 = new JLabel(); |
109 |
2 |
jLabel2.setFont(VERDANA_12); |
110 |
2 |
jLabel2.setText("y="); |
111 |
2 |
JLabel jLabel3 = new JLabel(); |
112 |
2 |
jLabel3.setFont(VERDANA_12); |
113 |
2 |
jLabel3.setText("z="); |
114 |
2 |
jPanel2.setBackground(Color.white); |
115 |
2 |
jPanel2.setBorder(null); |
116 |
2 |
zCombobox.setFont(VERDANA_12); |
117 |
2 |
zCombobox.addActionListener(new ActionListener() |
118 |
|
{ |
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
119 |
4 |
@Override... |
120 |
|
public void actionPerformed(ActionEvent e) |
121 |
|
{ |
122 |
4 |
doDimensionChange(); |
123 |
|
} |
124 |
|
}); |
125 |
2 |
yCombobox.setFont(VERDANA_12); |
126 |
2 |
yCombobox.addActionListener(new ActionListener() |
127 |
|
{ |
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
128 |
4 |
@Override... |
129 |
|
public void actionPerformed(ActionEvent e) |
130 |
|
{ |
131 |
4 |
doDimensionChange(); |
132 |
|
} |
133 |
|
}); |
134 |
2 |
xCombobox.setFont(VERDANA_12); |
135 |
2 |
xCombobox.addActionListener(new ActionListener() |
136 |
|
{ |
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
137 |
4 |
@Override... |
138 |
|
public void actionPerformed(ActionEvent e) |
139 |
|
{ |
140 |
4 |
doDimensionChange(); |
141 |
|
} |
142 |
|
}); |
143 |
2 |
JButton resetButton = new JButton(); |
144 |
2 |
resetButton.setFont(VERDANA_12); |
145 |
2 |
resetButton.setText(MessageManager.getString("action.reset")); |
146 |
2 |
resetButton.addActionListener(new ActionListener() |
147 |
|
{ |
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
148 |
0 |
@Override... |
149 |
|
public void actionPerformed(ActionEvent e) |
150 |
|
{ |
151 |
0 |
resetButton_actionPerformed(); |
152 |
|
} |
153 |
|
}); |
154 |
2 |
JMenu fileMenu = new JMenu(); |
155 |
2 |
fileMenu.setText(MessageManager.getString("action.file")); |
156 |
2 |
JMenu saveMenu = new JMenu(); |
157 |
2 |
saveMenu.setText(MessageManager.getString("action.save_as")); |
158 |
2 |
JMenuItem eps = new JMenuItem("EPS"); |
159 |
2 |
eps.addActionListener(new ActionListener() |
160 |
|
{ |
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
161 |
0 |
@Override... |
162 |
|
public void actionPerformed(ActionEvent e) |
163 |
|
{ |
164 |
0 |
makePCAImage(TYPE.EPS); |
165 |
|
} |
166 |
|
}); |
167 |
2 |
JMenuItem png = new JMenuItem("PNG"); |
168 |
2 |
png.addActionListener(new ActionListener() |
169 |
|
{ |
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
170 |
0 |
@Override... |
171 |
|
public void actionPerformed(ActionEvent e) |
172 |
|
{ |
173 |
0 |
makePCAImage(TYPE.PNG); |
174 |
|
} |
175 |
|
}); |
176 |
2 |
JMenuItem outputValues = new JMenuItem(); |
177 |
2 |
outputValues.setText(MessageManager.getString("label.output_values")); |
178 |
2 |
outputValues.addActionListener(new ActionListener() |
179 |
|
{ |
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
180 |
0 |
@Override... |
181 |
|
public void actionPerformed(ActionEvent e) |
182 |
|
{ |
183 |
0 |
outputValues_actionPerformed(); |
184 |
|
} |
185 |
|
}); |
186 |
2 |
JMenuItem outputPoints = new JMenuItem(); |
187 |
2 |
outputPoints.setText(MessageManager.getString("label.output_points")); |
188 |
2 |
outputPoints.addActionListener(new ActionListener() |
189 |
|
{ |
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
190 |
0 |
@Override... |
191 |
|
public void actionPerformed(ActionEvent e) |
192 |
|
{ |
193 |
0 |
outputPoints_actionPerformed(); |
194 |
|
} |
195 |
|
}); |
196 |
2 |
JMenuItem outputProjPoints = new JMenuItem(); |
197 |
2 |
outputProjPoints.setText( |
198 |
|
MessageManager.getString("label.output_transformed_points")); |
199 |
2 |
outputProjPoints.addActionListener(new ActionListener() |
200 |
|
{ |
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
201 |
0 |
@Override... |
202 |
|
public void actionPerformed(ActionEvent e) |
203 |
|
{ |
204 |
0 |
outputProjPoints_actionPerformed(); |
205 |
|
} |
206 |
|
}); |
207 |
2 |
JMenuItem print = new JMenuItem(); |
208 |
2 |
print.setText(MessageManager.getString("action.print")); |
209 |
2 |
print.addActionListener(new ActionListener() |
210 |
|
{ |
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
211 |
0 |
@Override... |
212 |
|
public void actionPerformed(ActionEvent e) |
213 |
|
{ |
214 |
0 |
print_actionPerformed(); |
215 |
|
} |
216 |
|
}); |
217 |
2 |
outputAlignment = new JMenuItem(); |
218 |
2 |
outputAlignment |
219 |
|
.setText(MessageManager.getString("label.output_alignment")); |
220 |
2 |
outputAlignment.addActionListener(new ActionListener() |
221 |
|
{ |
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
222 |
0 |
@Override... |
223 |
|
public void actionPerformed(ActionEvent e) |
224 |
|
{ |
225 |
0 |
outputAlignment_actionPerformed(); |
226 |
|
} |
227 |
|
}); |
228 |
2 |
viewMenu.setText(MessageManager.getString("action.view")); |
229 |
2 |
viewMenu.addMenuListener(new MenuListener() |
230 |
|
{ |
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
231 |
0 |
@Override... |
232 |
|
public void menuSelected(MenuEvent e) |
233 |
|
{ |
234 |
0 |
viewMenu_menuSelected(); |
235 |
|
} |
236 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
237 |
0 |
@Override... |
238 |
|
public void menuDeselected(MenuEvent e) |
239 |
|
{ |
240 |
|
} |
241 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
242 |
0 |
@Override... |
243 |
|
public void menuCanceled(MenuEvent e) |
244 |
|
{ |
245 |
|
} |
246 |
|
}); |
247 |
2 |
showLabels.setText(MessageManager.getString("label.show_labels")); |
248 |
2 |
showLabels.addActionListener(new ActionListener() |
249 |
|
{ |
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
250 |
0 |
@Override... |
251 |
|
public void actionPerformed(ActionEvent e) |
252 |
|
{ |
253 |
0 |
showLabels_actionPerformed(); |
254 |
|
} |
255 |
|
}); |
256 |
2 |
JMenuItem bgcolour = new JMenuItem(); |
257 |
2 |
bgcolour.setText(MessageManager.getString("action.background_colour")); |
258 |
2 |
bgcolour.addActionListener(new ActionListener() |
259 |
|
{ |
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
260 |
0 |
@Override... |
261 |
|
public void actionPerformed(ActionEvent e) |
262 |
|
{ |
263 |
0 |
bgcolour_actionPerformed(); |
264 |
|
} |
265 |
|
}); |
266 |
2 |
originalSeqData = new JMenuItem(); |
267 |
2 |
originalSeqData.setText(MessageManager.getString("label.input_data")); |
268 |
2 |
originalSeqData.addActionListener(new ActionListener() |
269 |
|
{ |
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
270 |
0 |
@Override... |
271 |
|
public void actionPerformed(ActionEvent e) |
272 |
|
{ |
273 |
0 |
originalSeqData_actionPerformed(); |
274 |
|
} |
275 |
|
}); |
276 |
2 |
associateViewsMenu.setText( |
277 |
|
MessageManager.getString("label.associate_nodes_with")); |
278 |
|
|
279 |
2 |
doClustering = new JMenu(); |
280 |
2 |
doClustering.setText(MessageManager.getString("label.cluster")); |
281 |
|
|
282 |
2 |
statusPanel.setLayout(new GridLayout()); |
283 |
2 |
statusBar.setFont(VERDANA_12); |
284 |
|
|
285 |
|
|
286 |
|
|
287 |
2 |
JPanel panelBar = new JPanel(new BorderLayout()); |
288 |
2 |
panelBar.add(jPanel2, BorderLayout.NORTH); |
289 |
2 |
panelBar.add(statusPanel, BorderLayout.SOUTH); |
290 |
2 |
this.getContentPane().add(panelBar, BorderLayout.SOUTH); |
291 |
2 |
jPanel2.add(jLabel1, null); |
292 |
2 |
jPanel2.add(xCombobox, null); |
293 |
2 |
jPanel2.add(jLabel2, null); |
294 |
2 |
jPanel2.add(yCombobox, null); |
295 |
2 |
jPanel2.add(jLabel3, null); |
296 |
2 |
jPanel2.add(zCombobox, null); |
297 |
2 |
jPanel2.add(resetButton, null); |
298 |
|
|
299 |
2 |
JMenuBar jMenuBar1 = new JMenuBar(); |
300 |
2 |
jMenuBar1.add(fileMenu); |
301 |
2 |
jMenuBar1.add(viewMenu); |
302 |
2 |
jMenuBar1.add(doClustering); |
303 |
2 |
setJMenuBar(jMenuBar1); |
304 |
2 |
fileMenu.add(saveMenu); |
305 |
2 |
fileMenu.add(outputValues); |
306 |
2 |
fileMenu.add(print); |
307 |
2 |
fileMenu.add(originalSeqData); |
308 |
2 |
fileMenu.add(outputPoints); |
309 |
2 |
fileMenu.add(outputProjPoints); |
310 |
2 |
fileMenu.add(outputAlignment); |
311 |
2 |
saveMenu.add(eps); |
312 |
2 |
saveMenu.add(png); |
313 |
2 |
viewMenu.add(showLabels); |
314 |
2 |
viewMenu.add(bgcolour); |
315 |
2 |
viewMenu.add(associateViewsMenu); |
316 |
|
} |
317 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
318 |
0 |
protected void resetButton_actionPerformed()... |
319 |
|
{ |
320 |
|
} |
321 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
322 |
0 |
protected void outputPoints_actionPerformed()... |
323 |
|
{ |
324 |
|
} |
325 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
326 |
0 |
protected void outputProjPoints_actionPerformed()... |
327 |
|
{ |
328 |
|
} |
329 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
330 |
0 |
protected void outputAlignment_actionPerformed()... |
331 |
|
{ |
332 |
|
} |
333 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
334 |
0 |
public void makePCAImage(TYPE imageType)... |
335 |
|
{ |
336 |
|
} |
337 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
338 |
0 |
protected void outputValues_actionPerformed()... |
339 |
|
{ |
340 |
|
} |
341 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
342 |
0 |
protected void print_actionPerformed()... |
343 |
|
{ |
344 |
|
} |
345 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
346 |
0 |
protected void showLabels_actionPerformed()... |
347 |
|
{ |
348 |
|
} |
349 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
350 |
0 |
protected void bgcolour_actionPerformed()... |
351 |
|
{ |
352 |
|
} |
353 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
354 |
0 |
protected void originalSeqData_actionPerformed()... |
355 |
|
{ |
356 |
|
} |
357 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
358 |
0 |
protected void viewMenu_menuSelected()... |
359 |
|
{ |
360 |
|
} |
361 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
362 |
0 |
protected void doDimensionChange()... |
363 |
|
{ |
364 |
|
} |
365 |
|
} |