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
122 .getString("label.sort_alignment_by_tree"));
123 sortAssocViews.addActionListener(new java.awt.event.ActionListener()
125 public void actionPerformed(ActionEvent e)
127 sortByTree_actionPerformed(e);
130 font.setText(MessageManager.getString("action.font"));
131 font.addActionListener(new java.awt.event.ActionListener()
133 public void actionPerformed(ActionEvent e)
135 font_actionPerformed(e);
138 bootstrapMenu.setText(MessageManager
139 .getString("label.show_bootstrap_values"));
140 bootstrapMenu.addActionListener(new java.awt.event.ActionListener()
142 public void actionPerformed(ActionEvent e)
144 bootstrapMenu_actionPerformed(e);
147 distanceMenu.setText(MessageManager.getString("label.show_distances"));
148 distanceMenu.addActionListener(new java.awt.event.ActionListener()
150 public void actionPerformed(ActionEvent e)
152 distanceMenu_actionPerformed(e);
155 fitToWindow.setSelected(true);
156 fitToWindow.setText(MessageManager.getString("label.fit_to_window"));
157 fitToWindow.addActionListener(new java.awt.event.ActionListener()
159 public void actionPerformed(ActionEvent e)
161 fitToWindow_actionPerformed(e);
164 epsTree.setText("EPS");
165 epsTree.addActionListener(new java.awt.event.ActionListener()
167 public void actionPerformed(ActionEvent e)
169 epsTree_actionPerformed(e);
172 pngTree.setText("PNG");
173 pngTree.addActionListener(new java.awt.event.ActionListener()
175 public void actionPerformed(ActionEvent e)
177 pngTree_actionPerformed(e);
180 saveAsMenu.setText(MessageManager.getString("action.save_as"));
182 .setToolTipText(MessageManager
183 .getString("label.marks_leaves_tree_not_associated_with_sequence"));
184 placeholdersMenu.setText(MessageManager
185 .getString("label.mark_unlinked_leaves"));
186 placeholdersMenu.addActionListener(new ActionListener()
188 public void actionPerformed(ActionEvent e)
190 placeholdersMenu_actionPerformed(e);
193 textbox.setText(MessageManager.getString("label.out_to_textbox")
195 textbox.addActionListener(new ActionListener()
197 public void actionPerformed(ActionEvent e)
199 textbox_actionPerformed(e);
202 originalSeqData.setText(MessageManager.getString("label.input_data"));
203 originalSeqData.addActionListener(new ActionListener()
205 public void actionPerformed(ActionEvent e)
207 originalSeqData_actionPerformed(e);
210 associateLeavesMenu.setText(MessageManager
211 .getString("label.associate_leaves_with"));
212 this.getContentPane().add(scrollPane, BorderLayout.CENTER);
213 jMenuBar1.add(fileMenu);
214 jMenuBar1.add(viewMenu);
215 fileMenu.add(saveAsMenu);
216 fileMenu.add(textbox);
217 fileMenu.add(printMenu);
218 fileMenu.add(originalSeqData);
219 viewMenu.add(fitToWindow);
221 viewMenu.add(distanceMenu);
222 viewMenu.add(bootstrapMenu);
223 viewMenu.add(placeholdersMenu);
224 viewMenu.add(sortAssocViews);
225 viewMenu.add(associateLeavesMenu);
226 saveAsMenu.add(saveAsNewick);
227 saveAsMenu.add(epsTree);
228 saveAsMenu.add(pngTree);
231 public void printMenu_actionPerformed(ActionEvent e)
235 public void font_actionPerformed(ActionEvent e)
239 public void distanceMenu_actionPerformed(ActionEvent e)
243 public void bootstrapMenu_actionPerformed(ActionEvent e)
247 public void fitToWindow_actionPerformed(ActionEvent e)
251 public void pngTree_actionPerformed(ActionEvent e)
255 public void epsTree_actionPerformed(ActionEvent e)
259 public void saveAsNewick_actionPerformed(ActionEvent e)
263 public void placeholdersMenu_actionPerformed(ActionEvent e)
267 public void textbox_actionPerformed(ActionEvent e)
271 public void fullid_actionPerformed(ActionEvent e)
276 public void originalSeqData_actionPerformed(ActionEvent e)
281 public void viewMenu_menuSelected()
285 public void sortByTree_actionPerformed(ActionEvent e)