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 |
|
|
|
|
| 0% |
Uncovered Elements: 154 (154) |
Complexity: 36 |
Complexity Density: 0.31 |
|
46 |
|
public class GPaSiMapPanel 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 |
|
|
71 |
|
|
72 |
|
|
|
|
| 0% |
Uncovered Elements: 9 (9) |
Complexity: 3 |
Complexity Density: 0.43 |
|
73 |
0 |
public GPaSiMapPanel()... |
74 |
|
{ |
75 |
0 |
try |
76 |
|
{ |
77 |
0 |
jbInit(); |
78 |
|
} catch (Exception e) |
79 |
|
{ |
80 |
0 |
e.printStackTrace(); |
81 |
|
} |
82 |
|
|
83 |
0 |
for (int i = 1; i < 8; i++) |
84 |
|
{ |
85 |
0 |
xCombobox.addItem("dim " + i); |
86 |
0 |
yCombobox.addItem("dim " + i); |
87 |
0 |
zCombobox.addItem("dim " + i); |
88 |
|
} |
89 |
|
} |
90 |
|
|
|
|
| 0% |
Uncovered Elements: 9 (9) |
Complexity: 3 |
Complexity Density: 0.43 |
|
91 |
0 |
public GPaSiMapPanel(int dim)... |
92 |
|
{ |
93 |
0 |
try |
94 |
|
{ |
95 |
0 |
jbInit(); |
96 |
|
} catch (Exception e) |
97 |
|
{ |
98 |
0 |
e.printStackTrace(); |
99 |
|
} |
100 |
|
|
101 |
0 |
for (int i = 1; i <= dim; i++) |
102 |
|
{ |
103 |
0 |
xCombobox.addItem("dim " + i); |
104 |
0 |
yCombobox.addItem("dim " + i); |
105 |
0 |
zCombobox.addItem("dim " + i); |
106 |
|
} |
107 |
|
} |
108 |
|
|
|
|
| 0% |
Uncovered Elements: 89 (89) |
Complexity: 1 |
Complexity Density: 0.01 |
|
109 |
0 |
private void jbInit() throws Exception... |
110 |
|
{ |
111 |
0 |
setFrameIcon(null); |
112 |
0 |
setName("jalview-pca"); |
113 |
0 |
this.getContentPane().setLayout(new BorderLayout()); |
114 |
0 |
JPanel jPanel2 = new JPanel(); |
115 |
0 |
jPanel2.setLayout(new FlowLayout()); |
116 |
0 |
JLabel jLabel1 = new JLabel(); |
117 |
0 |
jLabel1.setFont(VERDANA_12); |
118 |
0 |
jLabel1.setText("x="); |
119 |
0 |
JLabel jLabel2 = new JLabel(); |
120 |
0 |
jLabel2.setFont(VERDANA_12); |
121 |
0 |
jLabel2.setText("y="); |
122 |
0 |
JLabel jLabel3 = new JLabel(); |
123 |
0 |
jLabel3.setFont(VERDANA_12); |
124 |
0 |
jLabel3.setText("z="); |
125 |
0 |
jPanel2.setBackground(Color.white); |
126 |
0 |
jPanel2.setBorder(null); |
127 |
0 |
zCombobox.setFont(VERDANA_12); |
128 |
0 |
zCombobox.addActionListener(new ActionListener() |
129 |
|
{ |
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
130 |
0 |
@Override... |
131 |
|
public void actionPerformed(ActionEvent e) |
132 |
|
{ |
133 |
0 |
doDimensionChange(); |
134 |
|
} |
135 |
|
}); |
136 |
0 |
yCombobox.setFont(VERDANA_12); |
137 |
0 |
yCombobox.addActionListener(new ActionListener() |
138 |
|
{ |
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
139 |
0 |
@Override... |
140 |
|
public void actionPerformed(ActionEvent e) |
141 |
|
{ |
142 |
0 |
doDimensionChange(); |
143 |
|
} |
144 |
|
}); |
145 |
0 |
xCombobox.setFont(VERDANA_12); |
146 |
0 |
xCombobox.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 |
doDimensionChange(); |
152 |
|
} |
153 |
|
}); |
154 |
0 |
JButton resetButton = new JButton(); |
155 |
0 |
resetButton.setFont(VERDANA_12); |
156 |
0 |
resetButton.setText(MessageManager.getString("action.reset")); |
157 |
0 |
resetButton.addActionListener(new ActionListener() |
158 |
|
{ |
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
159 |
0 |
@Override... |
160 |
|
public void actionPerformed(ActionEvent e) |
161 |
|
{ |
162 |
0 |
resetButton_actionPerformed(); |
163 |
|
} |
164 |
|
}); |
165 |
0 |
JMenu fileMenu = new JMenu(); |
166 |
0 |
fileMenu.setText(MessageManager.getString("action.file")); |
167 |
0 |
JMenu saveMenu = new JMenu(); |
168 |
0 |
saveMenu.setText(MessageManager.getString("action.save_as")); |
169 |
0 |
JMenuItem eps = new JMenuItem("EPS"); |
170 |
0 |
eps.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 |
makePCAImage(TYPE.EPS); |
176 |
|
} |
177 |
|
}); |
178 |
0 |
JMenuItem png = new JMenuItem("PNG"); |
179 |
0 |
png.addActionListener(new ActionListener() |
180 |
|
{ |
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
181 |
0 |
@Override... |
182 |
|
public void actionPerformed(ActionEvent e) |
183 |
|
{ |
184 |
0 |
makePCAImage(TYPE.PNG); |
185 |
|
} |
186 |
|
}); |
187 |
0 |
JMenuItem outputValues = new JMenuItem(); |
188 |
0 |
outputValues.setText(MessageManager.getString("label.output_values")); |
189 |
0 |
outputValues.addActionListener(new ActionListener() |
190 |
|
{ |
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
191 |
0 |
@Override... |
192 |
|
public void actionPerformed(ActionEvent e) |
193 |
|
{ |
194 |
0 |
outputValues_actionPerformed(); |
195 |
|
} |
196 |
|
}); |
197 |
0 |
JMenuItem outputPoints = new JMenuItem(); |
198 |
0 |
outputPoints.setText(MessageManager.getString("label.output_points")); |
199 |
0 |
outputPoints.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 |
outputPoints_actionPerformed(); |
205 |
|
} |
206 |
|
}); |
207 |
0 |
JMenuItem outputProjPoints = new JMenuItem(); |
208 |
0 |
outputProjPoints.setText( |
209 |
|
MessageManager.getString("label.output_transformed_points")); |
210 |
0 |
outputProjPoints.addActionListener(new ActionListener() |
211 |
|
{ |
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
212 |
0 |
@Override... |
213 |
|
public void actionPerformed(ActionEvent e) |
214 |
|
{ |
215 |
0 |
outputProjPoints_actionPerformed(); |
216 |
|
} |
217 |
|
}); |
218 |
0 |
JMenuItem print = new JMenuItem(); |
219 |
0 |
print.setText(MessageManager.getString("action.print")); |
220 |
0 |
print.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 |
print_actionPerformed(); |
226 |
|
} |
227 |
|
}); |
228 |
0 |
outputAlignment = new JMenuItem(); |
229 |
0 |
outputAlignment |
230 |
|
.setText(MessageManager.getString("label.output_alignment")); |
231 |
0 |
outputAlignment.addActionListener(new ActionListener() |
232 |
|
{ |
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
233 |
0 |
@Override... |
234 |
|
public void actionPerformed(ActionEvent e) |
235 |
|
{ |
236 |
0 |
outputAlignment_actionPerformed(); |
237 |
|
} |
238 |
|
}); |
239 |
0 |
viewMenu.setText(MessageManager.getString("action.view")); |
240 |
0 |
viewMenu.addMenuListener(new MenuListener() |
241 |
|
{ |
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
242 |
0 |
@Override... |
243 |
|
public void menuSelected(MenuEvent e) |
244 |
|
{ |
245 |
0 |
viewMenu_menuSelected(); |
246 |
|
} |
247 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
248 |
0 |
@Override... |
249 |
|
public void menuDeselected(MenuEvent e) |
250 |
|
{ |
251 |
|
} |
252 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
253 |
0 |
@Override... |
254 |
|
public void menuCanceled(MenuEvent e) |
255 |
|
{ |
256 |
|
} |
257 |
|
}); |
258 |
0 |
showLabels.setText(MessageManager.getString("label.show_labels")); |
259 |
0 |
showLabels.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 |
showLabels_actionPerformed(); |
265 |
|
} |
266 |
|
}); |
267 |
0 |
JMenuItem bgcolour = new JMenuItem(); |
268 |
0 |
bgcolour.setText(MessageManager.getString("action.background_colour")); |
269 |
0 |
bgcolour.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 |
bgcolour_actionPerformed(); |
275 |
|
} |
276 |
|
}); |
277 |
0 |
originalSeqData = new JMenuItem(); |
278 |
0 |
originalSeqData.setText(MessageManager.getString("label.input_data")); |
279 |
0 |
originalSeqData.addActionListener(new ActionListener() |
280 |
|
{ |
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
281 |
0 |
@Override... |
282 |
|
public void actionPerformed(ActionEvent e) |
283 |
|
{ |
284 |
0 |
originalSeqData_actionPerformed(); |
285 |
|
} |
286 |
|
}); |
287 |
0 |
associateViewsMenu.setText( |
288 |
|
MessageManager.getString("label.associate_nodes_with")); |
289 |
|
|
290 |
0 |
statusPanel.setLayout(new GridLayout()); |
291 |
0 |
statusBar.setFont(VERDANA_12); |
292 |
|
|
293 |
|
|
294 |
|
|
295 |
0 |
JPanel panelBar = new JPanel(new BorderLayout()); |
296 |
0 |
panelBar.add(jPanel2, BorderLayout.NORTH); |
297 |
0 |
panelBar.add(statusPanel, BorderLayout.SOUTH); |
298 |
0 |
this.getContentPane().add(panelBar, BorderLayout.SOUTH); |
299 |
0 |
jPanel2.add(jLabel1, null); |
300 |
0 |
jPanel2.add(xCombobox, null); |
301 |
0 |
jPanel2.add(jLabel2, null); |
302 |
0 |
jPanel2.add(yCombobox, null); |
303 |
0 |
jPanel2.add(jLabel3, null); |
304 |
0 |
jPanel2.add(zCombobox, null); |
305 |
0 |
jPanel2.add(resetButton, null); |
306 |
|
|
307 |
0 |
JMenuBar jMenuBar1 = new JMenuBar(); |
308 |
0 |
jMenuBar1.add(fileMenu); |
309 |
0 |
jMenuBar1.add(viewMenu); |
310 |
0 |
setJMenuBar(jMenuBar1); |
311 |
0 |
fileMenu.add(saveMenu); |
312 |
0 |
fileMenu.add(outputValues); |
313 |
0 |
fileMenu.add(print); |
314 |
0 |
fileMenu.add(originalSeqData); |
315 |
0 |
fileMenu.add(outputPoints); |
316 |
0 |
fileMenu.add(outputProjPoints); |
317 |
0 |
fileMenu.add(outputAlignment); |
318 |
0 |
saveMenu.add(eps); |
319 |
0 |
saveMenu.add(png); |
320 |
0 |
viewMenu.add(showLabels); |
321 |
0 |
viewMenu.add(bgcolour); |
322 |
0 |
viewMenu.add(associateViewsMenu); |
323 |
|
} |
324 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
325 |
0 |
protected void resetButton_actionPerformed()... |
326 |
|
{ |
327 |
|
} |
328 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
329 |
0 |
protected void outputPoints_actionPerformed()... |
330 |
|
{ |
331 |
|
} |
332 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
333 |
0 |
protected void outputProjPoints_actionPerformed()... |
334 |
|
{ |
335 |
|
} |
336 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
337 |
0 |
protected void outputAlignment_actionPerformed()... |
338 |
|
{ |
339 |
|
} |
340 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
341 |
0 |
public void makePCAImage(TYPE imageType)... |
342 |
|
{ |
343 |
|
} |
344 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
345 |
0 |
protected void outputValues_actionPerformed()... |
346 |
|
{ |
347 |
|
} |
348 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
349 |
0 |
protected void print_actionPerformed()... |
350 |
|
{ |
351 |
|
} |
352 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
353 |
0 |
protected void showLabels_actionPerformed()... |
354 |
|
{ |
355 |
|
} |
356 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
357 |
0 |
protected void bgcolour_actionPerformed()... |
358 |
|
{ |
359 |
|
} |
360 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
361 |
0 |
protected void originalSeqData_actionPerformed()... |
362 |
|
{ |
363 |
|
} |
364 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
365 |
0 |
protected void viewMenu_menuSelected()... |
366 |
|
{ |
367 |
|
} |
368 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
369 |
0 |
protected void doDimensionChange()... |
370 |
|
{ |
371 |
|
} |
372 |
|
} |