2 * Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
3 * Copyright (C) 2010 J Procter, AM Waterhouse, 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;
21 import java.awt.event.*;
23 import javax.swing.event.*;
25 public class GTreePanel extends JInternalFrame
27 BorderLayout borderLayout1 = new BorderLayout();
29 public JScrollPane scrollPane = new JScrollPane();
31 JMenuBar jMenuBar1 = new JMenuBar();
33 JMenu fileMenu = new JMenu();
35 JMenuItem saveAsNewick = new JMenuItem();
37 JMenuItem printMenu = new JMenuItem();
39 protected JMenu viewMenu = new JMenu();
41 public JMenuItem font = new JMenuItem();
43 public JCheckBoxMenuItem bootstrapMenu = new JCheckBoxMenuItem();
45 public JCheckBoxMenuItem distanceMenu = new JCheckBoxMenuItem();
47 public JCheckBoxMenuItem fitToWindow = new JCheckBoxMenuItem();
49 public JCheckBoxMenuItem placeholdersMenu = new JCheckBoxMenuItem();
51 JMenuItem pngTree = new JMenuItem();
53 JMenuItem epsTree = new JMenuItem();
55 JMenu saveAsMenu = new JMenu();
57 JMenuItem textbox = new JMenuItem();
59 public JMenuItem originalSeqData = new JMenuItem();
61 protected JMenu associateLeavesMenu = new JMenu();
68 this.setJMenuBar(jMenuBar1);
75 private void jbInit() throws Exception
77 this.getContentPane().setLayout(borderLayout1);
78 this.setBackground(Color.white);
79 this.setFont(new java.awt.Font("Verdana", 0, 12));
80 scrollPane.setOpaque(false);
81 fileMenu.setText("File");
82 saveAsNewick.setText("Newick Format");
83 saveAsNewick.addActionListener(new ActionListener()
85 public void actionPerformed(ActionEvent e)
87 saveAsNewick_actionPerformed(e);
90 printMenu.setText("Print");
91 printMenu.addActionListener(new java.awt.event.ActionListener()
93 public void actionPerformed(ActionEvent e)
95 printMenu_actionPerformed(e);
98 viewMenu.setText("View");
99 viewMenu.addMenuListener(new MenuListener()
101 public void menuSelected(MenuEvent e)
103 viewMenu_menuSelected();
106 public void menuDeselected(MenuEvent e)
110 public void menuCanceled(MenuEvent e)
114 font.setText("Font...");
115 font.addActionListener(new java.awt.event.ActionListener()
117 public void actionPerformed(ActionEvent e)
119 font_actionPerformed(e);
122 bootstrapMenu.setText("Show Bootstrap Values");
123 bootstrapMenu.addActionListener(new java.awt.event.ActionListener()
125 public void actionPerformed(ActionEvent e)
127 bootstrapMenu_actionPerformed(e);
130 distanceMenu.setText("Show Distances");
131 distanceMenu.addActionListener(new java.awt.event.ActionListener()
133 public void actionPerformed(ActionEvent e)
135 distanceMenu_actionPerformed(e);
138 fitToWindow.setSelected(true);
139 fitToWindow.setText("Fit To Window");
140 fitToWindow.addActionListener(new java.awt.event.ActionListener()
142 public void actionPerformed(ActionEvent e)
144 fitToWindow_actionPerformed(e);
147 epsTree.setText("EPS");
148 epsTree.addActionListener(new java.awt.event.ActionListener()
150 public void actionPerformed(ActionEvent e)
152 epsTree_actionPerformed(e);
155 pngTree.setText("PNG");
156 pngTree.addActionListener(new java.awt.event.ActionListener()
158 public void actionPerformed(ActionEvent e)
160 pngTree_actionPerformed(e);
163 saveAsMenu.setText("Save as");
165 .setToolTipText("Marks leaves of tree not associated with a sequence");
166 placeholdersMenu.setText("Mark Unlinked Leaves");
167 placeholdersMenu.addActionListener(new ActionListener()
169 public void actionPerformed(ActionEvent e)
171 placeholdersMenu_actionPerformed(e);
174 textbox.setText("Output to Textbox...");
175 textbox.addActionListener(new ActionListener()
177 public void actionPerformed(ActionEvent e)
179 textbox_actionPerformed(e);
182 originalSeqData.setText("Input Data...");
183 originalSeqData.addActionListener(new ActionListener()
185 public void actionPerformed(ActionEvent e)
187 originalSeqData_actionPerformed(e);
190 associateLeavesMenu.setText("Associate Leaves With");
191 this.getContentPane().add(scrollPane, BorderLayout.CENTER);
192 jMenuBar1.add(fileMenu);
193 jMenuBar1.add(viewMenu);
194 fileMenu.add(saveAsMenu);
195 fileMenu.add(textbox);
196 fileMenu.add(printMenu);
197 fileMenu.add(originalSeqData);
198 viewMenu.add(fitToWindow);
200 viewMenu.add(distanceMenu);
201 viewMenu.add(bootstrapMenu);
202 viewMenu.add(placeholdersMenu);
203 viewMenu.add(associateLeavesMenu);
204 saveAsMenu.add(saveAsNewick);
205 saveAsMenu.add(epsTree);
206 saveAsMenu.add(pngTree);
209 public void printMenu_actionPerformed(ActionEvent e)
213 public void font_actionPerformed(ActionEvent e)
217 public void distanceMenu_actionPerformed(ActionEvent e)
221 public void bootstrapMenu_actionPerformed(ActionEvent e)
225 public void fitToWindow_actionPerformed(ActionEvent e)
229 public void pngTree_actionPerformed(ActionEvent e)
233 public void epsTree_actionPerformed(ActionEvent e)
237 public void saveAsNewick_actionPerformed(ActionEvent e)
241 public void placeholdersMenu_actionPerformed(ActionEvent e)
245 public void textbox_actionPerformed(ActionEvent e)
249 public void fullid_actionPerformed(ActionEvent e)
254 public void originalSeqData_actionPerformed(ActionEvent e)
259 public void viewMenu_menuSelected()