2 * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8)
3 * Copyright (C) 2012 J Procter, AM Waterhouse, LM Lui, J Engelhardt, G Barton, M Clamp, S Searle
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/>.
18 package jalview.jbgui;
20 import jalview.util.MessageManager;
23 import java.awt.event.*;
25 import javax.swing.event.*;
27 public class GTreePanel extends JInternalFrame
29 BorderLayout borderLayout1 = new BorderLayout();
31 public JScrollPane scrollPane = new JScrollPane();
33 JMenuBar jMenuBar1 = new JMenuBar();
35 JMenu fileMenu = new JMenu();
37 JMenuItem saveAsNewick = new JMenuItem();
39 JMenuItem printMenu = new JMenuItem();
41 protected JMenu viewMenu = new JMenu();
43 public JMenuItem font = new JMenuItem();
45 public JMenuItem sortAssocViews = new JMenuItem();
47 public JCheckBoxMenuItem bootstrapMenu = new JCheckBoxMenuItem();
49 public JCheckBoxMenuItem distanceMenu = new JCheckBoxMenuItem();
51 public JCheckBoxMenuItem fitToWindow = new JCheckBoxMenuItem();
53 public JCheckBoxMenuItem placeholdersMenu = new JCheckBoxMenuItem();
55 JMenuItem pngTree = new JMenuItem();
57 JMenuItem epsTree = new JMenuItem();
59 JMenu saveAsMenu = new JMenu();
61 JMenuItem textbox = new JMenuItem();
63 public JMenuItem originalSeqData = new JMenuItem();
65 protected JMenu associateLeavesMenu = new JMenu();
72 this.setJMenuBar(jMenuBar1);
79 private void jbInit() throws Exception
81 this.getContentPane().setLayout(borderLayout1);
82 this.setBackground(Color.white);
83 this.setFont(new java.awt.Font("Verdana", 0, 12));
84 scrollPane.setOpaque(false);
85 fileMenu.setText(MessageManager.getString("action.file"));
86 saveAsNewick.setText(MessageManager.getString("label.newick_format"));
87 saveAsNewick.addActionListener(new ActionListener()
89 public void actionPerformed(ActionEvent e)
91 saveAsNewick_actionPerformed(e);
94 printMenu.setText(MessageManager.getString("action.print"));
95 printMenu.addActionListener(new java.awt.event.ActionListener()
97 public void actionPerformed(ActionEvent e)
99 printMenu_actionPerformed(e);
102 viewMenu.setText(MessageManager.getString("action.view"));
103 viewMenu.addMenuListener(new MenuListener()
105 public void menuSelected(MenuEvent e)
107 viewMenu_menuSelected();
110 public void menuDeselected(MenuEvent e)
114 public void menuCanceled(MenuEvent e)
118 sortAssocViews.setText(MessageManager.getString("label.sort_alignment_by_tree"));
119 sortAssocViews.addActionListener(new java.awt.event.ActionListener()
121 public void actionPerformed(ActionEvent e)
123 sortByTree_actionPerformed(e);
126 font.setText(MessageManager.getString("action.font"));
127 font.addActionListener(new java.awt.event.ActionListener()
129 public void actionPerformed(ActionEvent e)
131 font_actionPerformed(e);
134 bootstrapMenu.setText(MessageManager.getString("label.show_bootstrap_values"));
135 bootstrapMenu.addActionListener(new java.awt.event.ActionListener()
137 public void actionPerformed(ActionEvent e)
139 bootstrapMenu_actionPerformed(e);
142 distanceMenu.setText(MessageManager.getString("label.show_distances"));
143 distanceMenu.addActionListener(new java.awt.event.ActionListener()
145 public void actionPerformed(ActionEvent e)
147 distanceMenu_actionPerformed(e);
150 fitToWindow.setSelected(true);
151 fitToWindow.setText(MessageManager.getString("label.fit_to_window"));
152 fitToWindow.addActionListener(new java.awt.event.ActionListener()
154 public void actionPerformed(ActionEvent e)
156 fitToWindow_actionPerformed(e);
159 epsTree.setText("EPS");
160 epsTree.addActionListener(new java.awt.event.ActionListener()
162 public void actionPerformed(ActionEvent e)
164 epsTree_actionPerformed(e);
167 pngTree.setText("PNG");
168 pngTree.addActionListener(new java.awt.event.ActionListener()
170 public void actionPerformed(ActionEvent e)
172 pngTree_actionPerformed(e);
175 saveAsMenu.setText(MessageManager.getString("action.save_as"));
177 .setToolTipText(MessageManager.getString("label.marks_leaves_tree_not_associated_with_sequence"));
178 placeholdersMenu.setText(MessageManager.getString("label.mark_unlinked_leaves"));
179 placeholdersMenu.addActionListener(new ActionListener()
181 public void actionPerformed(ActionEvent e)
183 placeholdersMenu_actionPerformed(e);
186 textbox.setText(MessageManager.getString("label.out_to_textbox") + "...");
187 textbox.addActionListener(new ActionListener()
189 public void actionPerformed(ActionEvent e)
191 textbox_actionPerformed(e);
194 originalSeqData.setText(MessageManager.getString("label.input_data"));
195 originalSeqData.addActionListener(new ActionListener()
197 public void actionPerformed(ActionEvent e)
199 originalSeqData_actionPerformed(e);
202 associateLeavesMenu.setText(MessageManager.getString("label.associate_leaves_with"));
203 this.getContentPane().add(scrollPane, BorderLayout.CENTER);
204 jMenuBar1.add(fileMenu);
205 jMenuBar1.add(viewMenu);
206 fileMenu.add(saveAsMenu);
207 fileMenu.add(textbox);
208 fileMenu.add(printMenu);
209 fileMenu.add(originalSeqData);
210 viewMenu.add(fitToWindow);
212 viewMenu.add(distanceMenu);
213 viewMenu.add(bootstrapMenu);
214 viewMenu.add(placeholdersMenu);
215 viewMenu.add(sortAssocViews);
216 viewMenu.add(associateLeavesMenu);
217 saveAsMenu.add(saveAsNewick);
218 saveAsMenu.add(epsTree);
219 saveAsMenu.add(pngTree);
222 public void printMenu_actionPerformed(ActionEvent e)
226 public void font_actionPerformed(ActionEvent e)
230 public void distanceMenu_actionPerformed(ActionEvent e)
234 public void bootstrapMenu_actionPerformed(ActionEvent e)
238 public void fitToWindow_actionPerformed(ActionEvent e)
242 public void pngTree_actionPerformed(ActionEvent e)
246 public void epsTree_actionPerformed(ActionEvent e)
250 public void saveAsNewick_actionPerformed(ActionEvent e)
254 public void placeholdersMenu_actionPerformed(ActionEvent e)
258 public void textbox_actionPerformed(ActionEvent e)
262 public void fullid_actionPerformed(ActionEvent e)
267 public void originalSeqData_actionPerformed(ActionEvent e)
272 public void viewMenu_menuSelected()
276 public void sortByTree_actionPerformed(ActionEvent e)