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