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