JAL-1355 (basic i18n support)
[jalview.git] / src / jalview / jbgui / GPCAPanel.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
25 import javax.swing.*;
26 import javax.swing.event.*;
27
28 public class GPCAPanel extends JInternalFrame
29 {
30   JPanel jPanel2 = new JPanel();
31
32   JLabel jLabel1 = new JLabel();
33
34   JLabel jLabel2 = new JLabel();
35
36   JLabel jLabel3 = new JLabel();
37
38   protected JComboBox xCombobox = new JComboBox();
39
40   protected JComboBox yCombobox = new JComboBox();
41
42   protected JComboBox zCombobox = new JComboBox();
43
44   protected JButton resetButton = new JButton();
45
46   FlowLayout flowLayout1 = new FlowLayout();
47
48   BorderLayout borderLayout1 = new BorderLayout();
49
50   JMenuBar jMenuBar1 = new JMenuBar();
51
52   JMenu fileMenu = new JMenu();
53
54   JMenu saveMenu = new JMenu();
55
56   JMenuItem eps = new JMenuItem();
57
58   JMenuItem png = new JMenuItem();
59
60   JMenuItem print = new JMenuItem();
61
62   JMenuItem outputValues = new JMenuItem();
63
64   JMenuItem outputPoints = new JMenuItem();
65
66   JMenuItem outputProjPoints = new JMenuItem();
67
68   protected JMenu viewMenu = new JMenu();
69
70   protected JCheckBoxMenuItem showLabels = new JCheckBoxMenuItem();
71
72   JMenuItem bgcolour = new JMenuItem();
73
74   JMenuItem originalSeqData = new JMenuItem();
75
76   protected JMenu associateViewsMenu = new JMenu();
77
78   protected JMenu calcSettings = new JMenu();
79
80   protected JCheckBoxMenuItem nuclSetting = new JCheckBoxMenuItem();
81
82   protected JCheckBoxMenuItem protSetting = new JCheckBoxMenuItem();
83
84   protected JCheckBoxMenuItem jvVersionSetting = new JCheckBoxMenuItem();
85
86   protected JLabel statusBar = new JLabel();
87
88   protected GridLayout statusPanelLayout = new GridLayout();
89
90   protected JPanel statusPanel = new JPanel();
91
92   public GPCAPanel()
93   {
94     try
95     {
96       jbInit();
97     } catch (Exception e)
98     {
99       e.printStackTrace();
100     }
101
102     for (int i = 1; i < 8; i++)
103     {
104       xCombobox.addItem("dim " + i);
105       yCombobox.addItem("dim " + i);
106       zCombobox.addItem("dim " + i);
107     }
108
109     setJMenuBar(jMenuBar1);
110   }
111
112   private void jbInit() throws Exception
113   {
114     this.getContentPane().setLayout(borderLayout1);
115     jPanel2.setLayout(flowLayout1);
116     jLabel1.setFont(new java.awt.Font("Verdana", 0, 12));
117     jLabel1.setText("x=");
118     jLabel2.setFont(new java.awt.Font("Verdana", 0, 12));
119     jLabel2.setText("y=");
120     jLabel3.setFont(new java.awt.Font("Verdana", 0, 12));
121     jLabel3.setText("z=");
122     jPanel2.setBackground(Color.white);
123     jPanel2.setBorder(null);
124     zCombobox.setFont(new java.awt.Font("Verdana", 0, 12));
125     zCombobox.addActionListener(new java.awt.event.ActionListener()
126     {
127       public void actionPerformed(ActionEvent e)
128       {
129         zCombobox_actionPerformed(e);
130       }
131     });
132     yCombobox.setFont(new java.awt.Font("Verdana", 0, 12));
133     yCombobox.addActionListener(new java.awt.event.ActionListener()
134     {
135       public void actionPerformed(ActionEvent e)
136       {
137         yCombobox_actionPerformed(e);
138       }
139     });
140     xCombobox.setFont(new java.awt.Font("Verdana", 0, 12));
141     xCombobox.addActionListener(new java.awt.event.ActionListener()
142     {
143       public void actionPerformed(ActionEvent e)
144       {
145         xCombobox_actionPerformed(e);
146       }
147     });
148     resetButton.setFont(new java.awt.Font("Verdana", 0, 12));
149     resetButton.setText(MessageManager.getString("action.reset"));
150     resetButton.addActionListener(new java.awt.event.ActionListener()
151     {
152       @Override
153       public void actionPerformed(ActionEvent e)
154       {
155         resetButton_actionPerformed(e);
156       }
157     });
158     fileMenu.setText(MessageManager.getString("action.file"));
159     saveMenu.setText(MessageManager.getString("action.save_as"));
160     eps.setText("EPS");
161     eps.addActionListener(new ActionListener()
162     {
163       public void actionPerformed(ActionEvent e)
164       {
165         eps_actionPerformed(e);
166       }
167     });
168     png.setText("PNG");
169     png.addActionListener(new ActionListener()
170     {
171       public void actionPerformed(ActionEvent e)
172       {
173         png_actionPerformed(e);
174       }
175     });
176     outputValues.setText(MessageManager.getString("label.output_values"));
177     outputValues.addActionListener(new ActionListener()
178     {
179       public void actionPerformed(ActionEvent e)
180       {
181         outputValues_actionPerformed(e);
182       }
183     });
184     outputPoints.setText(MessageManager.getString("label.output_points"));
185     outputPoints.addActionListener(new ActionListener()
186     {
187       public void actionPerformed(ActionEvent e)
188       {
189         outputPoints_actionPerformed(e);
190       }
191     });
192     outputProjPoints.setText(MessageManager.getString("label.output_transformed_points") + "...");
193     outputProjPoints.addActionListener(new ActionListener()
194     {
195       public void actionPerformed(ActionEvent e)
196       {
197         outputProjPoints_actionPerformed(e);
198       }
199     });
200     print.addActionListener(new ActionListener()
201     {
202       public void actionPerformed(ActionEvent e)
203       {
204         print_actionPerformed(e);
205       }
206     });
207     viewMenu.setText(MessageManager.getString("aciton.view"));
208     viewMenu.addMenuListener(new MenuListener()
209     {
210       public void menuSelected(MenuEvent e)
211       {
212         viewMenu_menuSelected();
213       }
214
215       public void menuDeselected(MenuEvent e)
216       {
217       }
218
219       public void menuCanceled(MenuEvent e)
220       {
221       }
222     });
223     showLabels.setText(MessageManager.getString("label.show_labels"));
224     showLabels.addActionListener(new ActionListener()
225     {
226       public void actionPerformed(ActionEvent e)
227       {
228         showLabels_actionPerformed(e);
229       }
230     });
231     print.setText(MessageManager.getString("action.print"));
232     bgcolour.setText(MessageManager.getString("label.background_colour") + "...");
233     bgcolour.addActionListener(new ActionListener()
234     {
235       public void actionPerformed(ActionEvent e)
236       {
237         bgcolour_actionPerformed(e);
238       }
239     });
240     originalSeqData.setText(MessageManager.getString("label.input_data"));
241     originalSeqData.addActionListener(new ActionListener()
242     {
243       public void actionPerformed(ActionEvent e)
244       {
245         originalSeqData_actionPerformed(e);
246       }
247     });
248     associateViewsMenu.setText(MessageManager.getString("label.associate_nodes_with"));
249     calcSettings.setText(MessageManager.getString("action.change_params"));
250     nuclSetting.setText(MessageManager.getString("label.nucleotide_matrix"));
251     protSetting.setText(MessageManager.getString("label.protein_matrix"));
252     nuclSetting.addActionListener(new ActionListener()
253     {
254
255       @Override
256       public void actionPerformed(ActionEvent arg0)
257       {
258         nuclSetting_actionPerfomed(arg0);
259       }
260     });
261     protSetting.addActionListener(new ActionListener()
262     {
263
264       @Override
265       public void actionPerformed(ActionEvent arg0)
266       {
267         protSetting_actionPerfomed(arg0);
268       }
269     });
270     jvVersionSetting.setText(MessageManager.getString("label.jalview_pca_calculation"));
271     jvVersionSetting.addActionListener(new ActionListener()
272     {
273       @Override
274       public void actionPerformed(ActionEvent arg0)
275       {
276         jvVersionSetting_actionPerfomed(arg0);
277       }
278     });
279     calcSettings.add(jvVersionSetting);
280     calcSettings.add(nuclSetting);
281     calcSettings.add(protSetting);
282     statusPanel.setLayout(statusPanelLayout);
283     statusBar.setFont(new java.awt.Font("Verdana", 0, 12));
284     // statusPanel.setBackground(Color.lightGray);
285     // statusBar.setBackground(Color.lightGray);
286     // statusPanel.add(statusBar, null);
287     JPanel panelBar = new JPanel(new BorderLayout());
288     panelBar.add(jPanel2, BorderLayout.NORTH);
289     panelBar.add(statusPanel, BorderLayout.SOUTH);
290     this.getContentPane().add(panelBar, BorderLayout.SOUTH);
291     jPanel2.add(jLabel1, null);
292     jPanel2.add(xCombobox, null);
293     jPanel2.add(jLabel2, null);
294     jPanel2.add(yCombobox, null);
295     jPanel2.add(jLabel3, null);
296     jPanel2.add(zCombobox, null);
297     jPanel2.add(resetButton, null);
298     jMenuBar1.add(fileMenu);
299     jMenuBar1.add(viewMenu);
300     jMenuBar1.add(calcSettings);
301     fileMenu.add(saveMenu);
302     fileMenu.add(outputValues);
303     fileMenu.add(print);
304     fileMenu.add(originalSeqData);
305     fileMenu.add(outputPoints);
306     fileMenu.add(outputProjPoints);
307     saveMenu.add(eps);
308     saveMenu.add(png);
309     viewMenu.add(showLabels);
310     viewMenu.add(bgcolour);
311     viewMenu.add(associateViewsMenu);
312   }
313
314   protected void resetButton_actionPerformed(ActionEvent e)
315   {
316     // TODO Auto-generated method stub
317
318   }
319
320   protected void protSetting_actionPerfomed(ActionEvent arg0)
321   {
322     // TODO Auto-generated method stub
323
324   }
325
326   protected void nuclSetting_actionPerfomed(ActionEvent arg0)
327   {
328     // TODO Auto-generated method stub
329
330   }
331
332   protected void outputPoints_actionPerformed(ActionEvent e)
333   {
334     // TODO Auto-generated method stub
335
336   }
337
338   protected void outputProjPoints_actionPerformed(ActionEvent e)
339   {
340     // TODO Auto-generated method stub
341
342   }
343
344   protected void xCombobox_actionPerformed(ActionEvent e)
345   {
346   }
347
348   protected void yCombobox_actionPerformed(ActionEvent e)
349   {
350   }
351
352   protected void zCombobox_actionPerformed(ActionEvent e)
353   {
354   }
355
356   public void eps_actionPerformed(ActionEvent e)
357   {
358
359   }
360
361   public void png_actionPerformed(ActionEvent e)
362   {
363
364   }
365
366   public void outputValues_actionPerformed(ActionEvent e)
367   {
368
369   }
370
371   public void print_actionPerformed(ActionEvent e)
372   {
373
374   }
375
376   public void showLabels_actionPerformed(ActionEvent e)
377   {
378
379   }
380
381   public void bgcolour_actionPerformed(ActionEvent e)
382   {
383
384   }
385
386   public void originalSeqData_actionPerformed(ActionEvent e)
387   {
388
389   }
390
391   public void viewMenu_menuSelected()
392   {
393
394   }
395
396   protected void jvVersionSetting_actionPerfomed(ActionEvent arg0)
397   {
398     // TODO Auto-generated method stub
399
400   }
401 }