Now an InternalFrame with menus
[jalview.git] / src / jalview / jbgui / GPCAPanel.java
1 /*\r
2  * Jalview - A Sequence Alignment Editor and Viewer\r
3  * Copyright (C) 2005 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 \r
25 public class GPCAPanel\r
26     extends JInternalFrame\r
27 {\r
28   JPanel jPanel2 = new JPanel();\r
29   JLabel jLabel1 = new JLabel();\r
30   JLabel jLabel2 = new JLabel();\r
31   JLabel jLabel3 = new JLabel();\r
32   protected JComboBox xCombobox = new JComboBox();\r
33   protected JComboBox yCombobox = new JComboBox();\r
34   protected JComboBox zCombobox = new JComboBox();\r
35   FlowLayout flowLayout1 = new FlowLayout();\r
36   BorderLayout borderLayout1 = new BorderLayout();\r
37   JMenuBar jMenuBar1 = new JMenuBar();\r
38   JMenu fileMenu = new JMenu();\r
39   JMenu saveMenu = new JMenu();\r
40   JMenuItem eps = new JMenuItem();\r
41   JMenuItem png = new JMenuItem();\r
42   JMenuItem print = new JMenuItem();\r
43   JMenuItem outputValues = new JMenuItem();\r
44   JMenu viewMenu = new JMenu();\r
45   protected JCheckBoxMenuItem showLabels = new JCheckBoxMenuItem();\r
46   JMenuItem bgcolour = new JMenuItem();\r
47 \r
48   public GPCAPanel()\r
49   {\r
50     try\r
51     {\r
52       jbInit();\r
53     }\r
54     catch (Exception e)\r
55     {\r
56       e.printStackTrace();\r
57     }\r
58 \r
59     for (int i = 1; i < 8; i++)\r
60     {\r
61       xCombobox.addItem("dim " + i);\r
62       yCombobox.addItem("dim " + i);\r
63       zCombobox.addItem("dim " + i);\r
64     }\r
65 \r
66 \r
67     setJMenuBar(jMenuBar1);\r
68   }\r
69 \r
70   private void jbInit()\r
71       throws Exception\r
72   {\r
73     this.getContentPane().setLayout(borderLayout1);\r
74     jPanel2.setLayout(flowLayout1);\r
75     jLabel1.setFont(new java.awt.Font("Verdana", 0, 12));\r
76     jLabel1.setText("x=");\r
77     jLabel2.setFont(new java.awt.Font("Verdana", 0, 12));\r
78     jLabel2.setText("y=");\r
79     jLabel3.setFont(new java.awt.Font("Verdana", 0, 12));\r
80     jLabel3.setText("z=");\r
81     jPanel2.setBackground(Color.white);\r
82     jPanel2.setBorder(null);\r
83     zCombobox.setFont(new java.awt.Font("Verdana", 0, 12));\r
84     zCombobox.addActionListener(new java.awt.event.ActionListener()\r
85     {\r
86       public void actionPerformed(ActionEvent e)\r
87       {\r
88         zCombobox_actionPerformed(e);\r
89       }\r
90     });\r
91     yCombobox.setFont(new java.awt.Font("Verdana", 0, 12));\r
92     yCombobox.addActionListener(new java.awt.event.ActionListener()\r
93     {\r
94       public void actionPerformed(ActionEvent e)\r
95       {\r
96         yCombobox_actionPerformed(e);\r
97       }\r
98     });\r
99     xCombobox.setFont(new java.awt.Font("Verdana", 0, 12));\r
100     xCombobox.addActionListener(new java.awt.event.ActionListener()\r
101     {\r
102       public void actionPerformed(ActionEvent e)\r
103       {\r
104         xCombobox_actionPerformed(e);\r
105       }\r
106     });\r
107     fileMenu.setText("File");\r
108     saveMenu.setText("Save as");\r
109     eps.setText("EPS");\r
110     eps.addActionListener(new ActionListener()\r
111     {\r
112       public void actionPerformed(ActionEvent e)\r
113       {\r
114         eps_actionPerformed(e);\r
115       }\r
116     });\r
117     png.setText("PNG");\r
118     png.addActionListener(new ActionListener()\r
119     {\r
120       public void actionPerformed(ActionEvent e)\r
121       {\r
122         png_actionPerformed(e);\r
123       }\r
124     });\r
125     outputValues.setText("Output Values...");\r
126     outputValues.addActionListener(new ActionListener()\r
127     {\r
128       public void actionPerformed(ActionEvent e)\r
129       {\r
130         outputValues_actionPerformed(e);\r
131       }\r
132     });\r
133     print.addActionListener(new ActionListener()\r
134     {\r
135       public void actionPerformed(ActionEvent e)\r
136       {\r
137         print_actionPerformed(e);\r
138       }\r
139     });\r
140     viewMenu.setText("View");\r
141     showLabels.setText("Show Labels");\r
142     showLabels.addActionListener(new ActionListener()\r
143     {\r
144       public void actionPerformed(ActionEvent e)\r
145       {\r
146         showLabels_actionPerformed(e);\r
147       }\r
148     });\r
149     print.setText("Print");\r
150     bgcolour.setText("Background Colour...");\r
151     bgcolour.addActionListener(new ActionListener()\r
152     {\r
153       public void actionPerformed(ActionEvent e)\r
154       {\r
155         bgcolour_actionPerformed(e);\r
156       }\r
157     });\r
158     this.getContentPane().add(jPanel2, BorderLayout.SOUTH);\r
159     jPanel2.add(jLabel1, null);\r
160     jPanel2.add(xCombobox, null);\r
161     jPanel2.add(jLabel2, null);\r
162     jPanel2.add(yCombobox, null);\r
163     jPanel2.add(jLabel3, null);\r
164     jPanel2.add(zCombobox, null);\r
165     jMenuBar1.add(fileMenu);\r
166     jMenuBar1.add(viewMenu);\r
167     fileMenu.add(saveMenu);\r
168     fileMenu.add(outputValues);\r
169     fileMenu.add(print);\r
170     saveMenu.add(eps);\r
171     saveMenu.add(png);\r
172     viewMenu.add(showLabels);\r
173     viewMenu.add(bgcolour);\r
174   }\r
175 \r
176   protected void xCombobox_actionPerformed(ActionEvent e)\r
177   {\r
178   }\r
179 \r
180   protected void yCombobox_actionPerformed(ActionEvent e)\r
181   {\r
182   }\r
183 \r
184   protected void zCombobox_actionPerformed(ActionEvent e)\r
185   {\r
186   }\r
187 \r
188   public void eps_actionPerformed(ActionEvent e)\r
189   {\r
190 \r
191   }\r
192 \r
193   public void png_actionPerformed(ActionEvent e)\r
194   {\r
195 \r
196   }\r
197 \r
198   public void outputValues_actionPerformed(ActionEvent e)\r
199   {\r
200 \r
201   }\r
202 \r
203   public void print_actionPerformed(ActionEvent e)\r
204   {\r
205 \r
206   }\r
207 \r
208   public void showLabels_actionPerformed(ActionEvent e)\r
209   {\r
210 \r
211   }\r
212 \r
213   public void bgcolour_actionPerformed(ActionEvent e)\r
214   {\r
215 \r
216   }\r
217 }\r