2 * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
3 * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, 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 JMenuItem sortAssocViews = new JMenuItem();
45 public JCheckBoxMenuItem bootstrapMenu = new JCheckBoxMenuItem();
47 public JCheckBoxMenuItem distanceMenu = new JCheckBoxMenuItem();
49 public JCheckBoxMenuItem fitToWindow = new JCheckBoxMenuItem();
51 public JCheckBoxMenuItem placeholdersMenu = new JCheckBoxMenuItem();
53 JMenuItem pngTree = new JMenuItem();
55 JMenuItem epsTree = new JMenuItem();
57 JMenu saveAsMenu = new JMenu();
59 JMenuItem textbox = new JMenuItem();
61 public JMenuItem originalSeqData = new JMenuItem();
63 protected JMenu associateLeavesMenu = new JMenu();
70 this.setJMenuBar(jMenuBar1);
77 private void jbInit() throws Exception
79 this.getContentPane().setLayout(borderLayout1);
80 this.setBackground(Color.white);
81 this.setFont(new java.awt.Font("Verdana", 0, 12));
82 scrollPane.setOpaque(false);
83 fileMenu.setText("File");
84 saveAsNewick.setText("Newick Format");
85 saveAsNewick.addActionListener(new ActionListener()
87 public void actionPerformed(ActionEvent e)
89 saveAsNewick_actionPerformed(e);
92 printMenu.setText("Print");
93 printMenu.addActionListener(new java.awt.event.ActionListener()
95 public void actionPerformed(ActionEvent e)
97 printMenu_actionPerformed(e);
100 viewMenu.setText("View");
101 viewMenu.addMenuListener(new MenuListener()
103 public void menuSelected(MenuEvent e)
105 viewMenu_menuSelected();
108 public void menuDeselected(MenuEvent e)
112 public void menuCanceled(MenuEvent e)
116 sortAssocViews.setText("Sort Alignment By Tree");
117 sortAssocViews.addActionListener(new java.awt.event.ActionListener()
119 public void actionPerformed(ActionEvent e)
121 sortByTree_actionPerformed(e);
124 font.setText("Font...");
125 font.addActionListener(new java.awt.event.ActionListener()
127 public void actionPerformed(ActionEvent e)
129 font_actionPerformed(e);
132 bootstrapMenu.setText("Show Bootstrap Values");
133 bootstrapMenu.addActionListener(new java.awt.event.ActionListener()
135 public void actionPerformed(ActionEvent e)
137 bootstrapMenu_actionPerformed(e);
140 distanceMenu.setText("Show Distances");
141 distanceMenu.addActionListener(new java.awt.event.ActionListener()
143 public void actionPerformed(ActionEvent e)
145 distanceMenu_actionPerformed(e);
148 fitToWindow.setSelected(true);
149 fitToWindow.setText("Fit To Window");
150 fitToWindow.addActionListener(new java.awt.event.ActionListener()
152 public void actionPerformed(ActionEvent e)
154 fitToWindow_actionPerformed(e);
157 epsTree.setText("EPS");
158 epsTree.addActionListener(new java.awt.event.ActionListener()
160 public void actionPerformed(ActionEvent e)
162 epsTree_actionPerformed(e);
165 pngTree.setText("PNG");
166 pngTree.addActionListener(new java.awt.event.ActionListener()
168 public void actionPerformed(ActionEvent e)
170 pngTree_actionPerformed(e);
173 saveAsMenu.setText("Save as");
175 .setToolTipText("Marks leaves of tree not associated with a sequence");
176 placeholdersMenu.setText("Mark Unlinked Leaves");
177 placeholdersMenu.addActionListener(new ActionListener()
179 public void actionPerformed(ActionEvent e)
181 placeholdersMenu_actionPerformed(e);
184 textbox.setText("Output to Textbox...");
185 textbox.addActionListener(new ActionListener()
187 public void actionPerformed(ActionEvent e)
189 textbox_actionPerformed(e);
192 originalSeqData.setText("Input Data...");
193 originalSeqData.addActionListener(new ActionListener()
195 public void actionPerformed(ActionEvent e)
197 originalSeqData_actionPerformed(e);
200 associateLeavesMenu.setText("Associate Leaves With");
201 this.getContentPane().add(scrollPane, BorderLayout.CENTER);
202 jMenuBar1.add(fileMenu);
203 jMenuBar1.add(viewMenu);
204 fileMenu.add(saveAsMenu);
205 fileMenu.add(textbox);
206 fileMenu.add(printMenu);
207 fileMenu.add(originalSeqData);
208 viewMenu.add(fitToWindow);
210 viewMenu.add(distanceMenu);
211 viewMenu.add(bootstrapMenu);
212 viewMenu.add(placeholdersMenu);
213 viewMenu.add(sortAssocViews);
214 viewMenu.add(associateLeavesMenu);
215 saveAsMenu.add(saveAsNewick);
216 saveAsMenu.add(epsTree);
217 saveAsMenu.add(pngTree);
220 public void printMenu_actionPerformed(ActionEvent e)
224 public void font_actionPerformed(ActionEvent e)
228 public void distanceMenu_actionPerformed(ActionEvent e)
232 public void bootstrapMenu_actionPerformed(ActionEvent e)
236 public void fitToWindow_actionPerformed(ActionEvent e)
240 public void pngTree_actionPerformed(ActionEvent e)
244 public void epsTree_actionPerformed(ActionEvent e)
248 public void saveAsNewick_actionPerformed(ActionEvent e)
252 public void placeholdersMenu_actionPerformed(ActionEvent e)
256 public void textbox_actionPerformed(ActionEvent e)
260 public void fullid_actionPerformed(ActionEvent e)
265 public void originalSeqData_actionPerformed(ActionEvent e)
270 public void viewMenu_menuSelected()
273 public void sortByTree_actionPerformed(ActionEvent e)