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