patch for JAL-1121 - reset button and slightly wider default window size
[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, J Engelhardt, LM Lui, 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   protected JCheckBoxMenuItem nuclSetting=new JCheckBoxMenuItem();
78   protected JCheckBoxMenuItem protSetting=new JCheckBoxMenuItem();
79   public GPCAPanel()
80   {
81     try
82     {
83       jbInit();
84     } catch (Exception e)
85     {
86       e.printStackTrace();
87     }
88
89     for (int i = 1; i < 8; i++)
90     {
91       xCombobox.addItem("dim " + i);
92       yCombobox.addItem("dim " + i);
93       zCombobox.addItem("dim " + i);
94     }
95
96     setJMenuBar(jMenuBar1);
97   }
98
99   private void jbInit() throws Exception
100   {
101     this.getContentPane().setLayout(borderLayout1);
102     jPanel2.setLayout(flowLayout1);
103     jLabel1.setFont(new java.awt.Font("Verdana", 0, 12));
104     jLabel1.setText("x=");
105     jLabel2.setFont(new java.awt.Font("Verdana", 0, 12));
106     jLabel2.setText("y=");
107     jLabel3.setFont(new java.awt.Font("Verdana", 0, 12));
108     jLabel3.setText("z=");
109     jPanel2.setBackground(Color.white);
110     jPanel2.setBorder(null);
111     zCombobox.setFont(new java.awt.Font("Verdana", 0, 12));
112     zCombobox.addActionListener(new java.awt.event.ActionListener()
113     {
114       public void actionPerformed(ActionEvent e)
115       {
116         zCombobox_actionPerformed(e);
117       }
118     });
119     yCombobox.setFont(new java.awt.Font("Verdana", 0, 12));
120     yCombobox.addActionListener(new java.awt.event.ActionListener()
121     {
122       public void actionPerformed(ActionEvent e)
123       {
124         yCombobox_actionPerformed(e);
125       }
126     });
127     xCombobox.setFont(new java.awt.Font("Verdana", 0, 12));
128     xCombobox.addActionListener(new java.awt.event.ActionListener()
129     {
130       public void actionPerformed(ActionEvent e)
131       {
132         xCombobox_actionPerformed(e);
133       }
134     });
135     resetButton.setFont(new java.awt.Font("Verdana",0,12));
136     resetButton.setText("Reset");
137     resetButton.addActionListener(new java.awt.event.ActionListener()
138     {
139       @Override
140       public void actionPerformed(ActionEvent e)
141       {
142         resetButton_actionPerformed(e);
143       }
144     });
145     fileMenu.setText("File");
146     saveMenu.setText("Save as");
147     eps.setText("EPS");
148     eps.addActionListener(new ActionListener()
149     {
150       public void actionPerformed(ActionEvent e)
151       {
152         eps_actionPerformed(e);
153       }
154     });
155     png.setText("PNG");
156     png.addActionListener(new ActionListener()
157     {
158       public void actionPerformed(ActionEvent e)
159       {
160         png_actionPerformed(e);
161       }
162     });
163     outputValues.setText("Output Values...");
164     outputValues.addActionListener(new ActionListener()
165     {
166       public void actionPerformed(ActionEvent e)
167       {
168         outputValues_actionPerformed(e);
169       }
170     });
171     outputPoints.setText("Output points...");
172     outputPoints.addActionListener(new ActionListener()
173     {
174       public void actionPerformed(ActionEvent e)
175       {
176         outputPoints_actionPerformed(e);
177       }
178     });
179     outputProjPoints.setText("Output transformed points...");
180     outputProjPoints.addActionListener(new ActionListener()
181     {
182       public void actionPerformed(ActionEvent e)
183       {
184         outputProjPoints_actionPerformed(e);
185       }
186     });
187     print.addActionListener(new ActionListener()
188     {
189       public void actionPerformed(ActionEvent e)
190       {
191         print_actionPerformed(e);
192       }
193     });
194     viewMenu.setText("View");
195     viewMenu.addMenuListener(new MenuListener()
196     {
197       public void menuSelected(MenuEvent e)
198       {
199         viewMenu_menuSelected();
200       }
201
202       public void menuDeselected(MenuEvent e)
203       {
204       }
205
206       public void menuCanceled(MenuEvent e)
207       {
208       }
209     });
210     showLabels.setText("Show Labels");
211     showLabels.addActionListener(new ActionListener()
212     {
213       public void actionPerformed(ActionEvent e)
214       {
215         showLabels_actionPerformed(e);
216       }
217     });
218     print.setText("Print");
219     bgcolour.setText("Background Colour...");
220     bgcolour.addActionListener(new ActionListener()
221     {
222       public void actionPerformed(ActionEvent e)
223       {
224         bgcolour_actionPerformed(e);
225       }
226     });
227     originalSeqData.setText("Input Data...");
228     originalSeqData.addActionListener(new ActionListener()
229     {
230       public void actionPerformed(ActionEvent e)
231       {
232         originalSeqData_actionPerformed(e);
233       }
234     });
235     associateViewsMenu.setText("Associate Nodes With");
236     calcSettings.setText("Change Parameters");
237     nuclSetting.setText("Nucleotide matrix");
238     protSetting.setText("Protein matrix");
239     nuclSetting.addActionListener(new ActionListener()
240     {
241       
242       @Override
243       public void actionPerformed(ActionEvent arg0)
244       {
245         nuclSetting_actionPerfomed(arg0);
246       }
247     });
248     protSetting.addActionListener(new ActionListener()
249     {
250       
251       @Override
252       public void actionPerformed(ActionEvent arg0)
253       {
254         protSetting_actionPerfomed(arg0);
255       }
256     });calcSettings.add(nuclSetting);
257     calcSettings.add(protSetting);
258     
259     
260     this.getContentPane().add(jPanel2, BorderLayout.SOUTH);
261     jPanel2.add(jLabel1, null);
262     jPanel2.add(xCombobox, null);
263     jPanel2.add(jLabel2, null);
264     jPanel2.add(yCombobox, null);
265     jPanel2.add(jLabel3, null);
266     jPanel2.add(zCombobox, null);
267     jPanel2.add(resetButton, null);
268     jMenuBar1.add(fileMenu);
269     jMenuBar1.add(viewMenu);
270     jMenuBar1.add(calcSettings);
271     fileMenu.add(saveMenu);
272     fileMenu.add(outputValues);
273     fileMenu.add(print);
274     fileMenu.add(originalSeqData);
275     fileMenu.add(outputPoints);
276     fileMenu.add(outputProjPoints);
277     saveMenu.add(eps);
278     saveMenu.add(png);
279     viewMenu.add(showLabels);
280     viewMenu.add(bgcolour);
281     viewMenu.add(associateViewsMenu);
282   }
283
284   protected void resetButton_actionPerformed(ActionEvent e)
285   {
286     // TODO Auto-generated method stub
287     
288   }
289
290   protected void protSetting_actionPerfomed(ActionEvent arg0)
291   {
292     // TODO Auto-generated method stub
293     
294   }
295
296   protected void nuclSetting_actionPerfomed(ActionEvent arg0)
297   {
298     // TODO Auto-generated method stub
299     
300   }
301
302   protected void outputPoints_actionPerformed(ActionEvent e)
303   {
304     // TODO Auto-generated method stub
305
306   }
307
308   protected void outputProjPoints_actionPerformed(ActionEvent e)
309   {
310     // TODO Auto-generated method stub
311
312   }
313
314   protected void xCombobox_actionPerformed(ActionEvent e)
315   {
316   }
317
318   protected void yCombobox_actionPerformed(ActionEvent e)
319   {
320   }
321
322   protected void zCombobox_actionPerformed(ActionEvent e)
323   {
324   }
325
326   public void eps_actionPerformed(ActionEvent e)
327   {
328
329   }
330
331   public void png_actionPerformed(ActionEvent e)
332   {
333
334   }
335
336   public void outputValues_actionPerformed(ActionEvent e)
337   {
338
339   }
340
341   public void print_actionPerformed(ActionEvent e)
342   {
343
344   }
345
346   public void showLabels_actionPerformed(ActionEvent e)
347   {
348
349   }
350
351   public void bgcolour_actionPerformed(ActionEvent e)
352   {
353
354   }
355
356   public void originalSeqData_actionPerformed(ActionEvent e)
357   {
358
359   }
360
361   public void viewMenu_menuSelected()
362   {
363
364   }
365 }