JAL-1517 fix copyright for 2.8.2
[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.getString("label.output_transformed_points") + "...");
198     outputProjPoints.addActionListener(new ActionListener()
199     {
200       public void actionPerformed(ActionEvent e)
201       {
202         outputProjPoints_actionPerformed(e);
203       }
204     });
205     print.addActionListener(new ActionListener()
206     {
207       public void actionPerformed(ActionEvent e)
208       {
209         print_actionPerformed(e);
210       }
211     });
212     viewMenu.setText(MessageManager.getString("action.view"));
213     viewMenu.addMenuListener(new MenuListener()
214     {
215       public void menuSelected(MenuEvent e)
216       {
217         viewMenu_menuSelected();
218       }
219
220       public void menuDeselected(MenuEvent e)
221       {
222       }
223
224       public void menuCanceled(MenuEvent e)
225       {
226       }
227     });
228     scoreMatrixMenu.setText(MessageManager.getString("label.select_score_model"));
229     scoreMatrixMenu.addMenuListener(new MenuListener()
230     {
231       public void menuSelected(MenuEvent e)
232       {
233         scoreMatrix_menuSelected();
234       }
235
236       public void menuDeselected(MenuEvent e)
237       {
238       }
239
240       public void menuCanceled(MenuEvent e)
241       {
242       }
243     });
244     showLabels.setText(MessageManager.getString("label.show_labels"));
245     showLabels.addActionListener(new ActionListener()
246     {
247       public void actionPerformed(ActionEvent e)
248       {
249         showLabels_actionPerformed(e);
250       }
251     });
252     print.setText(MessageManager.getString("action.print"));
253     bgcolour.setText(MessageManager.getString("label.background_colour") + "...");
254     bgcolour.addActionListener(new ActionListener()
255     {
256       public void actionPerformed(ActionEvent e)
257       {
258         bgcolour_actionPerformed(e);
259       }
260     });
261     originalSeqData.setText(MessageManager.getString("label.input_data"));
262     originalSeqData.addActionListener(new ActionListener()
263     {
264       public void actionPerformed(ActionEvent e)
265       {
266         originalSeqData_actionPerformed(e);
267       }
268     });
269     associateViewsMenu.setText(MessageManager.getString("label.associate_nodes_with"));
270     calcSettings.setText(MessageManager.getString("action.change_params"));
271     nuclSetting.setText(MessageManager.getString("label.nucleotide_matrix"));
272     protSetting.setText(MessageManager.getString("label.protein_matrix"));
273     nuclSetting.addActionListener(new ActionListener()
274     {
275
276       @Override
277       public void actionPerformed(ActionEvent arg0)
278       {
279         nuclSetting_actionPerfomed(arg0);
280       }
281     });
282     protSetting.addActionListener(new ActionListener()
283     {
284
285       @Override
286       public void actionPerformed(ActionEvent arg0)
287       {
288         protSetting_actionPerfomed(arg0);
289       }
290     });
291     jvVersionSetting.setText(MessageManager.getString("label.jalview_pca_calculation"));
292     jvVersionSetting.addActionListener(new ActionListener()
293     {
294       @Override
295       public void actionPerformed(ActionEvent arg0)
296       {
297         jvVersionSetting_actionPerfomed(arg0);
298       }
299     });
300     calcSettings.add(jvVersionSetting);
301     calcSettings.add(nuclSetting);
302     calcSettings.add(protSetting);
303     calcSettings.add(scoreMatrixMenu);
304     statusPanel.setLayout(statusPanelLayout);
305     statusBar.setFont(new java.awt.Font("Verdana", 0, 12));
306     // statusPanel.setBackground(Color.lightGray);
307     // statusBar.setBackground(Color.lightGray);
308     // statusPanel.add(statusBar, null);
309     JPanel panelBar = new JPanel(new BorderLayout());
310     panelBar.add(jPanel2, BorderLayout.NORTH);
311     panelBar.add(statusPanel, BorderLayout.SOUTH);
312     this.getContentPane().add(panelBar, BorderLayout.SOUTH);
313     jPanel2.add(jLabel1, null);
314     jPanel2.add(xCombobox, null);
315     jPanel2.add(jLabel2, null);
316     jPanel2.add(yCombobox, null);
317     jPanel2.add(jLabel3, null);
318     jPanel2.add(zCombobox, null);
319     jPanel2.add(resetButton, null);
320     jMenuBar1.add(fileMenu);
321     jMenuBar1.add(viewMenu);
322     jMenuBar1.add(calcSettings);
323     fileMenu.add(saveMenu);
324     fileMenu.add(outputValues);
325     fileMenu.add(print);
326     fileMenu.add(originalSeqData);
327     fileMenu.add(outputPoints);
328     fileMenu.add(outputProjPoints);
329     saveMenu.add(eps);
330     saveMenu.add(png);
331     viewMenu.add(showLabels);
332     viewMenu.add(bgcolour);
333     viewMenu.add(associateViewsMenu);
334   }
335
336   protected void scoreMatrix_menuSelected()
337   {
338     // TODO Auto-generated method stub
339     
340   }
341
342   protected void resetButton_actionPerformed(ActionEvent e)
343   {
344     // TODO Auto-generated method stub
345
346   }
347
348   protected void protSetting_actionPerfomed(ActionEvent arg0)
349   {
350     // TODO Auto-generated method stub
351
352   }
353
354   protected void nuclSetting_actionPerfomed(ActionEvent arg0)
355   {
356     // TODO Auto-generated method stub
357
358   }
359
360   protected void outputPoints_actionPerformed(ActionEvent e)
361   {
362     // TODO Auto-generated method stub
363
364   }
365
366   protected void outputProjPoints_actionPerformed(ActionEvent e)
367   {
368     // TODO Auto-generated method stub
369
370   }
371
372   protected void xCombobox_actionPerformed(ActionEvent e)
373   {
374   }
375
376   protected void yCombobox_actionPerformed(ActionEvent e)
377   {
378   }
379
380   protected void zCombobox_actionPerformed(ActionEvent e)
381   {
382   }
383
384   public void eps_actionPerformed(ActionEvent e)
385   {
386
387   }
388
389   public void png_actionPerformed(ActionEvent e)
390   {
391
392   }
393
394   public void outputValues_actionPerformed(ActionEvent e)
395   {
396
397   }
398
399   public void print_actionPerformed(ActionEvent e)
400   {
401
402   }
403
404   public void showLabels_actionPerformed(ActionEvent e)
405   {
406
407   }
408
409   public void bgcolour_actionPerformed(ActionEvent e)
410   {
411
412   }
413
414   public void originalSeqData_actionPerformed(ActionEvent e)
415   {
416
417   }
418
419   public void viewMenu_menuSelected()
420   {
421
422   }
423
424   protected void jvVersionSetting_actionPerfomed(ActionEvent arg0)
425   {
426     // TODO Auto-generated method stub
427
428   }
429 }