Associate PCA with multiple views
[jalview.git] / src / jalview / jbgui / GPCAPanel.java
1 /*\r
2  * Jalview - A Sequence Alignment Editor and Viewer\r
3  * Copyright (C) 2006 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle\r
4  *\r
5  * This program is free software; you can redistribute it and/or\r
6  * modify it under the terms of the GNU General Public License\r
7  * as published by the Free Software Foundation; either version 2\r
8  * of the License, or (at your option) any later version.\r
9  *\r
10  * This program is distributed in the hope that it will be useful,\r
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
13  * GNU General Public License for more details.\r
14  *\r
15  * You should have received a copy of the GNU General Public License\r
16  * along with this program; if not, write to the Free Software\r
17  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA\r
18  */\r
19 package jalview.jbgui;\r
20 \r
21 import java.awt.*;\r
22 import java.awt.event.*;\r
23 import javax.swing.*;\r
24 import javax.swing.event.MenuListener;\r
25 import javax.swing.event.MenuEvent;\r
26 \r
27 public class GPCAPanel\r
28     extends JInternalFrame\r
29 {\r
30   JPanel jPanel2 = new JPanel();\r
31   JLabel jLabel1 = new JLabel();\r
32   JLabel jLabel2 = new JLabel();\r
33   JLabel jLabel3 = new JLabel();\r
34   protected JComboBox xCombobox = new JComboBox();\r
35   protected JComboBox yCombobox = new JComboBox();\r
36   protected JComboBox zCombobox = new JComboBox();\r
37   FlowLayout flowLayout1 = new FlowLayout();\r
38   BorderLayout borderLayout1 = new BorderLayout();\r
39   JMenuBar jMenuBar1 = new JMenuBar();\r
40   JMenu fileMenu = new JMenu();\r
41   JMenu saveMenu = new JMenu();\r
42   JMenuItem eps = new JMenuItem();\r
43   JMenuItem png = new JMenuItem();\r
44   JMenuItem print = new JMenuItem();\r
45   JMenuItem outputValues = new JMenuItem();\r
46   protected JMenu viewMenu = new JMenu();\r
47   protected JCheckBoxMenuItem showLabels = new JCheckBoxMenuItem();\r
48   JMenuItem bgcolour = new JMenuItem();\r
49   JMenuItem originalSeqData = new JMenuItem();\r
50   protected JMenu associateViewsMenu = new JMenu();\r
51 \r
52   public GPCAPanel()\r
53   {\r
54     try\r
55     {\r
56       jbInit();\r
57     }\r
58     catch (Exception e)\r
59     {\r
60       e.printStackTrace();\r
61     }\r
62 \r
63     for (int i = 1; i < 8; i++)\r
64     {\r
65       xCombobox.addItem("dim " + i);\r
66       yCombobox.addItem("dim " + i);\r
67       zCombobox.addItem("dim " + i);\r
68     }\r
69 \r
70 \r
71     setJMenuBar(jMenuBar1);\r
72   }\r
73 \r
74   private void jbInit()\r
75       throws Exception\r
76   {\r
77     this.getContentPane().setLayout(borderLayout1);\r
78     jPanel2.setLayout(flowLayout1);\r
79     jLabel1.setFont(new java.awt.Font("Verdana", 0, 12));\r
80     jLabel1.setText("x=");\r
81     jLabel2.setFont(new java.awt.Font("Verdana", 0, 12));\r
82     jLabel2.setText("y=");\r
83     jLabel3.setFont(new java.awt.Font("Verdana", 0, 12));\r
84     jLabel3.setText("z=");\r
85     jPanel2.setBackground(Color.white);\r
86     jPanel2.setBorder(null);\r
87     zCombobox.setFont(new java.awt.Font("Verdana", 0, 12));\r
88     zCombobox.addActionListener(new java.awt.event.ActionListener()\r
89     {\r
90       public void actionPerformed(ActionEvent e)\r
91       {\r
92         zCombobox_actionPerformed(e);\r
93       }\r
94     });\r
95     yCombobox.setFont(new java.awt.Font("Verdana", 0, 12));\r
96     yCombobox.addActionListener(new java.awt.event.ActionListener()\r
97     {\r
98       public void actionPerformed(ActionEvent e)\r
99       {\r
100         yCombobox_actionPerformed(e);\r
101       }\r
102     });\r
103     xCombobox.setFont(new java.awt.Font("Verdana", 0, 12));\r
104     xCombobox.addActionListener(new java.awt.event.ActionListener()\r
105     {\r
106       public void actionPerformed(ActionEvent e)\r
107       {\r
108         xCombobox_actionPerformed(e);\r
109       }\r
110     });\r
111     fileMenu.setText("File");\r
112     saveMenu.setText("Save as");\r
113     eps.setText("EPS");\r
114     eps.addActionListener(new ActionListener()\r
115     {\r
116       public void actionPerformed(ActionEvent e)\r
117       {\r
118         eps_actionPerformed(e);\r
119       }\r
120     });\r
121     png.setText("PNG");\r
122     png.addActionListener(new ActionListener()\r
123     {\r
124       public void actionPerformed(ActionEvent e)\r
125       {\r
126         png_actionPerformed(e);\r
127       }\r
128     });\r
129     outputValues.setText("Output Values...");\r
130     outputValues.addActionListener(new ActionListener()\r
131     {\r
132       public void actionPerformed(ActionEvent e)\r
133       {\r
134         outputValues_actionPerformed(e);\r
135       }\r
136     });\r
137     print.addActionListener(new ActionListener()\r
138     {\r
139       public void actionPerformed(ActionEvent e)\r
140       {\r
141         print_actionPerformed(e);\r
142       }\r
143     });\r
144     viewMenu.setText("View");\r
145     viewMenu.addMenuListener(new MenuListener()\r
146     {\r
147       public void menuSelected(MenuEvent e)\r
148       {\r
149         viewMenu_menuSelected();\r
150       }\r
151 \r
152       public void menuDeselected(MenuEvent e)\r
153       {\r
154       }\r
155 \r
156       public void menuCanceled(MenuEvent e)\r
157       {\r
158       }\r
159     });\r
160     showLabels.setText("Show Labels");\r
161     showLabels.addActionListener(new ActionListener()\r
162     {\r
163       public void actionPerformed(ActionEvent e)\r
164       {\r
165         showLabels_actionPerformed(e);\r
166       }\r
167     });\r
168     print.setText("Print");\r
169     bgcolour.setText("Background Colour...");\r
170     bgcolour.addActionListener(new ActionListener()\r
171     {\r
172       public void actionPerformed(ActionEvent e)\r
173       {\r
174         bgcolour_actionPerformed(e);\r
175       }\r
176     });\r
177     originalSeqData.setText("Input Data...");\r
178     originalSeqData.addActionListener(new ActionListener()\r
179     {\r
180       public void actionPerformed(ActionEvent e)\r
181       {\r
182         originalSeqData_actionPerformed(e);\r
183       }\r
184     });\r
185     associateViewsMenu.setText("Associate Nodes With");\r
186     this.getContentPane().add(jPanel2, BorderLayout.SOUTH);\r
187     jPanel2.add(jLabel1, null);\r
188     jPanel2.add(xCombobox, null);\r
189     jPanel2.add(jLabel2, null);\r
190     jPanel2.add(yCombobox, null);\r
191     jPanel2.add(jLabel3, null);\r
192     jPanel2.add(zCombobox, null);\r
193     jMenuBar1.add(fileMenu);\r
194     jMenuBar1.add(viewMenu);\r
195     fileMenu.add(saveMenu);\r
196     fileMenu.add(outputValues);\r
197     fileMenu.add(print);\r
198     fileMenu.add(originalSeqData);\r
199     saveMenu.add(eps);\r
200     saveMenu.add(png);\r
201     viewMenu.add(showLabels);\r
202     viewMenu.add(bgcolour);\r
203     viewMenu.add(associateViewsMenu);\r
204   }\r
205 \r
206   protected void xCombobox_actionPerformed(ActionEvent e)\r
207   {\r
208   }\r
209 \r
210   protected void yCombobox_actionPerformed(ActionEvent e)\r
211   {\r
212   }\r
213 \r
214   protected void zCombobox_actionPerformed(ActionEvent e)\r
215   {\r
216   }\r
217 \r
218   public void eps_actionPerformed(ActionEvent e)\r
219   {\r
220 \r
221   }\r
222 \r
223   public void png_actionPerformed(ActionEvent e)\r
224   {\r
225 \r
226   }\r
227 \r
228   public void outputValues_actionPerformed(ActionEvent e)\r
229   {\r
230 \r
231   }\r
232 \r
233   public void print_actionPerformed(ActionEvent e)\r
234   {\r
235 \r
236   }\r
237 \r
238   public void showLabels_actionPerformed(ActionEvent e)\r
239   {\r
240 \r
241   }\r
242 \r
243   public void bgcolour_actionPerformed(ActionEvent e)\r
244   {\r
245 \r
246   }\r
247 \r
248   public void originalSeqData_actionPerformed(ActionEvent e)\r
249   {\r
250 \r
251   }\r
252 \r
253   public void viewMenu_menuSelected()\r
254   {\r
255 \r
256   }\r
257 }\r