2 * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.2)
3 * Copyright (C) 2014 The Jalview Authors
5 * This file is part of Jalview.
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.
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.
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.
21 package jalview.jbgui;
23 import jalview.util.MessageManager;
26 import java.awt.event.*;
28 import javax.swing.event.*;
30 public class GTreePanel extends JInternalFrame
32 BorderLayout borderLayout1 = new BorderLayout();
34 public JScrollPane scrollPane = new JScrollPane();
36 JMenuBar jMenuBar1 = new JMenuBar();
38 JMenu fileMenu = new JMenu();
40 JMenuItem saveAsNewick = new JMenuItem();
42 JMenuItem printMenu = new JMenuItem();
44 protected JMenu viewMenu = new JMenu();
46 public JMenuItem font = new JMenuItem();
48 public JMenuItem sortAssocViews = new JMenuItem();
50 public JCheckBoxMenuItem bootstrapMenu = new JCheckBoxMenuItem();
52 public JCheckBoxMenuItem distanceMenu = new JCheckBoxMenuItem();
54 public JCheckBoxMenuItem fitToWindow = new JCheckBoxMenuItem();
56 public JCheckBoxMenuItem placeholdersMenu = new JCheckBoxMenuItem();
58 JMenuItem pngTree = new JMenuItem();
60 JMenuItem epsTree = new JMenuItem();
62 JMenu saveAsMenu = new JMenu();
64 JMenuItem textbox = new JMenuItem();
66 public JMenuItem originalSeqData = new JMenuItem();
68 protected JMenu associateLeavesMenu = new JMenu();
75 this.setJMenuBar(jMenuBar1);
82 private void jbInit() throws Exception
84 this.getContentPane().setLayout(borderLayout1);
85 this.setBackground(Color.white);
86 this.setFont(new java.awt.Font("Verdana", 0, 12));
87 scrollPane.setOpaque(false);
88 fileMenu.setText(MessageManager.getString("action.file"));
89 saveAsNewick.setText(MessageManager.getString("label.newick_format"));
90 saveAsNewick.addActionListener(new ActionListener()
92 public void actionPerformed(ActionEvent e)
94 saveAsNewick_actionPerformed(e);
97 printMenu.setText(MessageManager.getString("action.print"));
98 printMenu.addActionListener(new java.awt.event.ActionListener()
100 public void actionPerformed(ActionEvent e)
102 printMenu_actionPerformed(e);
105 viewMenu.setText(MessageManager.getString("action.view"));
106 viewMenu.addMenuListener(new MenuListener()
108 public void menuSelected(MenuEvent e)
110 viewMenu_menuSelected();
113 public void menuDeselected(MenuEvent e)
117 public void menuCanceled(MenuEvent e)
121 sortAssocViews.setText(MessageManager.getString("label.sort_alignment_by_tree"));
122 sortAssocViews.addActionListener(new java.awt.event.ActionListener()
124 public void actionPerformed(ActionEvent e)
126 sortByTree_actionPerformed(e);
129 font.setText(MessageManager.getString("action.font"));
130 font.addActionListener(new java.awt.event.ActionListener()
132 public void actionPerformed(ActionEvent e)
134 font_actionPerformed(e);
137 bootstrapMenu.setText(MessageManager.getString("label.show_bootstrap_values"));
138 bootstrapMenu.addActionListener(new java.awt.event.ActionListener()
140 public void actionPerformed(ActionEvent e)
142 bootstrapMenu_actionPerformed(e);
145 distanceMenu.setText(MessageManager.getString("label.show_distances"));
146 distanceMenu.addActionListener(new java.awt.event.ActionListener()
148 public void actionPerformed(ActionEvent e)
150 distanceMenu_actionPerformed(e);
153 fitToWindow.setSelected(true);
154 fitToWindow.setText(MessageManager.getString("label.fit_to_window"));
155 fitToWindow.addActionListener(new java.awt.event.ActionListener()
157 public void actionPerformed(ActionEvent e)
159 fitToWindow_actionPerformed(e);
162 epsTree.setText("EPS");
163 epsTree.addActionListener(new java.awt.event.ActionListener()
165 public void actionPerformed(ActionEvent e)
167 epsTree_actionPerformed(e);
170 pngTree.setText("PNG");
171 pngTree.addActionListener(new java.awt.event.ActionListener()
173 public void actionPerformed(ActionEvent e)
175 pngTree_actionPerformed(e);
178 saveAsMenu.setText(MessageManager.getString("action.save_as"));
180 .setToolTipText(MessageManager.getString("label.marks_leaves_tree_not_associated_with_sequence"));
181 placeholdersMenu.setText(MessageManager.getString("label.mark_unlinked_leaves"));
182 placeholdersMenu.addActionListener(new ActionListener()
184 public void actionPerformed(ActionEvent e)
186 placeholdersMenu_actionPerformed(e);
189 textbox.setText(MessageManager.getString("label.out_to_textbox") + "...");
190 textbox.addActionListener(new ActionListener()
192 public void actionPerformed(ActionEvent e)
194 textbox_actionPerformed(e);
197 originalSeqData.setText(MessageManager.getString("label.input_data"));
198 originalSeqData.addActionListener(new ActionListener()
200 public void actionPerformed(ActionEvent e)
202 originalSeqData_actionPerformed(e);
205 associateLeavesMenu.setText(MessageManager.getString("label.associate_leaves_with"));
206 this.getContentPane().add(scrollPane, BorderLayout.CENTER);
207 jMenuBar1.add(fileMenu);
208 jMenuBar1.add(viewMenu);
209 fileMenu.add(saveAsMenu);
210 fileMenu.add(textbox);
211 fileMenu.add(printMenu);
212 fileMenu.add(originalSeqData);
213 viewMenu.add(fitToWindow);
215 viewMenu.add(distanceMenu);
216 viewMenu.add(bootstrapMenu);
217 viewMenu.add(placeholdersMenu);
218 viewMenu.add(sortAssocViews);
219 viewMenu.add(associateLeavesMenu);
220 saveAsMenu.add(saveAsNewick);
221 saveAsMenu.add(epsTree);
222 saveAsMenu.add(pngTree);
225 public void printMenu_actionPerformed(ActionEvent e)
229 public void font_actionPerformed(ActionEvent e)
233 public void distanceMenu_actionPerformed(ActionEvent e)
237 public void bootstrapMenu_actionPerformed(ActionEvent e)
241 public void fitToWindow_actionPerformed(ActionEvent e)
245 public void pngTree_actionPerformed(ActionEvent e)
249 public void epsTree_actionPerformed(ActionEvent e)
253 public void saveAsNewick_actionPerformed(ActionEvent e)
257 public void placeholdersMenu_actionPerformed(ActionEvent e)
261 public void textbox_actionPerformed(ActionEvent e)
265 public void fullid_actionPerformed(ActionEvent e)
270 public void originalSeqData_actionPerformed(ActionEvent e)
275 public void viewMenu_menuSelected()
279 public void sortByTree_actionPerformed(ActionEvent e)