JAL-1013 - toy menu to switch between nucleotide and blosum 62 modes of calculation...
[jalview.git] / src / jalview / jbgui / GPCAPanel.java
1 /*
2  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
3  * Copyright (C) 2011 J Procter, AM Waterhouse, 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   FlowLayout flowLayout1 = new FlowLayout();
43
44   BorderLayout borderLayout1 = new BorderLayout();
45
46   JMenuBar jMenuBar1 = new JMenuBar();
47
48   JMenu fileMenu = new JMenu();
49
50   JMenu saveMenu = new JMenu();
51
52   JMenuItem eps = new JMenuItem();
53
54   JMenuItem png = new JMenuItem();
55
56   JMenuItem print = new JMenuItem();
57
58   JMenuItem outputValues = new JMenuItem();
59
60   JMenuItem outputPoints = new JMenuItem();
61
62   JMenuItem outputProjPoints = new JMenuItem();
63
64   protected JMenu viewMenu = new JMenu();
65
66   protected JCheckBoxMenuItem showLabels = new JCheckBoxMenuItem();
67
68   JMenuItem bgcolour = new JMenuItem();
69
70   JMenuItem originalSeqData = new JMenuItem();
71
72   protected JMenu associateViewsMenu = new JMenu();
73
74   protected JMenu calcSettings=new JMenu();
75   JMenuItem nuclSetting=new JMenuItem();
76   JMenuItem protSetting=new JMenuItem();
77   public GPCAPanel()
78   {
79     try
80     {
81       jbInit();
82     } catch (Exception e)
83     {
84       e.printStackTrace();
85     }
86
87     for (int i = 1; i < 8; i++)
88     {
89       xCombobox.addItem("dim " + i);
90       yCombobox.addItem("dim " + i);
91       zCombobox.addItem("dim " + i);
92     }
93
94     setJMenuBar(jMenuBar1);
95   }
96
97   private void jbInit() throws Exception
98   {
99     this.getContentPane().setLayout(borderLayout1);
100     jPanel2.setLayout(flowLayout1);
101     jLabel1.setFont(new java.awt.Font("Verdana", 0, 12));
102     jLabel1.setText("x=");
103     jLabel2.setFont(new java.awt.Font("Verdana", 0, 12));
104     jLabel2.setText("y=");
105     jLabel3.setFont(new java.awt.Font("Verdana", 0, 12));
106     jLabel3.setText("z=");
107     jPanel2.setBackground(Color.white);
108     jPanel2.setBorder(null);
109     zCombobox.setFont(new java.awt.Font("Verdana", 0, 12));
110     zCombobox.addActionListener(new java.awt.event.ActionListener()
111     {
112       public void actionPerformed(ActionEvent e)
113       {
114         zCombobox_actionPerformed(e);
115       }
116     });
117     yCombobox.setFont(new java.awt.Font("Verdana", 0, 12));
118     yCombobox.addActionListener(new java.awt.event.ActionListener()
119     {
120       public void actionPerformed(ActionEvent e)
121       {
122         yCombobox_actionPerformed(e);
123       }
124     });
125     xCombobox.setFont(new java.awt.Font("Verdana", 0, 12));
126     xCombobox.addActionListener(new java.awt.event.ActionListener()
127     {
128       public void actionPerformed(ActionEvent e)
129       {
130         xCombobox_actionPerformed(e);
131       }
132     });
133     fileMenu.setText("File");
134     saveMenu.setText("Save as");
135     eps.setText("EPS");
136     eps.addActionListener(new ActionListener()
137     {
138       public void actionPerformed(ActionEvent e)
139       {
140         eps_actionPerformed(e);
141       }
142     });
143     png.setText("PNG");
144     png.addActionListener(new ActionListener()
145     {
146       public void actionPerformed(ActionEvent e)
147       {
148         png_actionPerformed(e);
149       }
150     });
151     outputValues.setText("Output Values...");
152     outputValues.addActionListener(new ActionListener()
153     {
154       public void actionPerformed(ActionEvent e)
155       {
156         outputValues_actionPerformed(e);
157       }
158     });
159     outputPoints.setText("Output points...");
160     outputPoints.addActionListener(new ActionListener()
161     {
162       public void actionPerformed(ActionEvent e)
163       {
164         outputPoints_actionPerformed(e);
165       }
166     });
167     outputProjPoints.setText("Output transformed points...");
168     outputProjPoints.addActionListener(new ActionListener()
169     {
170       public void actionPerformed(ActionEvent e)
171       {
172         outputProjPoints_actionPerformed(e);
173       }
174     });
175     print.addActionListener(new ActionListener()
176     {
177       public void actionPerformed(ActionEvent e)
178       {
179         print_actionPerformed(e);
180       }
181     });
182     viewMenu.setText("View");
183     viewMenu.addMenuListener(new MenuListener()
184     {
185       public void menuSelected(MenuEvent e)
186       {
187         viewMenu_menuSelected();
188       }
189
190       public void menuDeselected(MenuEvent e)
191       {
192       }
193
194       public void menuCanceled(MenuEvent e)
195       {
196       }
197     });
198     showLabels.setText("Show Labels");
199     showLabels.addActionListener(new ActionListener()
200     {
201       public void actionPerformed(ActionEvent e)
202       {
203         showLabels_actionPerformed(e);
204       }
205     });
206     print.setText("Print");
207     bgcolour.setText("Background Colour...");
208     bgcolour.addActionListener(new ActionListener()
209     {
210       public void actionPerformed(ActionEvent e)
211       {
212         bgcolour_actionPerformed(e);
213       }
214     });
215     originalSeqData.setText("Input Data...");
216     originalSeqData.addActionListener(new ActionListener()
217     {
218       public void actionPerformed(ActionEvent e)
219       {
220         originalSeqData_actionPerformed(e);
221       }
222     });
223     associateViewsMenu.setText("Associate Nodes With");
224     calcSettings.setText("Change Parameters");
225     nuclSetting.setText("Nucleotide matrix");
226     protSetting.setText("Protein matrix");
227     nuclSetting.addActionListener(new ActionListener()
228     {
229       
230       @Override
231       public void actionPerformed(ActionEvent arg0)
232       {
233         nuclSetting_actionPerfomed(arg0);
234       }
235     });
236     protSetting.addActionListener(new ActionListener()
237     {
238       
239       @Override
240       public void actionPerformed(ActionEvent arg0)
241       {
242         protSetting_actionPerfomed(arg0);
243       }
244     });calcSettings.add(nuclSetting);
245     calcSettings.add(protSetting);
246     
247     
248     this.getContentPane().add(jPanel2, BorderLayout.SOUTH);
249     jPanel2.add(jLabel1, null);
250     jPanel2.add(xCombobox, null);
251     jPanel2.add(jLabel2, null);
252     jPanel2.add(yCombobox, null);
253     jPanel2.add(jLabel3, null);
254     jPanel2.add(zCombobox, null);
255     jMenuBar1.add(fileMenu);
256     jMenuBar1.add(viewMenu);
257     jMenuBar1.add(calcSettings);
258     fileMenu.add(saveMenu);
259     fileMenu.add(outputValues);
260     fileMenu.add(print);
261     fileMenu.add(originalSeqData);
262     fileMenu.add(outputPoints);
263     fileMenu.add(outputProjPoints);
264     saveMenu.add(eps);
265     saveMenu.add(png);
266     viewMenu.add(showLabels);
267     viewMenu.add(bgcolour);
268     viewMenu.add(associateViewsMenu);
269   }
270
271   protected void protSetting_actionPerfomed(ActionEvent arg0)
272   {
273     // TODO Auto-generated method stub
274     
275   }
276
277   protected void nuclSetting_actionPerfomed(ActionEvent arg0)
278   {
279     // TODO Auto-generated method stub
280     
281   }
282
283   protected void outputPoints_actionPerformed(ActionEvent e)
284   {
285     // TODO Auto-generated method stub
286
287   }
288
289   protected void outputProjPoints_actionPerformed(ActionEvent e)
290   {
291     // TODO Auto-generated method stub
292
293   }
294
295   protected void xCombobox_actionPerformed(ActionEvent e)
296   {
297   }
298
299   protected void yCombobox_actionPerformed(ActionEvent e)
300   {
301   }
302
303   protected void zCombobox_actionPerformed(ActionEvent e)
304   {
305   }
306
307   public void eps_actionPerformed(ActionEvent e)
308   {
309
310   }
311
312   public void png_actionPerformed(ActionEvent e)
313   {
314
315   }
316
317   public void outputValues_actionPerformed(ActionEvent e)
318   {
319
320   }
321
322   public void print_actionPerformed(ActionEvent e)
323   {
324
325   }
326
327   public void showLabels_actionPerformed(ActionEvent e)
328   {
329
330   }
331
332   public void bgcolour_actionPerformed(ActionEvent e)
333   {
334
335   }
336
337   public void originalSeqData_actionPerformed(ActionEvent e)
338   {
339
340   }
341
342   public void viewMenu_menuSelected()
343   {
344
345   }
346 }