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(
131 MessageManager.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(
148 MessageManager.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"));
190 placeholdersMenu.setToolTipText(MessageManager.getString(
191 "label.marks_leaves_tree_not_associated_with_sequence"));
192 placeholdersMenu.setText(
193 MessageManager.getString("label.mark_unlinked_leaves"));
194 placeholdersMenu.addActionListener(new ActionListener()
196 public void actionPerformed(ActionEvent e)
198 placeholdersMenu_actionPerformed(e);
201 textbox.setText(MessageManager.getString("label.out_to_textbox"));
202 textbox.addActionListener(new ActionListener()
204 public void actionPerformed(ActionEvent e)
206 textbox_actionPerformed(e);
209 originalSeqData.setText(MessageManager.getString("label.input_data"));
210 originalSeqData.addActionListener(new ActionListener()
212 public void actionPerformed(ActionEvent e)
214 originalSeqData_actionPerformed(e);
217 associateLeavesMenu.setText(
218 MessageManager.getString("label.associate_leaves_with"));
219 this.getContentPane().add(scrollPane, BorderLayout.CENTER);
220 jMenuBar1.add(fileMenu);
221 jMenuBar1.add(viewMenu);
222 fileMenu.add(saveAsMenu);
223 fileMenu.add(textbox);
224 fileMenu.add(printMenu);
225 fileMenu.add(originalSeqData);
226 viewMenu.add(fitToWindow);
228 viewMenu.add(distanceMenu);
229 viewMenu.add(bootstrapMenu);
230 viewMenu.add(placeholdersMenu);
231 viewMenu.add(sortAssocViews);
232 viewMenu.add(associateLeavesMenu);
233 saveAsMenu.add(saveAsNewick);
234 saveAsMenu.add(epsTree);
235 saveAsMenu.add(pngTree);
238 public void printMenu_actionPerformed(ActionEvent e)
242 public void font_actionPerformed(ActionEvent e)
246 public void distanceMenu_actionPerformed(ActionEvent e)
250 public void bootstrapMenu_actionPerformed(ActionEvent e)
254 public void fitToWindow_actionPerformed(ActionEvent e)
258 public void pngTree_actionPerformed(ActionEvent e)
262 public void epsTree_actionPerformed(ActionEvent e)
266 public void saveAsNewick_actionPerformed(ActionEvent e)
270 public void placeholdersMenu_actionPerformed(ActionEvent e)
274 public void textbox_actionPerformed(ActionEvent e)
278 public void fullid_actionPerformed(ActionEvent e)
283 public void originalSeqData_actionPerformed(ActionEvent e)
288 public void viewMenu_menuSelected()
292 public void sortByTree_actionPerformed()