JAL-1355 (basic i18n support)
[jalview.git] / src / jalview / jbgui / GStructureViewer.java
1 /*
2  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8)
3  * Copyright (C) 2012 J Procter, AM Waterhouse, LM Lui, J Engelhardt, 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 jalview.util.MessageManager;
21
22 import javax.swing.*;
23 import java.awt.event.ActionListener;
24 import java.awt.event.ActionEvent;
25
26 public class GStructureViewer extends JInternalFrame
27 {
28   public GStructureViewer()
29   {
30     try
31     {
32       jbInit();
33     } catch (Exception ex)
34     {
35       ex.printStackTrace();
36     }
37   }
38
39   private void jbInit() throws Exception
40   {
41     this.setJMenuBar(menuBar);
42     fileMenu.setText(MessageManager.getString("action.file"));
43     savemenu.setActionCommand(MessageManager.getString("action.save_image"));
44     savemenu.setText(MessageManager.getString("action.save_as"));
45     pdbFile.setText(MessageManager.getString("label.pdb_file"));
46     pdbFile.addActionListener(new ActionListener()
47     {
48       public void actionPerformed(ActionEvent actionEvent)
49       {
50         pdbFile_actionPerformed(actionEvent);
51       }
52     });
53     png.setText("PNG");
54     png.addActionListener(new ActionListener()
55     {
56       public void actionPerformed(ActionEvent actionEvent)
57       {
58         png_actionPerformed(actionEvent);
59       }
60     });
61     eps.setText("EPS");
62     eps.addActionListener(new ActionListener()
63     {
64       public void actionPerformed(ActionEvent actionEvent)
65       {
66         eps_actionPerformed(actionEvent);
67       }
68     });
69     viewMapping.setText(MessageManager.getString("label.view_mapping"));
70     viewMapping.addActionListener(new ActionListener()
71     {
72       public void actionPerformed(ActionEvent actionEvent)
73       {
74         viewMapping_actionPerformed(actionEvent);
75       }
76     });
77     viewMenu.setText(MessageManager.getString("action.view"));
78     chainMenu.setText(MessageManager.getString("action.show_chain"));
79     colourMenu.setText(MessageManager.getString("label.colours"));
80     backGround.setText(MessageManager.getString("label.background_colour") + "...");
81     backGround.addActionListener(new ActionListener()
82     {
83       public void actionPerformed(ActionEvent actionEvent)
84       {
85         backGround_actionPerformed(actionEvent);
86       }
87     });
88     seqColour.setSelected(false);
89     seqColour.setText(MessageManager.getString("action.by_sequence"));
90     seqColour.addActionListener(new ActionListener()
91     {
92       public void actionPerformed(ActionEvent actionEvent)
93       {
94         seqColour_actionPerformed(actionEvent);
95       }
96     });
97     chainColour.setText(MessageManager.getString("action.by_chain"));
98     chainColour.addActionListener(new ActionListener()
99     {
100       public void actionPerformed(ActionEvent actionEvent)
101       {
102         chainColour_actionPerformed(actionEvent);
103       }
104     });
105     chargeColour.setText(MessageManager.getString("label.charge_cysteine"));
106     chargeColour.addActionListener(new ActionListener()
107     {
108       public void actionPerformed(ActionEvent actionEvent)
109       {
110         chargeColour_actionPerformed(actionEvent);
111       }
112     });
113     zappoColour.setText(MessageManager.getString("label.zappo"));
114     zappoColour.addActionListener(new ActionListener()
115     {
116       public void actionPerformed(ActionEvent actionEvent)
117       {
118         zappoColour_actionPerformed(actionEvent);
119       }
120     });
121     taylorColour.setText(MessageManager.getString("label.taylor"));
122     taylorColour.addActionListener(new ActionListener()
123     {
124       public void actionPerformed(ActionEvent actionEvent)
125       {
126         taylorColour_actionPerformed(actionEvent);
127       }
128     });
129     hydroColour.setText(MessageManager.getString("label.hydrophobicity"));
130     hydroColour.addActionListener(new ActionListener()
131     {
132       public void actionPerformed(ActionEvent actionEvent)
133       {
134         hydroColour_actionPerformed(actionEvent);
135       }
136     });
137     strandColour.setText(MessageManager.getString("label.strand_propensity"));
138     strandColour.addActionListener(new ActionListener()
139     {
140       public void actionPerformed(ActionEvent actionEvent)
141       {
142         strandColour_actionPerformed(actionEvent);
143       }
144     });
145     helixColour.setText(MessageManager.getString("label.helix_propensity"));
146     helixColour.addActionListener(new ActionListener()
147     {
148       public void actionPerformed(ActionEvent actionEvent)
149       {
150         helixColour_actionPerformed(actionEvent);
151       }
152     });
153     turnColour.setText(MessageManager.getString("label.turn_propensity"));
154     turnColour.addActionListener(new ActionListener()
155     {
156       public void actionPerformed(ActionEvent actionEvent)
157       {
158         turnColour_actionPerformed(actionEvent);
159       }
160     });
161     buriedColour.setText(MessageManager.getString("label.buried_index"));
162     buriedColour.addActionListener(new ActionListener()
163     {
164       public void actionPerformed(ActionEvent actionEvent)
165       {
166         buriedColour_actionPerformed(actionEvent);
167       }
168     });
169     purinePyrimidineColour.setText(MessageManager.getString("label.purine_pyrimidine"));
170     purinePyrimidineColour.addActionListener(new ActionListener()
171     {
172       public void actionPerformed(ActionEvent actionEvent)
173       {
174         purinePyrimidineColour_actionPerformed(actionEvent);
175       }
176     });
177
178     userColour.setText(MessageManager.getString("action.user_defined"));
179     userColour.addActionListener(new ActionListener()
180     {
181       public void actionPerformed(ActionEvent actionEvent)
182       {
183         userColour_actionPerformed(actionEvent);
184       }
185     });
186     jmolColour.setSelected(false);
187     jmolColour.setText(MessageManager.getString("label.colour_with_jmol"));
188     jmolColour.setToolTipText(MessageManager.getString("label.let_jmol_manage_structure_colours"));
189     jmolColour.addActionListener(new ActionListener()
190     {
191       public void actionPerformed(ActionEvent actionEvent)
192       {
193         jmolColour_actionPerformed(actionEvent);
194       }
195     });
196     helpMenu.setText(MessageManager.getString("action.help"));
197     jmolHelp.setText(MessageManager.getString("label.jmol_help"));
198     jmolHelp.addActionListener(new ActionListener()
199     {
200       public void actionPerformed(ActionEvent actionEvent)
201       {
202         jmolHelp_actionPerformed(actionEvent);
203       }
204     });
205     alignStructs.setText(MessageManager.getString("label.align_structures"));
206     alignStructs.addActionListener(new ActionListener()
207     {
208       public void actionPerformed(ActionEvent actionEvent)
209       {
210         alignStructs_actionPerformed(actionEvent);
211       }
212     });
213     jmolActionMenu.setText(MessageManager.getString("label.jmol"));
214     menuBar.add(fileMenu);
215     menuBar.add(viewMenu);
216     menuBar.add(colourMenu);
217     menuBar.add(jmolActionMenu);
218     jmolActionMenu.setVisible(false);
219     menuBar.add(helpMenu);
220     fileMenu.add(savemenu);
221     fileMenu.add(viewMapping);
222     savemenu.add(pdbFile);
223     savemenu.add(png);
224     savemenu.add(eps);
225     viewMenu.add(chainMenu);
226
227     colourMenu.add(seqColour);
228     colourMenu.add(chainColour);
229     colourMenu.add(chargeColour);
230     colourMenu.add(zappoColour);
231     colourMenu.add(taylorColour);
232     colourMenu.add(hydroColour);
233     colourMenu.add(helixColour);
234     colourMenu.add(strandColour);
235     colourMenu.add(turnColour);
236     colourMenu.add(buriedColour);
237     colourMenu.add(purinePyrimidineColour);
238     colourMenu.add(userColour);
239     colourMenu.add(jmolColour);
240     colourMenu.add(backGround);
241
242     colourButtons.add(seqColour);
243     colourButtons.add(chainColour);
244     colourButtons.add(chargeColour);
245     colourButtons.add(zappoColour);
246     colourButtons.add(taylorColour);
247     colourButtons.add(hydroColour);
248     colourButtons.add(helixColour);
249     colourButtons.add(strandColour);
250     colourButtons.add(turnColour);
251     colourButtons.add(buriedColour);
252     colourButtons.add(userColour);
253     colourButtons.add(jmolColour);
254
255     helpMenu.add(jmolHelp);
256     jmolActionMenu.add(alignStructs);
257   }
258
259   protected void jmolColour_actionPerformed(ActionEvent actionEvent)
260   {
261   }
262
263   protected void alignStructs_actionPerformed(ActionEvent actionEvent)
264   {
265   }
266
267   JMenuBar menuBar = new JMenuBar();
268
269   JMenu fileMenu = new JMenu();
270
271   JMenu savemenu = new JMenu();
272
273   JMenuItem pdbFile = new JMenuItem();
274
275   JMenuItem png = new JMenuItem();
276
277   JMenuItem eps = new JMenuItem();
278
279   JMenuItem viewMapping = new JMenuItem();
280
281   protected JMenu viewMenu = new JMenu();
282
283   protected JMenu chainMenu = new JMenu();
284
285   JMenu jMenu1 = new JMenu();
286
287   protected JMenu colourMenu = new JMenu();
288
289   protected JMenu jmolActionMenu = new JMenu();
290
291   protected JMenuItem alignStructs = new JMenuItem();
292
293   JMenuItem backGround = new JMenuItem();
294
295   protected JRadioButtonMenuItem seqColour = new JRadioButtonMenuItem();
296
297   protected JRadioButtonMenuItem chainColour = new JRadioButtonMenuItem();
298
299   protected JRadioButtonMenuItem chargeColour = new JRadioButtonMenuItem();
300
301   protected JRadioButtonMenuItem zappoColour = new JRadioButtonMenuItem();
302
303   protected JRadioButtonMenuItem taylorColour = new JRadioButtonMenuItem();
304
305   protected JRadioButtonMenuItem hydroColour = new JRadioButtonMenuItem();
306
307   protected JRadioButtonMenuItem strandColour = new JRadioButtonMenuItem();
308
309   protected JRadioButtonMenuItem helixColour = new JRadioButtonMenuItem();
310
311   protected JRadioButtonMenuItem turnColour = new JRadioButtonMenuItem();
312
313   protected JRadioButtonMenuItem buriedColour = new JRadioButtonMenuItem();
314
315   protected JRadioButtonMenuItem purinePyrimidineColour = new JRadioButtonMenuItem();
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 }