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