58b2eb1887f1ac86093698b544998d67bf725604
[jalview.git] / src / jalview / jbgui / GStructureViewer.java
1 /*
2  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.2)
3  * Copyright (C) 2014 The Jalview Authors
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
10  * of the License, or (at your option) any later version.
11  *  
12  * Jalview is distributed in the hope that it will be useful, but 
13  * WITHOUT ANY WARRANTY; without even the implied warranty 
14  * of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
15  * PURPOSE.  See the GNU General Public License for more details.
16  * 
17  * You should have received a copy of the GNU General Public License
18  * along with Jalview.  If not, see <http://www.gnu.org/licenses/>.
19  * The Jalview Authors are detailed in the 'AUTHORS' file.
20  */
21 package jalview.jbgui;
22
23 import jalview.util.MessageManager;
24
25 import java.awt.event.ActionEvent;
26 import java.awt.event.ActionListener;
27
28 import javax.swing.ButtonGroup;
29 import javax.swing.JInternalFrame;
30 import javax.swing.JMenu;
31 import javax.swing.JMenuBar;
32 import javax.swing.JMenuItem;
33 import javax.swing.JRadioButtonMenuItem;
34
35 public class GStructureViewer extends JInternalFrame
36 {
37   public GStructureViewer()
38   {
39     try
40     {
41       jbInit();
42     } catch (Exception ex)
43     {
44       ex.printStackTrace();
45     }
46   }
47
48   private void jbInit() throws Exception
49   {
50     this.setJMenuBar(menuBar);
51     fileMenu.setText(MessageManager.getString("action.file"));
52     savemenu.setActionCommand(MessageManager.getString("action.save_image"));
53     savemenu.setText(MessageManager.getString("action.save_as"));
54     pdbFile.setText(MessageManager.getString("label.pdb_file"));
55     pdbFile.addActionListener(new ActionListener()
56     {
57       public void actionPerformed(ActionEvent actionEvent)
58       {
59         pdbFile_actionPerformed(actionEvent);
60       }
61     });
62     png.setText("PNG");
63     png.addActionListener(new ActionListener()
64     {
65       public void actionPerformed(ActionEvent actionEvent)
66       {
67         png_actionPerformed(actionEvent);
68       }
69     });
70     eps.setText("EPS");
71     eps.addActionListener(new ActionListener()
72     {
73       public void actionPerformed(ActionEvent actionEvent)
74       {
75         eps_actionPerformed(actionEvent);
76       }
77     });
78     viewMapping.setText(MessageManager.getString("label.view_mapping"));
79     viewMapping.addActionListener(new ActionListener()
80     {
81       public void actionPerformed(ActionEvent actionEvent)
82       {
83         viewMapping_actionPerformed(actionEvent);
84       }
85     });
86     viewMenu.setText(MessageManager.getString("action.view"));
87     chainMenu.setText(MessageManager.getString("action.show_chain"));
88     colourMenu.setText(MessageManager.getString("label.colours"));
89     backGround.setText(MessageManager.getString("label.background_colour")
90             + "...");
91     backGround.addActionListener(new ActionListener()
92     {
93       public void actionPerformed(ActionEvent actionEvent)
94       {
95         backGround_actionPerformed(actionEvent);
96       }
97     });
98     seqColour.setSelected(false);
99     seqColour.setText(MessageManager.getString("action.by_sequence"));
100     seqColour.addActionListener(new ActionListener()
101     {
102       public void actionPerformed(ActionEvent actionEvent)
103       {
104         seqColour_actionPerformed(actionEvent);
105       }
106     });
107     chainColour.setText(MessageManager.getString("action.by_chain"));
108     chainColour.addActionListener(new ActionListener()
109     {
110       public void actionPerformed(ActionEvent actionEvent)
111       {
112         chainColour_actionPerformed(actionEvent);
113       }
114     });
115     chargeColour.setText(MessageManager.getString("label.charge_cysteine"));
116     chargeColour.addActionListener(new ActionListener()
117     {
118       public void actionPerformed(ActionEvent actionEvent)
119       {
120         chargeColour_actionPerformed(actionEvent);
121       }
122     });
123     zappoColour.setText(MessageManager.getString("label.zappo"));
124     zappoColour.addActionListener(new ActionListener()
125     {
126       public void actionPerformed(ActionEvent actionEvent)
127       {
128         zappoColour_actionPerformed(actionEvent);
129       }
130     });
131     taylorColour.setText(MessageManager.getString("label.taylor"));
132     taylorColour.addActionListener(new ActionListener()
133     {
134       public void actionPerformed(ActionEvent actionEvent)
135       {
136         taylorColour_actionPerformed(actionEvent);
137       }
138     });
139     hydroColour.setText(MessageManager.getString("label.hydrophobicity"));
140     hydroColour.addActionListener(new ActionListener()
141     {
142       public void actionPerformed(ActionEvent actionEvent)
143       {
144         hydroColour_actionPerformed(actionEvent);
145       }
146     });
147     strandColour.setText(MessageManager
148             .getString("label.strand_propensity"));
149     strandColour.addActionListener(new ActionListener()
150     {
151       public void actionPerformed(ActionEvent actionEvent)
152       {
153         strandColour_actionPerformed(actionEvent);
154       }
155     });
156     helixColour.setText(MessageManager.getString("label.helix_propensity"));
157     helixColour.addActionListener(new ActionListener()
158     {
159       public void actionPerformed(ActionEvent actionEvent)
160       {
161         helixColour_actionPerformed(actionEvent);
162       }
163     });
164     turnColour.setText(MessageManager.getString("label.turn_propensity"));
165     turnColour.addActionListener(new ActionListener()
166     {
167       public void actionPerformed(ActionEvent actionEvent)
168       {
169         turnColour_actionPerformed(actionEvent);
170       }
171     });
172     buriedColour.setText(MessageManager.getString("label.buried_index"));
173     buriedColour.addActionListener(new ActionListener()
174     {
175       public void actionPerformed(ActionEvent actionEvent)
176       {
177         buriedColour_actionPerformed(actionEvent);
178       }
179     });
180     purinePyrimidineColour.setText(MessageManager
181             .getString("label.purine_pyrimidine"));
182     purinePyrimidineColour.addActionListener(new ActionListener()
183     {
184       public void actionPerformed(ActionEvent actionEvent)
185       {
186         purinePyrimidineColour_actionPerformed(actionEvent);
187       }
188     });
189
190     userColour.setText(MessageManager.getString("action.user_defined"));
191     userColour.addActionListener(new ActionListener()
192     {
193       public void actionPerformed(ActionEvent actionEvent)
194       {
195         userColour_actionPerformed(actionEvent);
196       }
197     });
198     viewerColour.setSelected(false);
199     viewerColour
200             .setText(MessageManager.getString("label.colour_with_jmol"));
201     viewerColour.setToolTipText(MessageManager
202             .getString("label.let_jmol_manage_structure_colours"));
203     viewerColour.addActionListener(new ActionListener()
204     {
205       public void actionPerformed(ActionEvent actionEvent)
206       {
207         viewerColour_actionPerformed(actionEvent);
208       }
209     });
210     helpMenu.setText(MessageManager.getString("action.help"));
211     helpItem.setText(MessageManager.getString("label.jmol_help"));
212     helpItem.addActionListener(new ActionListener()
213     {
214       public void actionPerformed(ActionEvent actionEvent)
215       {
216         showHelp_actionPerformed(actionEvent);
217       }
218     });
219     alignStructs
220             .setText(MessageManager.getString("label.align_structures"));
221     alignStructs.addActionListener(new ActionListener()
222     {
223       public void actionPerformed(ActionEvent actionEvent)
224       {
225         alignStructs_actionPerformed(actionEvent);
226       }
227     });
228     viewerActionMenu.setText(MessageManager.getString("label.jmol"));
229     menuBar.add(fileMenu);
230     menuBar.add(viewMenu);
231     menuBar.add(colourMenu);
232     menuBar.add(viewerActionMenu);
233     viewerActionMenu.setVisible(false);
234     menuBar.add(helpMenu);
235     fileMenu.add(savemenu);
236     fileMenu.add(viewMapping);
237     savemenu.add(pdbFile);
238     savemenu.add(png);
239     savemenu.add(eps);
240     viewMenu.add(chainMenu);
241
242     colourMenu.add(seqColour);
243     colourMenu.add(chainColour);
244     colourMenu.add(chargeColour);
245     colourMenu.add(zappoColour);
246     colourMenu.add(taylorColour);
247     colourMenu.add(hydroColour);
248     colourMenu.add(helixColour);
249     colourMenu.add(strandColour);
250     colourMenu.add(turnColour);
251     colourMenu.add(buriedColour);
252     colourMenu.add(purinePyrimidineColour);
253     colourMenu.add(userColour);
254     colourMenu.add(viewerColour);
255     colourMenu.add(backGround);
256
257     colourButtons.add(seqColour);
258     colourButtons.add(chainColour);
259     colourButtons.add(chargeColour);
260     colourButtons.add(zappoColour);
261     colourButtons.add(taylorColour);
262     colourButtons.add(hydroColour);
263     colourButtons.add(helixColour);
264     colourButtons.add(strandColour);
265     colourButtons.add(turnColour);
266     colourButtons.add(buriedColour);
267     colourButtons.add(userColour);
268     colourButtons.add(viewerColour);
269
270     helpMenu.add(helpItem);
271     viewerActionMenu.add(alignStructs);
272   }
273
274   protected void viewerColour_actionPerformed(ActionEvent actionEvent)
275   {
276   }
277
278   protected void alignStructs_actionPerformed(ActionEvent actionEvent)
279   {
280   }
281
282   JMenuBar menuBar = new JMenuBar();
283
284   JMenu fileMenu = new JMenu();
285
286   protected JMenu savemenu = new JMenu();
287
288   JMenuItem pdbFile = new JMenuItem();
289
290   JMenuItem png = new JMenuItem();
291
292   JMenuItem eps = new JMenuItem();
293
294   JMenuItem viewMapping = new JMenuItem();
295
296   protected JMenu viewMenu = new JMenu();
297
298   protected JMenu chainMenu = new JMenu();
299
300   JMenu jMenu1 = new JMenu();
301
302   protected JMenu colourMenu = new JMenu();
303
304   protected JMenu viewerActionMenu = new JMenu();
305
306   protected JMenuItem alignStructs = new JMenuItem();
307
308   JMenuItem backGround = new JMenuItem();
309
310   protected JRadioButtonMenuItem seqColour = new JRadioButtonMenuItem();
311
312   protected JRadioButtonMenuItem chainColour = new JRadioButtonMenuItem();
313
314   protected JRadioButtonMenuItem chargeColour = new JRadioButtonMenuItem();
315
316   protected JRadioButtonMenuItem zappoColour = new JRadioButtonMenuItem();
317
318   protected JRadioButtonMenuItem taylorColour = new JRadioButtonMenuItem();
319
320   protected JRadioButtonMenuItem hydroColour = new JRadioButtonMenuItem();
321
322   protected JRadioButtonMenuItem strandColour = new JRadioButtonMenuItem();
323
324   protected JRadioButtonMenuItem helixColour = new JRadioButtonMenuItem();
325
326   protected JRadioButtonMenuItem turnColour = new JRadioButtonMenuItem();
327
328   protected JRadioButtonMenuItem buriedColour = new JRadioButtonMenuItem();
329
330   protected JRadioButtonMenuItem purinePyrimidineColour = new JRadioButtonMenuItem();
331
332   protected JRadioButtonMenuItem userColour = new JRadioButtonMenuItem();
333
334   protected JRadioButtonMenuItem viewerColour = new JRadioButtonMenuItem();
335
336   protected ButtonGroup colourButtons = new ButtonGroup();
337
338   JMenu helpMenu = new JMenu();
339
340   protected JMenuItem helpItem = new JMenuItem();
341
342   public void pdbFile_actionPerformed(ActionEvent actionEvent)
343   {
344
345   }
346
347   public void png_actionPerformed(ActionEvent actionEvent)
348   {
349
350   }
351
352   public void eps_actionPerformed(ActionEvent actionEvent)
353   {
354
355   }
356
357   public void viewMapping_actionPerformed(ActionEvent actionEvent)
358   {
359
360   }
361
362   public void seqColour_actionPerformed(ActionEvent actionEvent)
363   {
364
365   }
366
367   public void chainColour_actionPerformed(ActionEvent actionEvent)
368   {
369
370   }
371
372   public void chargeColour_actionPerformed(ActionEvent actionEvent)
373   {
374
375   }
376
377   public void zappoColour_actionPerformed(ActionEvent actionEvent)
378   {
379
380   }
381
382   public void taylorColour_actionPerformed(ActionEvent actionEvent)
383   {
384
385   }
386
387   public void hydroColour_actionPerformed(ActionEvent actionEvent)
388   {
389
390   }
391
392   public void helixColour_actionPerformed(ActionEvent actionEvent)
393   {
394
395   }
396
397   public void strandColour_actionPerformed(ActionEvent actionEvent)
398   {
399
400   }
401
402   public void turnColour_actionPerformed(ActionEvent actionEvent)
403   {
404
405   }
406
407   public void buriedColour_actionPerformed(ActionEvent actionEvent)
408   {
409
410   }
411
412   public void purinePyrimidineColour_actionPerformed(ActionEvent actionEvent)
413   {
414
415   }
416
417   public void userColour_actionPerformed(ActionEvent actionEvent)
418   {
419
420   }
421
422   public void backGround_actionPerformed(ActionEvent actionEvent)
423   {
424
425   }
426
427   public void showHelp_actionPerformed(ActionEvent actionEvent)
428   {
429
430   }
431 }