Check bounds of loaded comp
[jalview.git] / src / jalview / jbgui / GStructureViewer.java
1 /*\r
2  * Jalview - A Sequence Alignment Editor and Viewer\r
3  * Copyright (C) 2007 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 \r
20 package jalview.jbgui;\r
21 \r
22 import javax.swing.*;\r
23 import java.awt.event.ActionListener;\r
24 import java.awt.event.ActionEvent;\r
25 \r
26 public class GStructureViewer  extends JInternalFrame\r
27 {\r
28   public GStructureViewer()\r
29   {\r
30     try\r
31     {\r
32       jbInit();\r
33     }\r
34     catch (Exception ex)\r
35     {\r
36       ex.printStackTrace();\r
37     }\r
38   }\r
39 \r
40   private void jbInit()\r
41       throws Exception\r
42   {\r
43     this.setJMenuBar(menuBar);\r
44     fileMenu.setText("File");\r
45     savemenu.setActionCommand("Save Image");\r
46     savemenu.setText("Save As");\r
47     pdbFile.setText("PDB File");\r
48     pdbFile.addActionListener(new ActionListener()\r
49     {\r
50       public void actionPerformed(ActionEvent actionEvent)\r
51       {\r
52         pdbFile_actionPerformed(actionEvent);\r
53       }\r
54     });\r
55     png.setText("PNG");\r
56     png.addActionListener(new ActionListener()\r
57     {\r
58       public void actionPerformed(ActionEvent actionEvent)\r
59       {\r
60         png_actionPerformed(actionEvent);\r
61       }\r
62     });\r
63     eps.setText("EPS");\r
64     eps.addActionListener(new ActionListener()\r
65     {\r
66       public void actionPerformed(ActionEvent actionEvent)\r
67       {\r
68         eps_actionPerformed(actionEvent);\r
69       }\r
70     });\r
71     viewMapping.setText("View Mapping");\r
72     viewMapping.addActionListener(new ActionListener()\r
73     {\r
74       public void actionPerformed(ActionEvent actionEvent)\r
75       {\r
76         viewMapping_actionPerformed(actionEvent);\r
77       }\r
78     });\r
79     viewMenu.setText("View");\r
80     chainMenu.setText("Show Chain");\r
81     colourMenu.setText("Colours");\r
82     backGround.setText("Background Colour...");\r
83     backGround.addActionListener(new ActionListener()\r
84     {\r
85       public void actionPerformed(ActionEvent actionEvent)\r
86       {\r
87         backGround_actionPerformed(actionEvent);\r
88       }\r
89     });\r
90     seqColour.setSelected(true);\r
91     seqColour.setText("By Sequence");\r
92     seqColour.addActionListener(new ActionListener()\r
93     {\r
94       public void actionPerformed(ActionEvent actionEvent)\r
95       {\r
96         seqColour_actionPerformed(actionEvent);\r
97       }\r
98     });\r
99     chainColour.setText("By Chain");\r
100     chainColour.addActionListener(new ActionListener()\r
101     {\r
102       public void actionPerformed(ActionEvent actionEvent)\r
103       {\r
104         chainColour_actionPerformed(actionEvent);\r
105       }\r
106     });\r
107     chargeColour.setText("Charge & Cysteine");\r
108     chargeColour.addActionListener(new ActionListener()\r
109     {\r
110       public void actionPerformed(ActionEvent actionEvent)\r
111       {\r
112         chargeColour_actionPerformed(actionEvent);\r
113       }\r
114     });\r
115     zappoColour.setText("Zappo");\r
116     zappoColour.addActionListener(new ActionListener()\r
117     {\r
118       public void actionPerformed(ActionEvent actionEvent)\r
119       {\r
120         zappoColour_actionPerformed(actionEvent);\r
121       }\r
122     });\r
123     taylorColour.setText("Taylor");\r
124     taylorColour.addActionListener(new ActionListener()\r
125     {\r
126       public void actionPerformed(ActionEvent actionEvent)\r
127       {\r
128         taylorColour_actionPerformed(actionEvent);\r
129       }\r
130     });\r
131     hydroColour.setText("Hydro");\r
132     hydroColour.addActionListener(new ActionListener()\r
133     {\r
134       public void actionPerformed(ActionEvent actionEvent)\r
135       {\r
136         hydroColour_actionPerformed(actionEvent);\r
137       }\r
138     });\r
139     strandColour.setText("Strand");\r
140     strandColour.addActionListener(new ActionListener()\r
141     {\r
142       public void actionPerformed(ActionEvent actionEvent)\r
143       {\r
144         strandColour_actionPerformed(actionEvent);\r
145       }\r
146     });\r
147     helixColour.setText("Helix Propensity");\r
148     helixColour.addActionListener(new ActionListener()\r
149     {\r
150       public void actionPerformed(ActionEvent actionEvent)\r
151       {\r
152         helixColour_actionPerformed(actionEvent);\r
153       }\r
154     });\r
155     turnColour.setText("Turn Propensity");\r
156     turnColour.addActionListener(new ActionListener()\r
157     {\r
158       public void actionPerformed(ActionEvent actionEvent)\r
159       {\r
160         turnColour_actionPerformed(actionEvent);\r
161       }\r
162     });\r
163     buriedColour.setText("Buried Index");\r
164     buriedColour.addActionListener(new ActionListener()\r
165     {\r
166       public void actionPerformed(ActionEvent actionEvent)\r
167       {\r
168         buriedColour_actionPerformed(actionEvent);\r
169       }\r
170     });\r
171     userColour.setText("User Defined ...");\r
172     userColour.addActionListener(new ActionListener()\r
173     {\r
174       public void actionPerformed(ActionEvent actionEvent)\r
175       {\r
176         userColour_actionPerformed(actionEvent);\r
177       }\r
178     });\r
179     helpMenu.setText("Help");\r
180     jmolHelp.setText("Jmol Help");\r
181     jmolHelp.addActionListener(new ActionListener()\r
182     {\r
183       public void actionPerformed(ActionEvent actionEvent)\r
184       {\r
185         jmolHelp_actionPerformed(actionEvent);\r
186       }\r
187     });\r
188     menuBar.add(fileMenu);\r
189     menuBar.add(viewMenu);\r
190     menuBar.add(colourMenu);\r
191     menuBar.add(helpMenu);\r
192     fileMenu.add(savemenu);\r
193     fileMenu.add(viewMapping);\r
194     savemenu.add(pdbFile);\r
195     savemenu.add(png);\r
196     savemenu.add(eps);\r
197     viewMenu.add(chainMenu);\r
198     colourMenu.add(seqColour);\r
199     colourMenu.add(chainColour);\r
200     colourMenu.add(chargeColour);\r
201     colourMenu.add(zappoColour);\r
202     colourMenu.add(taylorColour);\r
203     colourMenu.add(hydroColour);\r
204     colourMenu.add(helixColour);\r
205     colourMenu.add(strandColour);\r
206     colourMenu.add(turnColour);\r
207     colourMenu.add(buriedColour);\r
208     colourMenu.add(userColour);\r
209     colourMenu.add(backGround);\r
210     helpMenu.add(jmolHelp);\r
211   }\r
212 \r
213   JMenuBar menuBar = new JMenuBar();\r
214   JMenu fileMenu = new JMenu();\r
215   JMenu savemenu = new JMenu();\r
216   JMenuItem pdbFile = new JMenuItem();\r
217   JMenuItem png = new JMenuItem();\r
218   JMenuItem eps = new JMenuItem();\r
219   JMenuItem viewMapping = new JMenuItem();\r
220   JMenu viewMenu = new JMenu();\r
221   protected JMenu chainMenu = new JMenu();\r
222   JMenu jMenu1 = new JMenu();\r
223   JMenu colourMenu = new JMenu();\r
224   JMenuItem backGround = new JMenuItem();\r
225   protected JCheckBoxMenuItem seqColour = new JCheckBoxMenuItem();\r
226   JMenuItem chainColour = new JMenuItem();\r
227   JMenuItem chargeColour = new JMenuItem();\r
228   JMenuItem zappoColour = new JMenuItem();\r
229   JMenuItem taylorColour = new JMenuItem();\r
230   JMenuItem hydroColour = new JMenuItem();\r
231   JMenuItem strandColour = new JMenuItem();\r
232   JMenuItem helixColour = new JMenuItem();\r
233   JMenuItem turnColour = new JMenuItem();\r
234   JMenuItem buriedColour = new JMenuItem();\r
235   JMenuItem userColour = new JMenuItem();\r
236   JMenu helpMenu = new JMenu();\r
237   JMenuItem jmolHelp = new JMenuItem();\r
238   public void pdbFile_actionPerformed(ActionEvent actionEvent)\r
239   {\r
240 \r
241   }\r
242 \r
243   public void png_actionPerformed(ActionEvent actionEvent)\r
244   {\r
245 \r
246   }\r
247 \r
248   public void eps_actionPerformed(ActionEvent actionEvent)\r
249   {\r
250 \r
251   }\r
252 \r
253   public void viewMapping_actionPerformed(ActionEvent actionEvent)\r
254   {\r
255 \r
256   }\r
257 \r
258   public void seqColour_actionPerformed(ActionEvent actionEvent)\r
259   {\r
260 \r
261   }\r
262 \r
263   public void chainColour_actionPerformed(ActionEvent actionEvent)\r
264   {\r
265 \r
266   }\r
267 \r
268   public void chargeColour_actionPerformed(ActionEvent actionEvent)\r
269   {\r
270 \r
271   }\r
272 \r
273   public void zappoColour_actionPerformed(ActionEvent actionEvent)\r
274   {\r
275 \r
276   }\r
277 \r
278   public void taylorColour_actionPerformed(ActionEvent actionEvent)\r
279   {\r
280 \r
281   }\r
282 \r
283   public void hydroColour_actionPerformed(ActionEvent actionEvent)\r
284   {\r
285 \r
286   }\r
287 \r
288   public void helixColour_actionPerformed(ActionEvent actionEvent)\r
289   {\r
290 \r
291   }\r
292 \r
293   public void strandColour_actionPerformed(ActionEvent actionEvent)\r
294   {\r
295 \r
296   }\r
297 \r
298   public void turnColour_actionPerformed(ActionEvent actionEvent)\r
299   {\r
300 \r
301   }\r
302 \r
303   public void buriedColour_actionPerformed(ActionEvent actionEvent)\r
304   {\r
305 \r
306   }\r
307 \r
308   public void userColour_actionPerformed(ActionEvent actionEvent)\r
309   {\r
310 \r
311   }\r
312 \r
313   public void backGround_actionPerformed(ActionEvent actionEvent)\r
314   {\r
315 \r
316   }\r
317 \r
318   public void jmolHelp_actionPerformed(ActionEvent actionEvent)\r
319   {\r
320 \r
321   }\r
322 }\r