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