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