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.event.ActionEvent; |
26 |
|
import java.awt.event.ActionListener; |
27 |
|
import java.awt.event.MouseAdapter; |
28 |
|
import java.awt.event.MouseEvent; |
29 |
|
|
30 |
|
import javax.swing.ButtonGroup; |
31 |
|
import javax.swing.JCheckBoxMenuItem; |
32 |
|
import javax.swing.JInternalFrame; |
33 |
|
import javax.swing.JMenu; |
34 |
|
import javax.swing.JMenuBar; |
35 |
|
import javax.swing.JMenuItem; |
36 |
|
import javax.swing.JRadioButtonMenuItem; |
37 |
|
import javax.swing.JScrollPane; |
38 |
|
import javax.swing.event.MenuEvent; |
39 |
|
import javax.swing.event.MenuListener; |
40 |
|
|
41 |
|
import jalview.util.ImageMaker.TYPE; |
42 |
|
import jalview.util.MessageManager; |
43 |
|
|
44 |
|
@SuppressWarnings("serial") |
|
|
| 0% |
Uncovered Elements: 126 (126) |
Complexity: 38 |
Complexity Density: 0.43 |
|
45 |
|
public class GTreePanel extends JInternalFrame |
46 |
|
{ |
47 |
|
BorderLayout borderLayout1 = new BorderLayout(); |
48 |
|
|
49 |
|
public JScrollPane scrollPane = new JScrollPane(); |
50 |
|
|
51 |
|
JMenuBar jMenuBar1 = new JMenuBar(); |
52 |
|
|
53 |
|
JMenu fileMenu = new JMenu(); |
54 |
|
|
55 |
|
JMenuItem saveAsNewick = new JMenuItem(); |
56 |
|
|
57 |
|
JMenuItem printMenu = new JMenuItem(); |
58 |
|
|
59 |
|
protected JMenu viewMenu = new JMenu(); |
60 |
|
|
61 |
|
public JMenuItem font = new JMenuItem(); |
62 |
|
|
63 |
|
public JMenuItem sortAssocViews = new JMenuItem(); |
64 |
|
|
65 |
|
public JCheckBoxMenuItem bootstrapMenu = new JCheckBoxMenuItem(); |
66 |
|
|
67 |
|
public JCheckBoxMenuItem distanceMenu = new JCheckBoxMenuItem(); |
68 |
|
|
69 |
|
|
70 |
|
|
71 |
|
|
72 |
|
|
73 |
|
public JMenu showSecondaryStructureProviderMenu = new JMenu(); |
74 |
|
|
75 |
|
ButtonGroup showSecondaryStructureProviderButtonGroup = new ButtonGroup(); |
76 |
|
|
77 |
|
public JRadioButtonMenuItem hideStructureProviders = new JRadioButtonMenuItem(); |
78 |
|
|
79 |
|
public JRadioButtonMenuItem showStructureProviderLabels = new JRadioButtonMenuItem(); |
80 |
|
|
81 |
|
public JRadioButtonMenuItem showStructureProviderColouredLines = new JRadioButtonMenuItem(); |
82 |
|
|
83 |
|
public JCheckBoxMenuItem fitToWindow = new JCheckBoxMenuItem(); |
84 |
|
|
85 |
|
public JCheckBoxMenuItem placeholdersMenu = new JCheckBoxMenuItem(); |
86 |
|
|
87 |
|
JMenuItem pngTree = new JMenuItem(); |
88 |
|
|
89 |
|
JMenuItem epsTree = new JMenuItem(); |
90 |
|
|
91 |
|
JMenu saveAsMenu = new JMenu(); |
92 |
|
|
93 |
|
JMenuItem textbox = new JMenuItem(); |
94 |
|
|
95 |
|
public JMenuItem originalSeqData = new JMenuItem(); |
96 |
|
|
97 |
|
protected JMenu associateLeavesMenu = new JMenu(); |
98 |
|
|
|
|
| 0% |
Uncovered Elements: 4 (4) |
Complexity: 2 |
Complexity Density: 0.5 |
|
99 |
0 |
public GTreePanel()... |
100 |
|
{ |
101 |
0 |
try |
102 |
|
{ |
103 |
0 |
jbInit(); |
104 |
0 |
this.setJMenuBar(jMenuBar1); |
105 |
|
} catch (Exception e) |
106 |
|
{ |
107 |
0 |
e.printStackTrace(); |
108 |
|
} |
109 |
|
} |
110 |
|
|
|
|
| 0% |
Uncovered Elements: 69 (69) |
Complexity: 1 |
Complexity Density: 0.01 |
|
111 |
0 |
private void jbInit() throws Exception... |
112 |
|
{ |
113 |
0 |
setFrameIcon(null); |
114 |
0 |
setName("jalview-tree"); |
115 |
0 |
this.getContentPane().setLayout(borderLayout1); |
116 |
0 |
this.setBackground(Color.white); |
117 |
0 |
this.setFont(new java.awt.Font("Verdana", 0, 12)); |
118 |
0 |
scrollPane.setOpaque(false); |
119 |
0 |
fileMenu.setText(MessageManager.getString("action.file")); |
120 |
0 |
saveAsNewick.setText(MessageManager.getString("label.newick_format")); |
121 |
0 |
saveAsNewick.addActionListener(new ActionListener() |
122 |
|
{ |
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
123 |
0 |
@Override... |
124 |
|
public void actionPerformed(ActionEvent e) |
125 |
|
{ |
126 |
0 |
saveAsNewick_actionPerformed(e); |
127 |
|
} |
128 |
|
}); |
129 |
0 |
printMenu.setText(MessageManager.getString("action.print")); |
130 |
0 |
printMenu.addActionListener(new java.awt.event.ActionListener() |
131 |
|
{ |
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
132 |
0 |
@Override... |
133 |
|
public void actionPerformed(ActionEvent e) |
134 |
|
{ |
135 |
0 |
printMenu_actionPerformed(e); |
136 |
|
} |
137 |
|
}); |
138 |
0 |
viewMenu.setText(MessageManager.getString("action.view")); |
139 |
0 |
viewMenu.addMenuListener(new MenuListener() |
140 |
|
{ |
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
141 |
0 |
@Override... |
142 |
|
public void menuSelected(MenuEvent e) |
143 |
|
{ |
144 |
0 |
viewMenu_menuSelected(); |
145 |
|
} |
146 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
147 |
0 |
@Override... |
148 |
|
public void menuDeselected(MenuEvent e) |
149 |
|
{ |
150 |
|
} |
151 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
152 |
0 |
@Override... |
153 |
|
public void menuCanceled(MenuEvent e) |
154 |
|
{ |
155 |
|
} |
156 |
|
}); |
157 |
0 |
sortAssocViews.setText( |
158 |
|
MessageManager.getString("label.sort_alignment_by_tree")); |
159 |
0 |
sortAssocViews.addActionListener(new java.awt.event.ActionListener() |
160 |
|
{ |
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
161 |
0 |
@Override... |
162 |
|
public void actionPerformed(ActionEvent e) |
163 |
|
{ |
164 |
0 |
sortByTree_actionPerformed(); |
165 |
|
} |
166 |
|
}); |
167 |
0 |
font.setText(MessageManager.getString("action.font")); |
168 |
0 |
font.addActionListener(new java.awt.event.ActionListener() |
169 |
|
{ |
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
170 |
0 |
@Override... |
171 |
|
public void actionPerformed(ActionEvent e) |
172 |
|
{ |
173 |
0 |
font_actionPerformed(e); |
174 |
|
} |
175 |
|
}); |
176 |
0 |
bootstrapMenu.setText( |
177 |
|
MessageManager.getString("label.show_bootstrap_values")); |
178 |
0 |
bootstrapMenu.addActionListener(new java.awt.event.ActionListener() |
179 |
|
{ |
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
180 |
0 |
@Override... |
181 |
|
public void actionPerformed(ActionEvent e) |
182 |
|
{ |
183 |
0 |
bootstrapMenu_actionPerformed(e); |
184 |
|
} |
185 |
|
}); |
186 |
0 |
distanceMenu.setText(MessageManager.getString("label.show_distances")); |
187 |
0 |
distanceMenu.addActionListener(new java.awt.event.ActionListener() |
188 |
|
{ |
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
189 |
0 |
@Override... |
190 |
|
public void actionPerformed(ActionEvent e) |
191 |
|
{ |
192 |
0 |
distanceMenu_actionPerformed(e); |
193 |
|
} |
194 |
|
}); |
195 |
|
|
196 |
0 |
showSecondaryStructureProviderButtonGroup.add(hideStructureProviders); |
197 |
0 |
showSecondaryStructureProviderButtonGroup.add(showStructureProviderLabels); |
198 |
0 |
showSecondaryStructureProviderButtonGroup.add(showStructureProviderColouredLines); |
199 |
0 |
showSecondaryStructureProviderMenu.setText(MessageManager.getString("label.show_secondary_structure_provider")); |
200 |
0 |
hideStructureProviders.setText(MessageManager.getString("label.hide_structure_provider")); |
201 |
0 |
hideStructureProviders.setSelected(true); |
202 |
0 |
hideStructureProviders.addActionListener(new ActionListener() |
203 |
|
{ |
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
204 |
0 |
@Override... |
205 |
|
public void actionPerformed(ActionEvent e) |
206 |
|
{ |
207 |
0 |
hideStructureProviders_actionPerformed(e); |
208 |
|
} |
209 |
|
}); |
210 |
|
|
211 |
0 |
showStructureProviderLabels.setText(MessageManager.getString("label.show_structure_provider_as_labels")); |
212 |
0 |
showStructureProviderLabels.addActionListener(new ActionListener() |
213 |
|
{ |
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
214 |
0 |
@Override... |
215 |
|
public void actionPerformed(ActionEvent e) |
216 |
|
{ |
217 |
0 |
showStructureProviderLabels_actionPerformed(e); |
218 |
|
} |
219 |
|
}); |
220 |
|
|
221 |
0 |
showStructureProviderColouredLines.setText(MessageManager.getString("label.show_structure_provider_as_coloured_lines")); |
222 |
0 |
showStructureProviderColouredLines.addActionListener(new java.awt.event.ActionListener() |
223 |
|
{ |
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
224 |
0 |
@Override... |
225 |
|
public void actionPerformed(ActionEvent e) |
226 |
|
{ |
227 |
0 |
showStructureProviderColouredLines_actionPerformed(e); |
228 |
|
} |
229 |
|
|
230 |
|
}); |
231 |
|
|
232 |
0 |
fitToWindow.setSelected(true); |
233 |
0 |
fitToWindow.setText(MessageManager.getString("label.fit_to_window")); |
234 |
0 |
fitToWindow.addActionListener(new java.awt.event.ActionListener() |
235 |
|
{ |
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
236 |
0 |
@Override... |
237 |
|
public void actionPerformed(ActionEvent e) |
238 |
|
{ |
239 |
0 |
fitToWindow_actionPerformed(e); |
240 |
|
} |
241 |
|
}); |
242 |
0 |
epsTree.setText("EPS"); |
243 |
0 |
epsTree.addActionListener(new java.awt.event.ActionListener() |
244 |
|
{ |
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
245 |
0 |
@Override... |
246 |
|
public void actionPerformed(ActionEvent e) |
247 |
|
{ |
248 |
0 |
writeTreeImage(TYPE.EPS); |
249 |
|
} |
250 |
|
}); |
251 |
0 |
pngTree.setText("PNG"); |
252 |
0 |
pngTree.addActionListener(new java.awt.event.ActionListener() |
253 |
|
{ |
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
254 |
0 |
@Override... |
255 |
|
public void actionPerformed(ActionEvent e) |
256 |
|
{ |
257 |
0 |
writeTreeImage(TYPE.PNG); |
258 |
|
} |
259 |
|
}); |
260 |
0 |
saveAsMenu.setText(MessageManager.getString("action.save_as")); |
261 |
0 |
placeholdersMenu.setToolTipText(MessageManager.getString( |
262 |
|
"label.marks_leaves_tree_not_associated_with_sequence")); |
263 |
0 |
placeholdersMenu.setText( |
264 |
|
MessageManager.getString("label.mark_unlinked_leaves")); |
265 |
0 |
placeholdersMenu.addActionListener(new ActionListener() |
266 |
|
{ |
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
267 |
0 |
@Override... |
268 |
|
public void actionPerformed(ActionEvent e) |
269 |
|
{ |
270 |
0 |
placeholdersMenu_actionPerformed(e); |
271 |
|
} |
272 |
|
}); |
273 |
0 |
textbox.setText(MessageManager.getString("label.out_to_textbox")); |
274 |
0 |
textbox.addActionListener(new ActionListener() |
275 |
|
{ |
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
276 |
0 |
@Override... |
277 |
|
public void actionPerformed(ActionEvent e) |
278 |
|
{ |
279 |
0 |
textbox_actionPerformed(e); |
280 |
|
} |
281 |
|
}); |
282 |
0 |
originalSeqData.setText(MessageManager.getString("label.input_data")); |
283 |
0 |
originalSeqData.addActionListener(new ActionListener() |
284 |
|
{ |
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
285 |
0 |
@Override... |
286 |
|
public void actionPerformed(ActionEvent e) |
287 |
|
{ |
288 |
0 |
originalSeqData_actionPerformed(e); |
289 |
|
} |
290 |
|
}); |
291 |
0 |
associateLeavesMenu.setText( |
292 |
|
MessageManager.getString("label.associate_leaves_with")); |
293 |
0 |
this.getContentPane().add(scrollPane, BorderLayout.CENTER); |
294 |
0 |
jMenuBar1.add(fileMenu); |
295 |
0 |
jMenuBar1.add(viewMenu); |
296 |
0 |
fileMenu.add(saveAsMenu); |
297 |
0 |
fileMenu.add(textbox); |
298 |
0 |
fileMenu.add(printMenu); |
299 |
0 |
fileMenu.add(originalSeqData); |
300 |
0 |
viewMenu.add(fitToWindow); |
301 |
0 |
viewMenu.add(font); |
302 |
0 |
viewMenu.add(distanceMenu); |
303 |
0 |
viewMenu.add(showSecondaryStructureProviderMenu); |
304 |
0 |
viewMenu.add(bootstrapMenu); |
305 |
0 |
viewMenu.add(placeholdersMenu); |
306 |
0 |
viewMenu.add(sortAssocViews); |
307 |
0 |
viewMenu.add(associateLeavesMenu); |
308 |
0 |
saveAsMenu.add(saveAsNewick); |
309 |
0 |
saveAsMenu.add(epsTree); |
310 |
0 |
saveAsMenu.add(pngTree); |
311 |
0 |
showSecondaryStructureProviderMenu.add(hideStructureProviders); |
312 |
0 |
showSecondaryStructureProviderMenu.add(showStructureProviderLabels); |
313 |
0 |
showSecondaryStructureProviderMenu.add(showStructureProviderColouredLines); |
314 |
|
|
315 |
|
} |
316 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
317 |
0 |
public void printMenu_actionPerformed(ActionEvent e)... |
318 |
|
{ |
319 |
|
} |
320 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
321 |
0 |
public void font_actionPerformed(ActionEvent e)... |
322 |
|
{ |
323 |
|
} |
324 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
325 |
0 |
public void distanceMenu_actionPerformed(ActionEvent e)... |
326 |
|
{ |
327 |
|
} |
328 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
329 |
0 |
public void showSecondaryStructureProviderMenu_actionPerformed(ActionEvent e)... |
330 |
|
{ |
331 |
|
} |
332 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
333 |
0 |
public void hideStructureProviders_actionPerformed(ActionEvent e)... |
334 |
|
{ |
335 |
|
} |
336 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
337 |
0 |
public void showStructureProviderColouredLines_actionPerformed(ActionEvent e)... |
338 |
|
{ |
339 |
|
} |
340 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
341 |
0 |
public void showStructureProviderLabels_actionPerformed(ActionEvent e)... |
342 |
|
{ |
343 |
|
} |
344 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
345 |
0 |
public void bootstrapMenu_actionPerformed(ActionEvent e)... |
346 |
|
{ |
347 |
|
} |
348 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
349 |
0 |
public void fitToWindow_actionPerformed(ActionEvent e)... |
350 |
|
{ |
351 |
|
} |
352 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
353 |
0 |
public void writeTreeImage(TYPE imageType)... |
354 |
|
{ |
355 |
|
} |
356 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
357 |
0 |
public void saveAsNewick_actionPerformed(ActionEvent e)... |
358 |
|
{ |
359 |
|
} |
360 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
361 |
0 |
public void placeholdersMenu_actionPerformed(ActionEvent e)... |
362 |
|
{ |
363 |
|
} |
364 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
365 |
0 |
public void textbox_actionPerformed(ActionEvent e)... |
366 |
|
{ |
367 |
|
} |
368 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
369 |
0 |
public void fullid_actionPerformed(ActionEvent e)... |
370 |
|
{ |
371 |
|
|
372 |
|
} |
373 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
374 |
0 |
public void originalSeqData_actionPerformed(ActionEvent e)... |
375 |
|
{ |
376 |
|
|
377 |
|
} |
378 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
379 |
0 |
public void viewMenu_menuSelected()... |
380 |
|
{ |
381 |
|
} |
382 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
383 |
0 |
public void sortByTree_actionPerformed()... |
384 |
|
{ |
385 |
|
|
386 |
|
} |
387 |
|
|
388 |
|
} |