2 * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.2)
3 * Copyright (C) 2014 The Jalview Authors
5 * This file is part of Jalview.
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.
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.
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.
21 package jalview.jbgui;
23 import jalview.util.MessageManager;
25 import java.awt.event.ActionEvent;
26 import java.awt.event.ActionListener;
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;
35 public class GStructureViewer extends JInternalFrame
37 public GStructureViewer()
42 } catch (Exception ex)
48 private void jbInit() throws Exception
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()
57 public void actionPerformed(ActionEvent actionEvent)
59 pdbFile_actionPerformed(actionEvent);
63 png.addActionListener(new ActionListener()
65 public void actionPerformed(ActionEvent actionEvent)
67 png_actionPerformed(actionEvent);
71 eps.addActionListener(new ActionListener()
73 public void actionPerformed(ActionEvent actionEvent)
75 eps_actionPerformed(actionEvent);
78 viewMapping.setText(MessageManager.getString("label.view_mapping"));
79 viewMapping.addActionListener(new ActionListener()
81 public void actionPerformed(ActionEvent actionEvent)
83 viewMapping_actionPerformed(actionEvent);
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")
91 backGround.addActionListener(new ActionListener()
93 public void actionPerformed(ActionEvent actionEvent)
95 backGround_actionPerformed(actionEvent);
98 seqColour.setSelected(false);
99 seqColour.setText(MessageManager.getString("action.by_sequence"));
100 seqColour.addActionListener(new ActionListener()
102 public void actionPerformed(ActionEvent actionEvent)
104 seqColour_actionPerformed(actionEvent);
107 chainColour.setText(MessageManager.getString("action.by_chain"));
108 chainColour.addActionListener(new ActionListener()
110 public void actionPerformed(ActionEvent actionEvent)
112 chainColour_actionPerformed(actionEvent);
115 chargeColour.setText(MessageManager.getString("label.charge_cysteine"));
116 chargeColour.addActionListener(new ActionListener()
118 public void actionPerformed(ActionEvent actionEvent)
120 chargeColour_actionPerformed(actionEvent);
123 zappoColour.setText(MessageManager.getString("label.zappo"));
124 zappoColour.addActionListener(new ActionListener()
126 public void actionPerformed(ActionEvent actionEvent)
128 zappoColour_actionPerformed(actionEvent);
131 taylorColour.setText(MessageManager.getString("label.taylor"));
132 taylorColour.addActionListener(new ActionListener()
134 public void actionPerformed(ActionEvent actionEvent)
136 taylorColour_actionPerformed(actionEvent);
139 hydroColour.setText(MessageManager.getString("label.hydrophobicity"));
140 hydroColour.addActionListener(new ActionListener()
142 public void actionPerformed(ActionEvent actionEvent)
144 hydroColour_actionPerformed(actionEvent);
147 strandColour.setText(MessageManager
148 .getString("label.strand_propensity"));
149 strandColour.addActionListener(new ActionListener()
151 public void actionPerformed(ActionEvent actionEvent)
153 strandColour_actionPerformed(actionEvent);
156 helixColour.setText(MessageManager.getString("label.helix_propensity"));
157 helixColour.addActionListener(new ActionListener()
159 public void actionPerformed(ActionEvent actionEvent)
161 helixColour_actionPerformed(actionEvent);
164 turnColour.setText(MessageManager.getString("label.turn_propensity"));
165 turnColour.addActionListener(new ActionListener()
167 public void actionPerformed(ActionEvent actionEvent)
169 turnColour_actionPerformed(actionEvent);
172 buriedColour.setText(MessageManager.getString("label.buried_index"));
173 buriedColour.addActionListener(new ActionListener()
175 public void actionPerformed(ActionEvent actionEvent)
177 buriedColour_actionPerformed(actionEvent);
180 purinePyrimidineColour.setText(MessageManager
181 .getString("label.purine_pyrimidine"));
182 purinePyrimidineColour.addActionListener(new ActionListener()
184 public void actionPerformed(ActionEvent actionEvent)
186 purinePyrimidineColour_actionPerformed(actionEvent);
190 userColour.setText(MessageManager.getString("action.user_defined"));
191 userColour.addActionListener(new ActionListener()
193 public void actionPerformed(ActionEvent actionEvent)
195 userColour_actionPerformed(actionEvent);
198 viewerColour.setSelected(false);
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()
205 public void actionPerformed(ActionEvent actionEvent)
207 viewerColour_actionPerformed(actionEvent);
210 helpMenu.setText(MessageManager.getString("action.help"));
211 helpItem.setText(MessageManager.getString("label.jmol_help"));
212 helpItem.addActionListener(new ActionListener()
214 public void actionPerformed(ActionEvent actionEvent)
216 showHelp_actionPerformed(actionEvent);
220 .setText(MessageManager.getString("label.align_structures"));
221 alignStructs.addActionListener(new ActionListener()
223 public void actionPerformed(ActionEvent actionEvent)
225 alignStructs_actionPerformed(actionEvent);
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);
240 viewMenu.add(chainMenu);
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);
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);
270 helpMenu.add(helpItem);
271 viewerActionMenu.add(alignStructs);
274 protected void viewerColour_actionPerformed(ActionEvent actionEvent)
278 protected void alignStructs_actionPerformed(ActionEvent actionEvent)
282 JMenuBar menuBar = new JMenuBar();
284 JMenu fileMenu = new JMenu();
286 protected JMenu savemenu = new JMenu();
288 JMenuItem pdbFile = new JMenuItem();
290 JMenuItem png = new JMenuItem();
292 JMenuItem eps = new JMenuItem();
294 JMenuItem viewMapping = new JMenuItem();
296 protected JMenu viewMenu = new JMenu();
298 protected JMenu chainMenu = new JMenu();
300 JMenu jMenu1 = new JMenu();
302 protected JMenu colourMenu = new JMenu();
304 protected JMenu viewerActionMenu = new JMenu();
306 protected JMenuItem alignStructs = new JMenuItem();
308 JMenuItem backGround = new JMenuItem();
310 protected JRadioButtonMenuItem seqColour = new JRadioButtonMenuItem();
312 protected JRadioButtonMenuItem chainColour = new JRadioButtonMenuItem();
314 protected JRadioButtonMenuItem chargeColour = new JRadioButtonMenuItem();
316 protected JRadioButtonMenuItem zappoColour = new JRadioButtonMenuItem();
318 protected JRadioButtonMenuItem taylorColour = new JRadioButtonMenuItem();
320 protected JRadioButtonMenuItem hydroColour = new JRadioButtonMenuItem();
322 protected JRadioButtonMenuItem strandColour = new JRadioButtonMenuItem();
324 protected JRadioButtonMenuItem helixColour = new JRadioButtonMenuItem();
326 protected JRadioButtonMenuItem turnColour = new JRadioButtonMenuItem();
328 protected JRadioButtonMenuItem buriedColour = new JRadioButtonMenuItem();
330 protected JRadioButtonMenuItem purinePyrimidineColour = new JRadioButtonMenuItem();
332 protected JRadioButtonMenuItem userColour = new JRadioButtonMenuItem();
334 protected JRadioButtonMenuItem viewerColour = new JRadioButtonMenuItem();
336 protected ButtonGroup colourButtons = new ButtonGroup();
338 JMenu helpMenu = new JMenu();
340 protected JMenuItem helpItem = new JMenuItem();
342 public void pdbFile_actionPerformed(ActionEvent actionEvent)
347 public void png_actionPerformed(ActionEvent actionEvent)
352 public void eps_actionPerformed(ActionEvent actionEvent)
357 public void viewMapping_actionPerformed(ActionEvent actionEvent)
362 public void seqColour_actionPerformed(ActionEvent actionEvent)
367 public void chainColour_actionPerformed(ActionEvent actionEvent)
372 public void chargeColour_actionPerformed(ActionEvent actionEvent)
377 public void zappoColour_actionPerformed(ActionEvent actionEvent)
382 public void taylorColour_actionPerformed(ActionEvent actionEvent)
387 public void hydroColour_actionPerformed(ActionEvent actionEvent)
392 public void helixColour_actionPerformed(ActionEvent actionEvent)
397 public void strandColour_actionPerformed(ActionEvent actionEvent)
402 public void turnColour_actionPerformed(ActionEvent actionEvent)
407 public void buriedColour_actionPerformed(ActionEvent actionEvent)
412 public void purinePyrimidineColour_actionPerformed(ActionEvent actionEvent)
417 public void userColour_actionPerformed(ActionEvent actionEvent)
422 public void backGround_actionPerformed(ActionEvent actionEvent)
427 public void showHelp_actionPerformed(ActionEvent actionEvent)