recovery of identical dataset sequence object on undo (rather than creation of a...
[jalview.git] / src / jalview / jbgui / GTreePanel.java
1 /*\r
2  * Jalview - A Sequence Alignment Editor and Viewer\r
3  * Copyright (C) 2007 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle\r
4  *\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
9  *\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
14  *\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
18  */\r
19 package jalview.jbgui;\r
20 \r
21 import java.awt.*;\r
22 import java.awt.event.*;\r
23 import javax.swing.*;\r
24 import javax.swing.event.*;\r
25 \r
26 public class GTreePanel\r
27     extends JInternalFrame\r
28 {\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
47   public GTreePanel()\r
48   {\r
49     try\r
50     {\r
51       jbInit();\r
52       this.setJMenuBar(jMenuBar1);\r
53     }\r
54     catch (Exception e)\r
55     {\r
56       e.printStackTrace();\r
57     }\r
58   }\r
59 \r
60   private void jbInit()\r
61       throws Exception\r
62   {\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
70     {\r
71       public void actionPerformed(ActionEvent e)\r
72       {\r
73         saveAsNewick_actionPerformed(e);\r
74       }\r
75     });\r
76     printMenu.setText("Print");\r
77     printMenu.addActionListener(new java.awt.event.ActionListener()\r
78     {\r
79       public void actionPerformed(ActionEvent e)\r
80       {\r
81         printMenu_actionPerformed(e);\r
82       }\r
83     });\r
84     viewMenu.setText("View");\r
85     viewMenu.addMenuListener(new MenuListener()\r
86     {\r
87       public void menuSelected(MenuEvent e)\r
88       {\r
89         viewMenu_menuSelected();\r
90       }\r
91 \r
92       public void menuDeselected(MenuEvent e)\r
93       {\r
94       }\r
95 \r
96       public void menuCanceled(MenuEvent e)\r
97       {\r
98       }\r
99     });\r
100     font.setText("Font...");\r
101     font.addActionListener(new java.awt.event.ActionListener()\r
102     {\r
103       public void actionPerformed(ActionEvent e)\r
104       {\r
105         font_actionPerformed(e);\r
106       }\r
107     });\r
108     bootstrapMenu.setText("Show Bootstrap Values");\r
109     bootstrapMenu.addActionListener(new java.awt.event.ActionListener()\r
110     {\r
111       public void actionPerformed(ActionEvent e)\r
112       {\r
113         bootstrapMenu_actionPerformed(e);\r
114       }\r
115     });\r
116     distanceMenu.setText("Show Distances");\r
117     distanceMenu.addActionListener(new java.awt.event.ActionListener()\r
118     {\r
119       public void actionPerformed(ActionEvent e)\r
120       {\r
121         distanceMenu_actionPerformed(e);\r
122       }\r
123     });\r
124     fitToWindow.setSelected(true);\r
125     fitToWindow.setText("Fit To Window");\r
126     fitToWindow.addActionListener(new java.awt.event.ActionListener()\r
127     {\r
128       public void actionPerformed(ActionEvent e)\r
129       {\r
130         fitToWindow_actionPerformed(e);\r
131       }\r
132     });\r
133     epsTree.setText("EPS");\r
134     epsTree.addActionListener(new java.awt.event.ActionListener()\r
135     {\r
136       public void actionPerformed(ActionEvent e)\r
137       {\r
138         epsTree_actionPerformed(e);\r
139       }\r
140     });\r
141     pngTree.setText("PNG");\r
142     pngTree.addActionListener(new java.awt.event.ActionListener()\r
143     {\r
144       public void actionPerformed(ActionEvent e)\r
145       {\r
146         pngTree_actionPerformed(e);\r
147       }\r
148     });\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
154     {\r
155       public void actionPerformed(ActionEvent e)\r
156       {\r
157         placeholdersMenu_actionPerformed(e);\r
158       }\r
159     });\r
160     textbox.setText("Output to Textbox...");\r
161     textbox.addActionListener(new ActionListener()\r
162     {\r
163       public void actionPerformed(ActionEvent e)\r
164       {\r
165         textbox_actionPerformed(e);\r
166       }\r
167     });\r
168     originalSeqData.setText("Input Data...");\r
169     originalSeqData.addActionListener(new ActionListener()\r
170     {\r
171       public void actionPerformed(ActionEvent e)\r
172       {\r
173         originalSeqData_actionPerformed(e);\r
174       }\r
175     });\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
193   }\r
194 \r
195   public void printMenu_actionPerformed(ActionEvent e)\r
196   {\r
197   }\r
198 \r
199   public void font_actionPerformed(ActionEvent e)\r
200   {\r
201   }\r
202 \r
203   public void distanceMenu_actionPerformed(ActionEvent e)\r
204   {\r
205   }\r
206 \r
207   public void bootstrapMenu_actionPerformed(ActionEvent e)\r
208   {\r
209   }\r
210 \r
211   public void fitToWindow_actionPerformed(ActionEvent e)\r
212   {\r
213   }\r
214 \r
215   public void pngTree_actionPerformed(ActionEvent e)\r
216   {\r
217   }\r
218 \r
219   public void epsTree_actionPerformed(ActionEvent e)\r
220   {\r
221   }\r
222 \r
223   public void saveAsNewick_actionPerformed(ActionEvent e)\r
224   {\r
225   }\r
226 \r
227   public void placeholdersMenu_actionPerformed(ActionEvent e)\r
228   {\r
229   }\r
230 \r
231   public void textbox_actionPerformed(ActionEvent e)\r
232   {\r
233   }\r
234 \r
235   public void fullid_actionPerformed(ActionEvent e)\r
236   {\r
237 \r
238   }\r
239 \r
240   public void originalSeqData_actionPerformed(ActionEvent e)\r
241   {\r
242 \r
243   }\r
244 \r
245   public void viewMenu_menuSelected()\r
246   {\r
247   }\r
248 }\r