formatting
[jalview.git] / src / jalview / jbgui / GStructureViewer.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 javax.swing.*;
21 import java.awt.event.ActionListener;
22 import java.awt.event.ActionEvent;
23
24 public class GStructureViewer extends JInternalFrame
25 {
26   public GStructureViewer()
27   {
28     try
29     {
30       jbInit();
31     } catch (Exception ex)
32     {
33       ex.printStackTrace();
34     }
35   }
36
37   private void jbInit() throws Exception
38   {
39     this.setJMenuBar(menuBar);
40     fileMenu.setText("File");
41     savemenu.setActionCommand("Save Image");
42     savemenu.setText("Save As");
43     pdbFile.setText("PDB File");
44     pdbFile.addActionListener(new ActionListener()
45     {
46       public void actionPerformed(ActionEvent actionEvent)
47       {
48         pdbFile_actionPerformed(actionEvent);
49       }
50     });
51     png.setText("PNG");
52     png.addActionListener(new ActionListener()
53     {
54       public void actionPerformed(ActionEvent actionEvent)
55       {
56         png_actionPerformed(actionEvent);
57       }
58     });
59     eps.setText("EPS");
60     eps.addActionListener(new ActionListener()
61     {
62       public void actionPerformed(ActionEvent actionEvent)
63       {
64         eps_actionPerformed(actionEvent);
65       }
66     });
67     viewMapping.setText("View Mapping");
68     viewMapping.addActionListener(new ActionListener()
69     {
70       public void actionPerformed(ActionEvent actionEvent)
71       {
72         viewMapping_actionPerformed(actionEvent);
73       }
74     });
75     viewMenu.setText("View");
76     chainMenu.setText("Show Chain");
77     colourMenu.setText("Colours");
78     backGround.setText("Background Colour...");
79     backGround.addActionListener(new ActionListener()
80     {
81       public void actionPerformed(ActionEvent actionEvent)
82       {
83         backGround_actionPerformed(actionEvent);
84       }
85     });
86     seqColour.setSelected(false);
87     seqColour.setText("By Sequence");
88     seqColour.addActionListener(new ActionListener()
89     {
90       public void actionPerformed(ActionEvent actionEvent)
91       {
92         seqColour_actionPerformed(actionEvent);
93       }
94     });
95     chainColour.setText("By Chain");
96     chainColour.addActionListener(new ActionListener()
97     {
98       public void actionPerformed(ActionEvent actionEvent)
99       {
100         chainColour_actionPerformed(actionEvent);
101       }
102     });
103     chargeColour.setText("Charge & Cysteine");
104     chargeColour.addActionListener(new ActionListener()
105     {
106       public void actionPerformed(ActionEvent actionEvent)
107       {
108         chargeColour_actionPerformed(actionEvent);
109       }
110     });
111     zappoColour.setText("Zappo");
112     zappoColour.addActionListener(new ActionListener()
113     {
114       public void actionPerformed(ActionEvent actionEvent)
115       {
116         zappoColour_actionPerformed(actionEvent);
117       }
118     });
119     taylorColour.setText("Taylor");
120     taylorColour.addActionListener(new ActionListener()
121     {
122       public void actionPerformed(ActionEvent actionEvent)
123       {
124         taylorColour_actionPerformed(actionEvent);
125       }
126     });
127     hydroColour.setText("Hydro");
128     hydroColour.addActionListener(new ActionListener()
129     {
130       public void actionPerformed(ActionEvent actionEvent)
131       {
132         hydroColour_actionPerformed(actionEvent);
133       }
134     });
135     strandColour.setText("Strand");
136     strandColour.addActionListener(new ActionListener()
137     {
138       public void actionPerformed(ActionEvent actionEvent)
139       {
140         strandColour_actionPerformed(actionEvent);
141       }
142     });
143     helixColour.setText("Helix Propensity");
144     helixColour.addActionListener(new ActionListener()
145     {
146       public void actionPerformed(ActionEvent actionEvent)
147       {
148         helixColour_actionPerformed(actionEvent);
149       }
150     });
151     turnColour.setText("Turn Propensity");
152     turnColour.addActionListener(new ActionListener()
153     {
154       public void actionPerformed(ActionEvent actionEvent)
155       {
156         turnColour_actionPerformed(actionEvent);
157       }
158     });
159     buriedColour.setText("Buried Index");
160     buriedColour.addActionListener(new ActionListener()
161     {
162       public void actionPerformed(ActionEvent actionEvent)
163       {
164         buriedColour_actionPerformed(actionEvent);
165       }
166     });
167     purinePyrimidineColour.setText("Purine/Pyrimidine");
168     purinePyrimidineColour.addActionListener(new ActionListener()
169     {
170       public void actionPerformed(ActionEvent actionEvent)
171       {
172           purinePyrimidineColour_actionPerformed(actionEvent);
173       }
174     });
175     
176     userColour.setText("User Defined ...");
177     userColour.addActionListener(new ActionListener()
178     {
179       public void actionPerformed(ActionEvent actionEvent)
180       {
181         userColour_actionPerformed(actionEvent);
182       }
183     });
184     jmolColour.setSelected(false);
185     jmolColour.setText("Colour with Jmol");
186     jmolColour.setToolTipText("Let Jmol manage structure colours.");
187     jmolColour.addActionListener(new ActionListener()
188     {
189       public void actionPerformed(ActionEvent actionEvent)
190       {
191         jmolColour_actionPerformed(actionEvent);
192       }
193     }
194     );
195     helpMenu.setText("Help");
196     jmolHelp.setText("Jmol Help");
197     jmolHelp.addActionListener(new ActionListener()
198     {
199       public void actionPerformed(ActionEvent actionEvent)
200       {
201         jmolHelp_actionPerformed(actionEvent);
202       }
203     });
204     alignStructs.setText("Align structures");
205     alignStructs.addActionListener(new ActionListener()
206     {
207       public void actionPerformed(ActionEvent actionEvent)
208       {
209         alignStructs_actionPerformed(actionEvent);
210       }
211     });
212     jmolActionMenu.setText("Jmol");
213     menuBar.add(fileMenu);
214     menuBar.add(viewMenu);
215     menuBar.add(colourMenu);
216     menuBar.add(jmolActionMenu);
217     jmolActionMenu.setVisible(false);
218     menuBar.add(helpMenu);
219     fileMenu.add(savemenu);
220     fileMenu.add(viewMapping);
221     savemenu.add(pdbFile);
222     savemenu.add(png);
223     savemenu.add(eps);
224     viewMenu.add(chainMenu);
225
226     colourMenu.add(seqColour);
227     colourMenu.add(chainColour);
228     colourMenu.add(chargeColour);
229     colourMenu.add(zappoColour);
230     colourMenu.add(taylorColour);
231     colourMenu.add(hydroColour);
232     colourMenu.add(helixColour);
233     colourMenu.add(strandColour);
234     colourMenu.add(turnColour);
235     colourMenu.add(buriedColour);
236     colourMenu.add(purinePyrimidineColour);
237     colourMenu.add(userColour);
238     colourMenu.add(jmolColour);
239     colourMenu.add(backGround);
240
241     colourButtons.add(seqColour);
242     colourButtons.add(chainColour);
243     colourButtons.add(chargeColour);
244     colourButtons.add(zappoColour);
245     colourButtons.add(taylorColour);
246     colourButtons.add(hydroColour);
247     colourButtons.add(helixColour);
248     colourButtons.add(strandColour);
249     colourButtons.add(turnColour);
250     colourButtons.add(buriedColour);
251     colourButtons.add(userColour);
252     colourButtons.add(jmolColour);
253
254     helpMenu.add(jmolHelp);
255     jmolActionMenu.add(alignStructs);
256   }
257
258   protected void jmolColour_actionPerformed(ActionEvent actionEvent)
259   {
260   }
261
262   protected void alignStructs_actionPerformed(ActionEvent actionEvent)
263   {
264   }
265
266   JMenuBar menuBar = new JMenuBar();
267
268   JMenu fileMenu = new JMenu();
269
270   JMenu savemenu = new JMenu();
271
272   JMenuItem pdbFile = new JMenuItem();
273
274   JMenuItem png = new JMenuItem();
275
276   JMenuItem eps = new JMenuItem();
277
278   JMenuItem viewMapping = new JMenuItem();
279
280   protected JMenu viewMenu = new JMenu();
281
282   protected JMenu chainMenu = new JMenu();
283
284   JMenu jMenu1 = new JMenu();
285
286   protected JMenu colourMenu = new JMenu();
287
288   protected JMenu jmolActionMenu = new JMenu();
289
290   protected JMenuItem alignStructs = new JMenuItem();
291
292   JMenuItem backGround = new JMenuItem();
293
294   protected JRadioButtonMenuItem seqColour = new JRadioButtonMenuItem();
295
296   protected JRadioButtonMenuItem chainColour = new JRadioButtonMenuItem();
297
298   protected JRadioButtonMenuItem chargeColour = new JRadioButtonMenuItem();
299
300   protected JRadioButtonMenuItem zappoColour = new JRadioButtonMenuItem();
301
302   protected JRadioButtonMenuItem taylorColour = new JRadioButtonMenuItem();
303
304   protected JRadioButtonMenuItem hydroColour = new JRadioButtonMenuItem();
305
306   protected JRadioButtonMenuItem strandColour = new JRadioButtonMenuItem();
307
308   protected JRadioButtonMenuItem helixColour = new JRadioButtonMenuItem();
309
310   protected JRadioButtonMenuItem turnColour = new JRadioButtonMenuItem();
311
312   protected JRadioButtonMenuItem buriedColour = new JRadioButtonMenuItem();
313   
314   protected JRadioButtonMenuItem purinePyrimidineColour = new JRadioButtonMenuItem();
315   
316
317   protected JRadioButtonMenuItem userColour = new JRadioButtonMenuItem();
318
319   protected JRadioButtonMenuItem jmolColour = new JRadioButtonMenuItem();
320
321   protected ButtonGroup colourButtons = new ButtonGroup();
322
323   JMenu helpMenu = new JMenu();
324
325   JMenuItem jmolHelp = new JMenuItem();
326
327   public void pdbFile_actionPerformed(ActionEvent actionEvent)
328   {
329
330   }
331
332   public void png_actionPerformed(ActionEvent actionEvent)
333   {
334
335   }
336
337   public void eps_actionPerformed(ActionEvent actionEvent)
338   {
339
340   }
341
342   public void viewMapping_actionPerformed(ActionEvent actionEvent)
343   {
344
345   }
346
347   public void seqColour_actionPerformed(ActionEvent actionEvent)
348   {
349
350   }
351
352   public void chainColour_actionPerformed(ActionEvent actionEvent)
353   {
354
355   }
356
357   public void chargeColour_actionPerformed(ActionEvent actionEvent)
358   {
359
360   }
361
362   public void zappoColour_actionPerformed(ActionEvent actionEvent)
363   {
364
365   }
366
367   public void taylorColour_actionPerformed(ActionEvent actionEvent)
368   {
369
370   }
371
372   public void hydroColour_actionPerformed(ActionEvent actionEvent)
373   {
374
375   }
376
377   public void helixColour_actionPerformed(ActionEvent actionEvent)
378   {
379
380   }
381
382   public void strandColour_actionPerformed(ActionEvent actionEvent)
383   {
384
385   }
386
387   public void turnColour_actionPerformed(ActionEvent actionEvent)
388   {
389
390   }
391
392   public void buriedColour_actionPerformed(ActionEvent actionEvent)
393   {
394
395   }
396   
397   public void purinePyrimidineColour_actionPerformed(ActionEvent actionEvent)
398   {
399
400   }
401
402   public void userColour_actionPerformed(ActionEvent actionEvent)
403   {
404
405   }
406
407   public void backGround_actionPerformed(ActionEvent actionEvent)
408   {
409
410   }
411
412   public void jmolHelp_actionPerformed(ActionEvent actionEvent)
413   {
414
415   }
416 }