2 * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.1)
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 of the License, or (at your option) any later version.
11 * Jalview is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty
13 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14 * PURPOSE. See the GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License along with Jalview. If not, see <http://www.gnu.org/licenses/>.
17 * The Jalview Authors are detailed in the 'AUTHORS' file.
19 package jalview.jbgui;
21 import jalview.util.MessageManager;
24 import java.awt.event.*;
26 import javax.swing.event.*;
28 public class GTreePanel extends JInternalFrame
30 BorderLayout borderLayout1 = new BorderLayout();
32 public JScrollPane scrollPane = new JScrollPane();
34 JMenuBar jMenuBar1 = new JMenuBar();
36 JMenu fileMenu = new JMenu();
38 JMenuItem saveAsNewick = new JMenuItem();
40 JMenuItem printMenu = new JMenuItem();
42 protected JMenu viewMenu = new JMenu();
44 public JMenuItem font = new JMenuItem();
46 public JMenuItem sortAssocViews = new JMenuItem();
48 public JCheckBoxMenuItem bootstrapMenu = new JCheckBoxMenuItem();
50 public JCheckBoxMenuItem distanceMenu = new JCheckBoxMenuItem();
52 public JCheckBoxMenuItem fitToWindow = new JCheckBoxMenuItem();
54 public JCheckBoxMenuItem placeholdersMenu = new JCheckBoxMenuItem();
56 JMenuItem pngTree = new JMenuItem();
58 JMenuItem epsTree = new JMenuItem();
60 JMenu saveAsMenu = new JMenu();
62 JMenuItem textbox = new JMenuItem();
64 public JMenuItem originalSeqData = new JMenuItem();
66 protected JMenu associateLeavesMenu = new JMenu();
73 this.setJMenuBar(jMenuBar1);
80 private void jbInit() throws Exception
82 this.getContentPane().setLayout(borderLayout1);
83 this.setBackground(Color.white);
84 this.setFont(new java.awt.Font("Verdana", 0, 12));
85 scrollPane.setOpaque(false);
86 fileMenu.setText(MessageManager.getString("action.file"));
87 saveAsNewick.setText(MessageManager.getString("label.newick_format"));
88 saveAsNewick.addActionListener(new ActionListener()
90 public void actionPerformed(ActionEvent e)
92 saveAsNewick_actionPerformed(e);
95 printMenu.setText(MessageManager.getString("action.print"));
96 printMenu.addActionListener(new java.awt.event.ActionListener()
98 public void actionPerformed(ActionEvent e)
100 printMenu_actionPerformed(e);
103 viewMenu.setText(MessageManager.getString("action.view"));
104 viewMenu.addMenuListener(new MenuListener()
106 public void menuSelected(MenuEvent e)
108 viewMenu_menuSelected();
111 public void menuDeselected(MenuEvent e)
115 public void menuCanceled(MenuEvent e)
119 sortAssocViews.setText(MessageManager.getString("label.sort_alignment_by_tree"));
120 sortAssocViews.addActionListener(new java.awt.event.ActionListener()
122 public void actionPerformed(ActionEvent e)
124 sortByTree_actionPerformed(e);
127 font.setText(MessageManager.getString("action.font"));
128 font.addActionListener(new java.awt.event.ActionListener()
130 public void actionPerformed(ActionEvent e)
132 font_actionPerformed(e);
135 bootstrapMenu.setText(MessageManager.getString("label.show_bootstrap_values"));
136 bootstrapMenu.addActionListener(new java.awt.event.ActionListener()
138 public void actionPerformed(ActionEvent e)
140 bootstrapMenu_actionPerformed(e);
143 distanceMenu.setText(MessageManager.getString("label.show_distances"));
144 distanceMenu.addActionListener(new java.awt.event.ActionListener()
146 public void actionPerformed(ActionEvent e)
148 distanceMenu_actionPerformed(e);
151 fitToWindow.setSelected(true);
152 fitToWindow.setText(MessageManager.getString("label.fit_to_window"));
153 fitToWindow.addActionListener(new java.awt.event.ActionListener()
155 public void actionPerformed(ActionEvent e)
157 fitToWindow_actionPerformed(e);
160 epsTree.setText("EPS");
161 epsTree.addActionListener(new java.awt.event.ActionListener()
163 public void actionPerformed(ActionEvent e)
165 epsTree_actionPerformed(e);
168 pngTree.setText("PNG");
169 pngTree.addActionListener(new java.awt.event.ActionListener()
171 public void actionPerformed(ActionEvent e)
173 pngTree_actionPerformed(e);
176 saveAsMenu.setText(MessageManager.getString("action.save_as"));
178 .setToolTipText(MessageManager.getString("label.marks_leaves_tree_not_associated_with_sequence"));
179 placeholdersMenu.setText(MessageManager.getString("label.mark_unlinked_leaves"));
180 placeholdersMenu.addActionListener(new ActionListener()
182 public void actionPerformed(ActionEvent e)
184 placeholdersMenu_actionPerformed(e);
187 textbox.setText(MessageManager.getString("label.out_to_textbox") + "...");
188 textbox.addActionListener(new ActionListener()
190 public void actionPerformed(ActionEvent e)
192 textbox_actionPerformed(e);
195 originalSeqData.setText(MessageManager.getString("label.input_data"));
196 originalSeqData.addActionListener(new ActionListener()
198 public void actionPerformed(ActionEvent e)
200 originalSeqData_actionPerformed(e);
203 associateLeavesMenu.setText(MessageManager.getString("label.associate_leaves_with"));
204 this.getContentPane().add(scrollPane, BorderLayout.CENTER);
205 jMenuBar1.add(fileMenu);
206 jMenuBar1.add(viewMenu);
207 fileMenu.add(saveAsMenu);
208 fileMenu.add(textbox);
209 fileMenu.add(printMenu);
210 fileMenu.add(originalSeqData);
211 viewMenu.add(fitToWindow);
213 viewMenu.add(distanceMenu);
214 viewMenu.add(bootstrapMenu);
215 viewMenu.add(placeholdersMenu);
216 viewMenu.add(sortAssocViews);
217 viewMenu.add(associateLeavesMenu);
218 saveAsMenu.add(saveAsNewick);
219 saveAsMenu.add(epsTree);
220 saveAsMenu.add(pngTree);
223 public void printMenu_actionPerformed(ActionEvent e)
227 public void font_actionPerformed(ActionEvent e)
231 public void distanceMenu_actionPerformed(ActionEvent e)
235 public void bootstrapMenu_actionPerformed(ActionEvent e)
239 public void fitToWindow_actionPerformed(ActionEvent e)
243 public void pngTree_actionPerformed(ActionEvent e)
247 public void epsTree_actionPerformed(ActionEvent e)
251 public void saveAsNewick_actionPerformed(ActionEvent e)
255 public void placeholdersMenu_actionPerformed(ActionEvent e)
259 public void textbox_actionPerformed(ActionEvent e)
263 public void fullid_actionPerformed(ActionEvent e)
268 public void originalSeqData_actionPerformed(ActionEvent e)
273 public void viewMenu_menuSelected()
277 public void sortByTree_actionPerformed(ActionEvent e)