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