Clover icon

Coverage Report

  1. Project Clover database Thu Nov 7 2024 10:11:34 GMT
  2. Package jalview.jbgui

File GTreePanel.java

 

Coverage histogram

../../img/srcFileCovDistChart6.png
36% of files have more coverage

Code metrics

0
89
37
1
388
306
38
0.43
2.41
37
1.03

Classes

Class Line # Actions
GTreePanel 45 89 38
0.587301658.7%
 

Contributing tests

This file is covered by 8 tests. .

Source view

1    /*
2    * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
3    * Copyright (C) $$Year-Rel$$ The Jalview Authors
4    *
5    * This file is part of Jalview.
6    *
7    * Jalview is free software: you can redistribute it and/or
8    * modify it under the terms of the GNU General Public License
9    * as published by the Free Software Foundation, either version 3
10    * of the License, or (at your option) any later version.
11    *
12    * Jalview is distributed in the hope that it will be useful, but
13    * WITHOUT ANY WARRANTY; without even the implied warranty
14    * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15    * PURPOSE. See the GNU General Public License for more details.
16    *
17    * You should have received a copy of the GNU General Public License
18    * along with Jalview. If not, see <http://www.gnu.org/licenses/>.
19    * The Jalview Authors are detailed in the 'AUTHORS' file.
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")
 
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    //Menu option for the user to select their preference in
70    //displaying secondary structure providers as labels.
71    //Visible only for secondary structure similarity.
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   
 
99  14 toggle public GTreePanel()
100    {
101  14 try
102    {
103  14 jbInit();
104  14 this.setJMenuBar(jMenuBar1);
105    } catch (Exception e)
106    {
107  0 e.printStackTrace();
108    }
109    }
110   
 
111  14 toggle private void jbInit() throws Exception
112    {
113  14 setFrameIcon(null);
114  14 setName("jalview-tree");
115  14 this.getContentPane().setLayout(borderLayout1);
116  14 this.setBackground(Color.white);
117  14 this.setFont(new java.awt.Font("Verdana", 0, 12));
118  14 scrollPane.setOpaque(false);
119  14 fileMenu.setText(MessageManager.getString("action.file"));
120  14 saveAsNewick.setText(MessageManager.getString("label.newick_format"));
121  14 saveAsNewick.addActionListener(new ActionListener()
122    {
 
123  0 toggle @Override
124    public void actionPerformed(ActionEvent e)
125    {
126  0 saveAsNewick_actionPerformed(e);
127    }
128    });
129  14 printMenu.setText(MessageManager.getString("action.print"));
130  14 printMenu.addActionListener(new java.awt.event.ActionListener()
131    {
 
132  0 toggle @Override
133    public void actionPerformed(ActionEvent e)
134    {
135  0 printMenu_actionPerformed(e);
136    }
137    });
138  14 viewMenu.setText(MessageManager.getString("action.view"));
139  14 viewMenu.addMenuListener(new MenuListener()
140    {
 
141  0 toggle @Override
142    public void menuSelected(MenuEvent e)
143    {
144  0 viewMenu_menuSelected();
145    }
146   
 
147  0 toggle @Override
148    public void menuDeselected(MenuEvent e)
149    {
150    }
151   
 
152  0 toggle @Override
153    public void menuCanceled(MenuEvent e)
154    {
155    }
156    });
157  14 sortAssocViews.setText(
158    MessageManager.getString("label.sort_alignment_by_tree"));
159  14 sortAssocViews.addActionListener(new java.awt.event.ActionListener()
160    {
 
161  0 toggle @Override
162    public void actionPerformed(ActionEvent e)
163    {
164  0 sortByTree_actionPerformed();
165    }
166    });
167  14 font.setText(MessageManager.getString("action.font"));
168  14 font.addActionListener(new java.awt.event.ActionListener()
169    {
 
170  0 toggle @Override
171    public void actionPerformed(ActionEvent e)
172    {
173  0 font_actionPerformed(e);
174    }
175    });
176  14 bootstrapMenu.setText(
177    MessageManager.getString("label.show_bootstrap_values"));
178  14 bootstrapMenu.addActionListener(new java.awt.event.ActionListener()
179    {
 
180  0 toggle @Override
181    public void actionPerformed(ActionEvent e)
182    {
183  0 bootstrapMenu_actionPerformed(e);
184    }
185    });
186  14 distanceMenu.setText(MessageManager.getString("label.show_distances"));
187  14 distanceMenu.addActionListener(new java.awt.event.ActionListener()
188    {
 
189  0 toggle @Override
190    public void actionPerformed(ActionEvent e)
191    {
192  0 distanceMenu_actionPerformed(e);
193    }
194    });
195   
196  14 showSecondaryStructureProviderButtonGroup.add(hideStructureProviders);
197  14 showSecondaryStructureProviderButtonGroup.add(showStructureProviderLabels);
198  14 showSecondaryStructureProviderButtonGroup.add(showStructureProviderColouredLines);
199  14 showSecondaryStructureProviderMenu.setText(MessageManager.getString("label.show_secondary_structure_provider"));
200  14 hideStructureProviders.setText(MessageManager.getString("label.hide_structure_provider"));
201  14 hideStructureProviders.setSelected(true);
202  14 hideStructureProviders.addActionListener(new ActionListener()
203    {
 
204  0 toggle @Override
205    public void actionPerformed(ActionEvent e)
206    {
207  0 hideStructureProviders_actionPerformed(e);
208    }
209    });
210   
211  14 showStructureProviderLabels.setText(MessageManager.getString("label.show_structure_provider_as_labels"));
212  14 showStructureProviderLabels.addActionListener(new ActionListener()
213    {
 
214  0 toggle @Override
215    public void actionPerformed(ActionEvent e)
216    {
217  0 showStructureProviderLabels_actionPerformed(e);
218    }
219    });
220   
221  14 showStructureProviderColouredLines.setText(MessageManager.getString("label.show_structure_provider_as_coloured_lines"));
222  14 showStructureProviderColouredLines.addActionListener(new java.awt.event.ActionListener()
223    {
 
224  0 toggle @Override
225    public void actionPerformed(ActionEvent e)
226    {
227  0 showStructureProviderColouredLines_actionPerformed(e);
228    }
229   
230    });
231   
232  14 fitToWindow.setSelected(true);
233  14 fitToWindow.setText(MessageManager.getString("label.fit_to_window"));
234  14 fitToWindow.addActionListener(new java.awt.event.ActionListener()
235    {
 
236  0 toggle @Override
237    public void actionPerformed(ActionEvent e)
238    {
239  0 fitToWindow_actionPerformed(e);
240    }
241    });
242  14 epsTree.setText("EPS");
243  14 epsTree.addActionListener(new java.awt.event.ActionListener()
244    {
 
245  0 toggle @Override
246    public void actionPerformed(ActionEvent e)
247    {
248  0 writeTreeImage(TYPE.EPS);
249    }
250    });
251  14 pngTree.setText("PNG");
252  14 pngTree.addActionListener(new java.awt.event.ActionListener()
253    {
 
254  0 toggle @Override
255    public void actionPerformed(ActionEvent e)
256    {
257  0 writeTreeImage(TYPE.PNG);
258    }
259    });
260  14 saveAsMenu.setText(MessageManager.getString("action.save_as"));
261  14 placeholdersMenu.setToolTipText(MessageManager.getString(
262    "label.marks_leaves_tree_not_associated_with_sequence"));
263  14 placeholdersMenu.setText(
264    MessageManager.getString("label.mark_unlinked_leaves"));
265  14 placeholdersMenu.addActionListener(new ActionListener()
266    {
 
267  0 toggle @Override
268    public void actionPerformed(ActionEvent e)
269    {
270  0 placeholdersMenu_actionPerformed(e);
271    }
272    });
273  14 textbox.setText(MessageManager.getString("label.out_to_textbox"));
274  14 textbox.addActionListener(new ActionListener()
275    {
 
276  0 toggle @Override
277    public void actionPerformed(ActionEvent e)
278    {
279  0 textbox_actionPerformed(e);
280    }
281    });
282  14 originalSeqData.setText(MessageManager.getString("label.input_data"));
283  14 originalSeqData.addActionListener(new ActionListener()
284    {
 
285  0 toggle @Override
286    public void actionPerformed(ActionEvent e)
287    {
288  0 originalSeqData_actionPerformed(e);
289    }
290    });
291  14 associateLeavesMenu.setText(
292    MessageManager.getString("label.associate_leaves_with"));
293  14 this.getContentPane().add(scrollPane, BorderLayout.CENTER);
294  14 jMenuBar1.add(fileMenu);
295  14 jMenuBar1.add(viewMenu);
296  14 fileMenu.add(saveAsMenu);
297  14 fileMenu.add(textbox);
298  14 fileMenu.add(printMenu);
299  14 fileMenu.add(originalSeqData);
300  14 viewMenu.add(fitToWindow);
301  14 viewMenu.add(font);
302  14 viewMenu.add(distanceMenu);
303  14 viewMenu.add(showSecondaryStructureProviderMenu);
304  14 viewMenu.add(bootstrapMenu);
305  14 viewMenu.add(placeholdersMenu);
306  14 viewMenu.add(sortAssocViews);
307  14 viewMenu.add(associateLeavesMenu);
308  14 saveAsMenu.add(saveAsNewick);
309  14 saveAsMenu.add(epsTree);
310  14 saveAsMenu.add(pngTree);
311  14 showSecondaryStructureProviderMenu.add(hideStructureProviders);
312  14 showSecondaryStructureProviderMenu.add(showStructureProviderLabels);
313  14 showSecondaryStructureProviderMenu.add(showStructureProviderColouredLines);
314   
315    }
316   
 
317  0 toggle public void printMenu_actionPerformed(ActionEvent e)
318    {
319    }
320   
 
321  0 toggle public void font_actionPerformed(ActionEvent e)
322    {
323    }
324   
 
325  0 toggle public void distanceMenu_actionPerformed(ActionEvent e)
326    {
327    }
328   
 
329  0 toggle public void showSecondaryStructureProviderMenu_actionPerformed(ActionEvent e)
330    {
331    }
332   
 
333  0 toggle public void hideStructureProviders_actionPerformed(ActionEvent e)
334    {
335    }
336   
 
337  0 toggle public void showStructureProviderColouredLines_actionPerformed(ActionEvent e)
338    {
339    }
340   
 
341  0 toggle public void showStructureProviderLabels_actionPerformed(ActionEvent e)
342    {
343    }
344   
 
345  0 toggle public void bootstrapMenu_actionPerformed(ActionEvent e)
346    {
347    }
348   
 
349  0 toggle public void fitToWindow_actionPerformed(ActionEvent e)
350    {
351    }
352   
 
353  0 toggle public void writeTreeImage(TYPE imageType)
354    {
355    }
356   
 
357  0 toggle public void saveAsNewick_actionPerformed(ActionEvent e)
358    {
359    }
360   
 
361  0 toggle public void placeholdersMenu_actionPerformed(ActionEvent e)
362    {
363    }
364   
 
365  0 toggle public void textbox_actionPerformed(ActionEvent e)
366    {
367    }
368   
 
369  0 toggle public void fullid_actionPerformed(ActionEvent e)
370    {
371   
372    }
373   
 
374  0 toggle public void originalSeqData_actionPerformed(ActionEvent e)
375    {
376   
377    }
378   
 
379  0 toggle public void viewMenu_menuSelected()
380    {
381    }
382   
 
383  0 toggle public void sortByTree_actionPerformed()
384    {
385   
386    }
387   
388    }