2 * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
3 * Copyright (C) $$Year-Rel$$ 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;
25 import java.awt.BorderLayout;
26 import java.awt.Color;
27 import java.awt.event.ActionEvent;
28 import java.awt.event.ActionListener;
30 import javax.swing.JCheckBoxMenuItem;
31 import javax.swing.JInternalFrame;
32 import javax.swing.JMenu;
33 import javax.swing.JMenuBar;
34 import javax.swing.JMenuItem;
35 import javax.swing.JScrollPane;
36 import javax.swing.event.MenuEvent;
37 import javax.swing.event.MenuListener;
39 public class GTreePanel extends JInternalFrame
41 BorderLayout borderLayout1 = new BorderLayout();
43 public JScrollPane scrollPane = new JScrollPane();
45 JMenuBar jMenuBar1 = new JMenuBar();
47 JMenu fileMenu = new JMenu();
49 JMenuItem saveAsNewick = new JMenuItem();
51 JMenuItem printMenu = new JMenuItem();
53 protected JMenu viewMenu = new JMenu();
55 public JMenuItem font = new JMenuItem();
57 public JMenuItem sortAssocViews = new JMenuItem();
59 public JCheckBoxMenuItem bootstrapMenu = new JCheckBoxMenuItem();
61 public JCheckBoxMenuItem distanceMenu = new JCheckBoxMenuItem();
63 public JCheckBoxMenuItem fitToWindow = new JCheckBoxMenuItem();
65 public JCheckBoxMenuItem placeholdersMenu = new JCheckBoxMenuItem();
67 JMenuItem pngTree = new JMenuItem();
69 JMenuItem epsTree = new JMenuItem();
71 JMenu saveAsMenu = new JMenu();
73 JMenuItem textbox = new JMenuItem();
75 public JMenuItem originalSeqData = new JMenuItem();
77 protected JMenu associateLeavesMenu = new JMenu();
84 this.setJMenuBar(jMenuBar1);
91 private void jbInit() throws Exception
93 this.getContentPane().setLayout(borderLayout1);
94 this.setBackground(Color.white);
95 this.setFont(new java.awt.Font("Verdana", 0, 12));
96 scrollPane.setOpaque(false);
97 fileMenu.setText(MessageManager.getString("action.file"));
98 saveAsNewick.setText(MessageManager.getString("label.newick_format"));
99 saveAsNewick.addActionListener(new ActionListener()
101 public void actionPerformed(ActionEvent e)
103 saveAsNewick_actionPerformed(e);
106 printMenu.setText(MessageManager.getString("action.print"));
107 printMenu.addActionListener(new java.awt.event.ActionListener()
109 public void actionPerformed(ActionEvent e)
111 printMenu_actionPerformed(e);
114 viewMenu.setText(MessageManager.getString("action.view"));
115 viewMenu.addMenuListener(new MenuListener()
117 public void menuSelected(MenuEvent e)
119 viewMenu_menuSelected();
122 public void menuDeselected(MenuEvent e)
126 public void menuCanceled(MenuEvent e)
130 sortAssocViews.setText(MessageManager
131 .getString("label.sort_alignment_by_tree"));
132 sortAssocViews.addActionListener(new java.awt.event.ActionListener()
134 public void actionPerformed(ActionEvent e)
136 sortByTree_actionPerformed();
139 font.setText(MessageManager.getString("action.font"));
140 font.addActionListener(new java.awt.event.ActionListener()
142 public void actionPerformed(ActionEvent e)
144 font_actionPerformed(e);
147 bootstrapMenu.setText(MessageManager
148 .getString("label.show_bootstrap_values"));
149 bootstrapMenu.addActionListener(new java.awt.event.ActionListener()
151 public void actionPerformed(ActionEvent e)
153 bootstrapMenu_actionPerformed(e);
156 distanceMenu.setText(MessageManager.getString("label.show_distances"));
157 distanceMenu.addActionListener(new java.awt.event.ActionListener()
159 public void actionPerformed(ActionEvent e)
161 distanceMenu_actionPerformed(e);
164 fitToWindow.setSelected(true);
165 fitToWindow.setText(MessageManager.getString("label.fit_to_window"));
166 fitToWindow.addActionListener(new java.awt.event.ActionListener()
168 public void actionPerformed(ActionEvent e)
170 fitToWindow_actionPerformed(e);
173 epsTree.setText("EPS");
174 epsTree.addActionListener(new java.awt.event.ActionListener()
176 public void actionPerformed(ActionEvent e)
178 epsTree_actionPerformed(e);
181 pngTree.setText("PNG");
182 pngTree.addActionListener(new java.awt.event.ActionListener()
184 public void actionPerformed(ActionEvent e)
186 pngTree_actionPerformed(e);
189 saveAsMenu.setText(MessageManager.getString("action.save_as"));
191 .setToolTipText(MessageManager
192 .getString("label.marks_leaves_tree_not_associated_with_sequence"));
193 placeholdersMenu.setText(MessageManager
194 .getString("label.mark_unlinked_leaves"));
195 placeholdersMenu.addActionListener(new ActionListener()
197 public void actionPerformed(ActionEvent e)
199 placeholdersMenu_actionPerformed(e);
202 textbox.setText(MessageManager.getString("label.out_to_textbox"));
203 textbox.addActionListener(new ActionListener()
205 public void actionPerformed(ActionEvent e)
207 textbox_actionPerformed(e);
210 originalSeqData.setText(MessageManager.getString("label.input_data"));
211 originalSeqData.addActionListener(new ActionListener()
213 public void actionPerformed(ActionEvent e)
215 originalSeqData_actionPerformed(e);
218 associateLeavesMenu.setText(MessageManager
219 .getString("label.associate_leaves_with"));
220 this.getContentPane().add(scrollPane, BorderLayout.CENTER);
221 jMenuBar1.add(fileMenu);
222 jMenuBar1.add(viewMenu);
223 fileMenu.add(saveAsMenu);
224 fileMenu.add(textbox);
225 fileMenu.add(printMenu);
226 fileMenu.add(originalSeqData);
227 viewMenu.add(fitToWindow);
229 viewMenu.add(distanceMenu);
230 viewMenu.add(bootstrapMenu);
231 viewMenu.add(placeholdersMenu);
232 viewMenu.add(sortAssocViews);
233 viewMenu.add(associateLeavesMenu);
234 saveAsMenu.add(saveAsNewick);
235 saveAsMenu.add(epsTree);
236 saveAsMenu.add(pngTree);
239 public void printMenu_actionPerformed(ActionEvent e)
243 public void font_actionPerformed(ActionEvent e)
247 public void distanceMenu_actionPerformed(ActionEvent e)
251 public void bootstrapMenu_actionPerformed(ActionEvent e)
255 public void fitToWindow_actionPerformed(ActionEvent e)
259 public void pngTree_actionPerformed(ActionEvent e)
263 public void epsTree_actionPerformed(ActionEvent e)
267 public void saveAsNewick_actionPerformed(ActionEvent e)
271 public void placeholdersMenu_actionPerformed(ActionEvent e)
275 public void textbox_actionPerformed(ActionEvent e)
279 public void fullid_actionPerformed(ActionEvent e)
284 public void originalSeqData_actionPerformed(ActionEvent e)
289 public void viewMenu_menuSelected()
293 public void sortByTree_actionPerformed()