b492c217e625d457d2b52cdb4b414ecd696c8b0a
[jalview.git] / src / jalview / jbgui / GTreePanel.java
1 /*
2  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.2)
3  * Copyright (C) 2014 The Jalview Authors
4  * 
5  * This file is part of Jalview.
6  * 
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
10  * of the License, or (at your option) any later version.
11  *  
12  * Jalview is distributed in the hope that it will be useful, but 
13  * WITHOUT ANY WARRANTY; without even the implied warranty 
14  * of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
15  * PURPOSE.  See the GNU General Public License for more details.
16  * 
17  * You should have received a copy of the GNU General Public License
18  * along with Jalview.  If not, see <http://www.gnu.org/licenses/>.
19  * The Jalview Authors are detailed in the 'AUTHORS' file.
20  */
21 package jalview.jbgui;
22
23 import jalview.util.MessageManager;
24
25 import java.awt.*;
26 import java.awt.event.*;
27 import javax.swing.*;
28 import javax.swing.event.*;
29
30 public class GTreePanel extends JInternalFrame
31 {
32   BorderLayout borderLayout1 = new BorderLayout();
33
34   public JScrollPane scrollPane = new JScrollPane();
35
36   JMenuBar jMenuBar1 = new JMenuBar();
37
38   JMenu fileMenu = new JMenu();
39
40   JMenuItem saveAsNewick = new JMenuItem();
41
42   JMenuItem printMenu = new JMenuItem();
43
44   protected JMenu viewMenu = new JMenu();
45
46   public JMenuItem font = new JMenuItem();
47
48   public JMenuItem sortAssocViews = new JMenuItem();
49
50   public JCheckBoxMenuItem bootstrapMenu = new JCheckBoxMenuItem();
51
52   public JCheckBoxMenuItem distanceMenu = new JCheckBoxMenuItem();
53
54   public JCheckBoxMenuItem fitToWindow = new JCheckBoxMenuItem();
55
56   public JCheckBoxMenuItem placeholdersMenu = new JCheckBoxMenuItem();
57
58   JMenuItem pngTree = new JMenuItem();
59
60   JMenuItem epsTree = new JMenuItem();
61
62   JMenu saveAsMenu = new JMenu();
63
64   JMenuItem textbox = new JMenuItem();
65
66   public JMenuItem originalSeqData = new JMenuItem();
67
68   protected JMenu associateLeavesMenu = new JMenu();
69
70   public GTreePanel()
71   {
72     try
73     {
74       jbInit();
75       this.setJMenuBar(jMenuBar1);
76     } catch (Exception e)
77     {
78       e.printStackTrace();
79     }
80   }
81
82   private void jbInit() throws Exception
83   {
84     this.getContentPane().setLayout(borderLayout1);
85     this.setBackground(Color.white);
86     this.setFont(new java.awt.Font("Verdana", 0, 12));
87     scrollPane.setOpaque(false);
88     fileMenu.setText(MessageManager.getString("action.file"));
89     saveAsNewick.setText(MessageManager.getString("label.newick_format"));
90     saveAsNewick.addActionListener(new ActionListener()
91     {
92       public void actionPerformed(ActionEvent e)
93       {
94         saveAsNewick_actionPerformed(e);
95       }
96     });
97     printMenu.setText(MessageManager.getString("action.print"));
98     printMenu.addActionListener(new java.awt.event.ActionListener()
99     {
100       public void actionPerformed(ActionEvent e)
101       {
102         printMenu_actionPerformed(e);
103       }
104     });
105     viewMenu.setText(MessageManager.getString("action.view"));
106     viewMenu.addMenuListener(new MenuListener()
107     {
108       public void menuSelected(MenuEvent e)
109       {
110         viewMenu_menuSelected();
111       }
112
113       public void menuDeselected(MenuEvent e)
114       {
115       }
116
117       public void menuCanceled(MenuEvent e)
118       {
119       }
120     });
121     sortAssocViews.setText(MessageManager
122             .getString("label.sort_alignment_by_tree"));
123     sortAssocViews.addActionListener(new java.awt.event.ActionListener()
124     {
125       public void actionPerformed(ActionEvent e)
126       {
127         sortByTree_actionPerformed(e);
128       }
129     });
130     font.setText(MessageManager.getString("action.font"));
131     font.addActionListener(new java.awt.event.ActionListener()
132     {
133       public void actionPerformed(ActionEvent e)
134       {
135         font_actionPerformed(e);
136       }
137     });
138     bootstrapMenu.setText(MessageManager
139             .getString("label.show_bootstrap_values"));
140     bootstrapMenu.addActionListener(new java.awt.event.ActionListener()
141     {
142       public void actionPerformed(ActionEvent e)
143       {
144         bootstrapMenu_actionPerformed(e);
145       }
146     });
147     distanceMenu.setText(MessageManager.getString("label.show_distances"));
148     distanceMenu.addActionListener(new java.awt.event.ActionListener()
149     {
150       public void actionPerformed(ActionEvent e)
151       {
152         distanceMenu_actionPerformed(e);
153       }
154     });
155     fitToWindow.setSelected(true);
156     fitToWindow.setText(MessageManager.getString("label.fit_to_window"));
157     fitToWindow.addActionListener(new java.awt.event.ActionListener()
158     {
159       public void actionPerformed(ActionEvent e)
160       {
161         fitToWindow_actionPerformed(e);
162       }
163     });
164     epsTree.setText("EPS");
165     epsTree.addActionListener(new java.awt.event.ActionListener()
166     {
167       public void actionPerformed(ActionEvent e)
168       {
169         epsTree_actionPerformed(e);
170       }
171     });
172     pngTree.setText("PNG");
173     pngTree.addActionListener(new java.awt.event.ActionListener()
174     {
175       public void actionPerformed(ActionEvent e)
176       {
177         pngTree_actionPerformed(e);
178       }
179     });
180     saveAsMenu.setText(MessageManager.getString("action.save_as"));
181     placeholdersMenu
182             .setToolTipText(MessageManager
183                     .getString("label.marks_leaves_tree_not_associated_with_sequence"));
184     placeholdersMenu.setText(MessageManager
185             .getString("label.mark_unlinked_leaves"));
186     placeholdersMenu.addActionListener(new ActionListener()
187     {
188       public void actionPerformed(ActionEvent e)
189       {
190         placeholdersMenu_actionPerformed(e);
191       }
192     });
193     textbox.setText(MessageManager.getString("label.out_to_textbox")
194             + "...");
195     textbox.addActionListener(new ActionListener()
196     {
197       public void actionPerformed(ActionEvent e)
198       {
199         textbox_actionPerformed(e);
200       }
201     });
202     originalSeqData.setText(MessageManager.getString("label.input_data"));
203     originalSeqData.addActionListener(new ActionListener()
204     {
205       public void actionPerformed(ActionEvent e)
206       {
207         originalSeqData_actionPerformed(e);
208       }
209     });
210     associateLeavesMenu.setText(MessageManager
211             .getString("label.associate_leaves_with"));
212     this.getContentPane().add(scrollPane, BorderLayout.CENTER);
213     jMenuBar1.add(fileMenu);
214     jMenuBar1.add(viewMenu);
215     fileMenu.add(saveAsMenu);
216     fileMenu.add(textbox);
217     fileMenu.add(printMenu);
218     fileMenu.add(originalSeqData);
219     viewMenu.add(fitToWindow);
220     viewMenu.add(font);
221     viewMenu.add(distanceMenu);
222     viewMenu.add(bootstrapMenu);
223     viewMenu.add(placeholdersMenu);
224     viewMenu.add(sortAssocViews);
225     viewMenu.add(associateLeavesMenu);
226     saveAsMenu.add(saveAsNewick);
227     saveAsMenu.add(epsTree);
228     saveAsMenu.add(pngTree);
229   }
230
231   public void printMenu_actionPerformed(ActionEvent e)
232   {
233   }
234
235   public void font_actionPerformed(ActionEvent e)
236   {
237   }
238
239   public void distanceMenu_actionPerformed(ActionEvent e)
240   {
241   }
242
243   public void bootstrapMenu_actionPerformed(ActionEvent e)
244   {
245   }
246
247   public void fitToWindow_actionPerformed(ActionEvent e)
248   {
249   }
250
251   public void pngTree_actionPerformed(ActionEvent e)
252   {
253   }
254
255   public void epsTree_actionPerformed(ActionEvent e)
256   {
257   }
258
259   public void saveAsNewick_actionPerformed(ActionEvent e)
260   {
261   }
262
263   public void placeholdersMenu_actionPerformed(ActionEvent e)
264   {
265   }
266
267   public void textbox_actionPerformed(ActionEvent e)
268   {
269   }
270
271   public void fullid_actionPerformed(ActionEvent e)
272   {
273
274   }
275
276   public void originalSeqData_actionPerformed(ActionEvent e)
277   {
278
279   }
280
281   public void viewMenu_menuSelected()
282   {
283   }
284
285   public void sortByTree_actionPerformed(ActionEvent e)
286   {
287
288   }
289
290 }