JAL-4034 fix 1 - reword button
[jalview.git] / src / jalview / jbgui / GTreePanel.java
1 /*
2  * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
3  * Copyright (C) $$Year-Rel$$ 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.ImageMaker.TYPE;
24 import jalview.util.MessageManager;
25
26 import java.awt.BorderLayout;
27 import java.awt.Color;
28 import java.awt.event.ActionEvent;
29 import java.awt.event.ActionListener;
30
31 import javax.swing.JCheckBoxMenuItem;
32 import javax.swing.JInternalFrame;
33 import javax.swing.JMenu;
34 import javax.swing.JMenuBar;
35 import javax.swing.JMenuItem;
36 import javax.swing.JScrollPane;
37 import javax.swing.event.MenuEvent;
38 import javax.swing.event.MenuListener;
39
40 @SuppressWarnings("serial")
41 public class GTreePanel extends JInternalFrame
42 {
43   BorderLayout borderLayout1 = new BorderLayout();
44
45   public JScrollPane scrollPane = new JScrollPane();
46
47   JMenuBar jMenuBar1 = new JMenuBar();
48
49   JMenu fileMenu = new JMenu();
50
51   JMenuItem saveAsNewick = new JMenuItem();
52
53   JMenuItem printMenu = new JMenuItem();
54
55   protected JMenu viewMenu = new JMenu();
56
57   public JMenuItem font = new JMenuItem();
58
59   public JMenuItem sortAssocViews = new JMenuItem();
60
61   public JCheckBoxMenuItem bootstrapMenu = new JCheckBoxMenuItem();
62
63   public JCheckBoxMenuItem distanceMenu = new JCheckBoxMenuItem();
64
65   public JCheckBoxMenuItem fitToWindow = new JCheckBoxMenuItem();
66
67   public JCheckBoxMenuItem placeholdersMenu = new JCheckBoxMenuItem();
68
69   JMenuItem pngTree = new JMenuItem();
70
71   JMenuItem epsTree = new JMenuItem();
72
73   JMenu saveAsMenu = new JMenu();
74
75   JMenuItem textbox = new JMenuItem();
76
77   public JMenuItem originalSeqData = new JMenuItem();
78
79   protected JMenu associateLeavesMenu = new JMenu();
80
81   public GTreePanel()
82   {
83     try
84     {
85       jbInit();
86       this.setJMenuBar(jMenuBar1);
87     } catch (Exception e)
88     {
89       e.printStackTrace();
90     }
91   }
92
93   private void jbInit() throws Exception
94   {
95     setName("jalview-tree");
96     this.getContentPane().setLayout(borderLayout1);
97     this.setBackground(Color.white);
98     this.setFont(new java.awt.Font("Verdana", 0, 12));
99     scrollPane.setOpaque(false);
100     fileMenu.setText(MessageManager.getString("action.file"));
101     saveAsNewick.setText(MessageManager.getString("label.newick_format"));
102     saveAsNewick.addActionListener(new ActionListener()
103     {
104       @Override
105       public void actionPerformed(ActionEvent e)
106       {
107         saveAsNewick_actionPerformed(e);
108       }
109     });
110     printMenu.setText(MessageManager.getString("action.print"));
111     printMenu.addActionListener(new java.awt.event.ActionListener()
112     {
113       @Override
114       public void actionPerformed(ActionEvent e)
115       {
116         printMenu_actionPerformed(e);
117       }
118     });
119     viewMenu.setText(MessageManager.getString("action.view"));
120     viewMenu.addMenuListener(new MenuListener()
121     {
122       @Override
123       public void menuSelected(MenuEvent e)
124       {
125         viewMenu_menuSelected();
126       }
127
128       @Override
129       public void menuDeselected(MenuEvent e)
130       {
131       }
132
133       @Override
134       public void menuCanceled(MenuEvent e)
135       {
136       }
137     });
138     sortAssocViews.setText(
139             MessageManager.getString("label.sort_alignment_by_tree"));
140     sortAssocViews.addActionListener(new java.awt.event.ActionListener()
141     {
142       @Override
143       public void actionPerformed(ActionEvent e)
144       {
145         sortByTree_actionPerformed();
146       }
147     });
148     font.setText(MessageManager.getString("action.font"));
149     font.addActionListener(new java.awt.event.ActionListener()
150     {
151       @Override
152       public void actionPerformed(ActionEvent e)
153       {
154         font_actionPerformed(e);
155       }
156     });
157     bootstrapMenu.setText(
158             MessageManager.getString("label.show_bootstrap_values"));
159     bootstrapMenu.addActionListener(new java.awt.event.ActionListener()
160     {
161       @Override
162       public void actionPerformed(ActionEvent e)
163       {
164         bootstrapMenu_actionPerformed(e);
165       }
166     });
167     distanceMenu.setText(MessageManager.getString("label.show_distances"));
168     distanceMenu.addActionListener(new java.awt.event.ActionListener()
169     {
170       @Override
171       public void actionPerformed(ActionEvent e)
172       {
173         distanceMenu_actionPerformed(e);
174       }
175     });
176     fitToWindow.setSelected(true);
177     fitToWindow.setText(MessageManager.getString("label.fit_to_window"));
178     fitToWindow.addActionListener(new java.awt.event.ActionListener()
179     {
180       @Override
181       public void actionPerformed(ActionEvent e)
182       {
183         fitToWindow_actionPerformed(e);
184       }
185     });
186     epsTree.setText("EPS");
187     epsTree.addActionListener(new java.awt.event.ActionListener()
188     {
189       @Override
190       public void actionPerformed(ActionEvent e)
191       {
192         writeTreeImage(TYPE.EPS);
193       }
194     });
195     pngTree.setText("PNG");
196     pngTree.addActionListener(new java.awt.event.ActionListener()
197     {
198       @Override
199       public void actionPerformed(ActionEvent e)
200       {
201         writeTreeImage(TYPE.PNG);
202       }
203     });
204     saveAsMenu.setText(MessageManager.getString("action.save_as"));
205     placeholdersMenu.setToolTipText(MessageManager.getString(
206             "label.marks_leaves_tree_not_associated_with_sequence"));
207     placeholdersMenu.setText(
208             MessageManager.getString("label.mark_unlinked_leaves"));
209     placeholdersMenu.addActionListener(new ActionListener()
210     {
211       @Override
212       public void actionPerformed(ActionEvent e)
213       {
214         placeholdersMenu_actionPerformed(e);
215       }
216     });
217     textbox.setText(MessageManager.getString("label.out_to_textbox"));
218     textbox.addActionListener(new ActionListener()
219     {
220       @Override
221       public void actionPerformed(ActionEvent e)
222       {
223         textbox_actionPerformed(e);
224       }
225     });
226     originalSeqData.setText(MessageManager.getString("label.input_data"));
227     originalSeqData.addActionListener(new ActionListener()
228     {
229       @Override
230       public void actionPerformed(ActionEvent e)
231       {
232         originalSeqData_actionPerformed(e);
233       }
234     });
235     associateLeavesMenu.setText(
236             MessageManager.getString("label.associate_leaves_with"));
237     this.getContentPane().add(scrollPane, BorderLayout.CENTER);
238     jMenuBar1.add(fileMenu);
239     jMenuBar1.add(viewMenu);
240     fileMenu.add(saveAsMenu);
241     fileMenu.add(textbox);
242     fileMenu.add(printMenu);
243     fileMenu.add(originalSeqData);
244     viewMenu.add(fitToWindow);
245     viewMenu.add(font);
246     viewMenu.add(distanceMenu);
247     viewMenu.add(bootstrapMenu);
248     viewMenu.add(placeholdersMenu);
249     viewMenu.add(sortAssocViews);
250     viewMenu.add(associateLeavesMenu);
251     saveAsMenu.add(saveAsNewick);
252     saveAsMenu.add(epsTree);
253     saveAsMenu.add(pngTree);
254   }
255
256   public void printMenu_actionPerformed(ActionEvent e)
257   {
258   }
259
260   public void font_actionPerformed(ActionEvent e)
261   {
262   }
263
264   public void distanceMenu_actionPerformed(ActionEvent e)
265   {
266   }
267
268   public void bootstrapMenu_actionPerformed(ActionEvent e)
269   {
270   }
271
272   public void fitToWindow_actionPerformed(ActionEvent e)
273   {
274   }
275
276   public void writeTreeImage(TYPE imageType)
277   {
278   }
279
280   public void saveAsNewick_actionPerformed(ActionEvent e)
281   {
282   }
283
284   public void placeholdersMenu_actionPerformed(ActionEvent e)
285   {
286   }
287
288   public void textbox_actionPerformed(ActionEvent e)
289   {
290   }
291
292   public void fullid_actionPerformed(ActionEvent e)
293   {
294
295   }
296
297   public void originalSeqData_actionPerformed(ActionEvent e)
298   {
299
300   }
301
302   public void viewMenu_menuSelected()
303   {
304   }
305
306   public void sortByTree_actionPerformed()
307   {
308
309   }
310
311 }