2 * Jalview - A Sequence Alignment Editor and Viewer
\r
3 * Copyright (C) 2007 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle
\r
5 * This program is free software; you can redistribute it and/or
\r
6 * modify it under the terms of the GNU General Public License
\r
7 * as published by the Free Software Foundation; either version 2
\r
8 * of the License, or (at your option) any later version.
\r
10 * This program is distributed in the hope that it will be useful,
\r
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r
13 * GNU General Public License for more details.
\r
15 * You should have received a copy of the GNU General Public License
\r
16 * along with this program; if not, write to the Free Software
\r
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
\r
19 package jalview.jbgui;
\r
22 import java.awt.event.*;
\r
23 import javax.swing.*;
\r
24 import javax.swing.event.*;
\r
26 public class GTreePanel
\r
27 extends JInternalFrame
\r
29 BorderLayout borderLayout1 = new BorderLayout();
\r
30 public JScrollPane scrollPane = new JScrollPane();
\r
31 JMenuBar jMenuBar1 = new JMenuBar();
\r
32 JMenu fileMenu = new JMenu();
\r
33 JMenuItem saveAsNewick = new JMenuItem();
\r
34 JMenuItem printMenu = new JMenuItem();
\r
35 protected JMenu viewMenu = new JMenu();
\r
36 public JMenuItem font = new JMenuItem();
\r
37 public JCheckBoxMenuItem bootstrapMenu = new JCheckBoxMenuItem();
\r
38 public JCheckBoxMenuItem distanceMenu = new JCheckBoxMenuItem();
\r
39 public JCheckBoxMenuItem fitToWindow = new JCheckBoxMenuItem();
\r
40 public JCheckBoxMenuItem placeholdersMenu = new JCheckBoxMenuItem();
\r
41 JMenuItem pngTree = new JMenuItem();
\r
42 JMenuItem epsTree = new JMenuItem();
\r
43 JMenu saveAsMenu = new JMenu();
\r
44 JMenuItem textbox = new JMenuItem();
\r
45 public JMenuItem originalSeqData = new JMenuItem();
\r
46 protected JMenu associateLeavesMenu = new JMenu();
\r
52 this.setJMenuBar(jMenuBar1);
\r
56 e.printStackTrace();
\r
60 private void jbInit()
\r
63 this.getContentPane().setLayout(borderLayout1);
\r
64 this.setBackground(Color.white);
\r
65 this.setFont(new java.awt.Font("Verdana", 0, 12));
\r
66 scrollPane.setOpaque(false);
\r
67 fileMenu.setText("File");
\r
68 saveAsNewick.setText("Newick Format");
\r
69 saveAsNewick.addActionListener(new ActionListener()
\r
71 public void actionPerformed(ActionEvent e)
\r
73 saveAsNewick_actionPerformed(e);
\r
76 printMenu.setText("Print");
\r
77 printMenu.addActionListener(new java.awt.event.ActionListener()
\r
79 public void actionPerformed(ActionEvent e)
\r
81 printMenu_actionPerformed(e);
\r
84 viewMenu.setText("View");
\r
85 viewMenu.addMenuListener(new MenuListener()
\r
87 public void menuSelected(MenuEvent e)
\r
89 viewMenu_menuSelected();
\r
92 public void menuDeselected(MenuEvent e)
\r
96 public void menuCanceled(MenuEvent e)
\r
100 font.setText("Font...");
\r
101 font.addActionListener(new java.awt.event.ActionListener()
\r
103 public void actionPerformed(ActionEvent e)
\r
105 font_actionPerformed(e);
\r
108 bootstrapMenu.setText("Show Bootstrap Values");
\r
109 bootstrapMenu.addActionListener(new java.awt.event.ActionListener()
\r
111 public void actionPerformed(ActionEvent e)
\r
113 bootstrapMenu_actionPerformed(e);
\r
116 distanceMenu.setText("Show Distances");
\r
117 distanceMenu.addActionListener(new java.awt.event.ActionListener()
\r
119 public void actionPerformed(ActionEvent e)
\r
121 distanceMenu_actionPerformed(e);
\r
124 fitToWindow.setSelected(true);
\r
125 fitToWindow.setText("Fit To Window");
\r
126 fitToWindow.addActionListener(new java.awt.event.ActionListener()
\r
128 public void actionPerformed(ActionEvent e)
\r
130 fitToWindow_actionPerformed(e);
\r
133 epsTree.setText("EPS");
\r
134 epsTree.addActionListener(new java.awt.event.ActionListener()
\r
136 public void actionPerformed(ActionEvent e)
\r
138 epsTree_actionPerformed(e);
\r
141 pngTree.setText("PNG");
\r
142 pngTree.addActionListener(new java.awt.event.ActionListener()
\r
144 public void actionPerformed(ActionEvent e)
\r
146 pngTree_actionPerformed(e);
\r
149 saveAsMenu.setText("Save as");
\r
150 placeholdersMenu.setToolTipText(
\r
151 "Marks leaves of tree not associated with a sequence");
\r
152 placeholdersMenu.setText("Mark Unlinked Leaves");
\r
153 placeholdersMenu.addActionListener(new ActionListener()
\r
155 public void actionPerformed(ActionEvent e)
\r
157 placeholdersMenu_actionPerformed(e);
\r
160 textbox.setText("Output to Textbox...");
\r
161 textbox.addActionListener(new ActionListener()
\r
163 public void actionPerformed(ActionEvent e)
\r
165 textbox_actionPerformed(e);
\r
168 originalSeqData.setText("Input Data...");
\r
169 originalSeqData.addActionListener(new ActionListener()
\r
171 public void actionPerformed(ActionEvent e)
\r
173 originalSeqData_actionPerformed(e);
\r
176 associateLeavesMenu.setText("Associate Leaves With");
\r
177 this.getContentPane().add(scrollPane, BorderLayout.CENTER);
\r
178 jMenuBar1.add(fileMenu);
\r
179 jMenuBar1.add(viewMenu);
\r
180 fileMenu.add(saveAsMenu);
\r
181 fileMenu.add(textbox);
\r
182 fileMenu.add(printMenu);
\r
183 fileMenu.add(originalSeqData);
\r
184 viewMenu.add(fitToWindow);
\r
185 viewMenu.add(font);
\r
186 viewMenu.add(distanceMenu);
\r
187 viewMenu.add(bootstrapMenu);
\r
188 viewMenu.add(placeholdersMenu);
\r
189 viewMenu.add(associateLeavesMenu);
\r
190 saveAsMenu.add(saveAsNewick);
\r
191 saveAsMenu.add(epsTree);
\r
192 saveAsMenu.add(pngTree);
\r
195 public void printMenu_actionPerformed(ActionEvent e)
\r
199 public void font_actionPerformed(ActionEvent e)
\r
203 public void distanceMenu_actionPerformed(ActionEvent e)
\r
207 public void bootstrapMenu_actionPerformed(ActionEvent e)
\r
211 public void fitToWindow_actionPerformed(ActionEvent e)
\r
215 public void pngTree_actionPerformed(ActionEvent e)
\r
219 public void epsTree_actionPerformed(ActionEvent e)
\r
223 public void saveAsNewick_actionPerformed(ActionEvent e)
\r
227 public void placeholdersMenu_actionPerformed(ActionEvent e)
\r
231 public void textbox_actionPerformed(ActionEvent e)
\r
235 public void fullid_actionPerformed(ActionEvent e)
\r
240 public void originalSeqData_actionPerformed(ActionEvent e)
\r
245 public void viewMenu_menuSelected()
\r