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;
26 import java.awt.event.ActionListener;
27 import java.awt.event.ActionEvent;
29 public class GStructureViewer extends JInternalFrame
31 public GStructureViewer()
36 } catch (Exception ex)
42 private void jbInit() throws Exception
44 this.setJMenuBar(menuBar);
45 fileMenu.setText(MessageManager.getString("action.file"));
46 savemenu.setActionCommand(MessageManager.getString("action.save_image"));
47 savemenu.setText(MessageManager.getString("action.save_as"));
48 pdbFile.setText(MessageManager.getString("label.pdb_file"));
49 pdbFile.addActionListener(new ActionListener()
51 public void actionPerformed(ActionEvent actionEvent)
53 pdbFile_actionPerformed(actionEvent);
57 png.addActionListener(new ActionListener()
59 public void actionPerformed(ActionEvent actionEvent)
61 png_actionPerformed(actionEvent);
65 eps.addActionListener(new ActionListener()
67 public void actionPerformed(ActionEvent actionEvent)
69 eps_actionPerformed(actionEvent);
72 viewMapping.setText(MessageManager.getString("label.view_mapping"));
73 viewMapping.addActionListener(new ActionListener()
75 public void actionPerformed(ActionEvent actionEvent)
77 viewMapping_actionPerformed(actionEvent);
80 viewMenu.setText(MessageManager.getString("action.view"));
81 chainMenu.setText(MessageManager.getString("action.show_chain"));
82 colourMenu.setText(MessageManager.getString("label.colours"));
83 backGround.setText(MessageManager.getString("label.background_colour")
85 backGround.addActionListener(new ActionListener()
87 public void actionPerformed(ActionEvent actionEvent)
89 backGround_actionPerformed(actionEvent);
92 seqColour.setSelected(false);
93 seqColour.setText(MessageManager.getString("action.by_sequence"));
94 seqColour.addActionListener(new ActionListener()
96 public void actionPerformed(ActionEvent actionEvent)
98 seqColour_actionPerformed(actionEvent);
101 chainColour.setText(MessageManager.getString("action.by_chain"));
102 chainColour.addActionListener(new ActionListener()
104 public void actionPerformed(ActionEvent actionEvent)
106 chainColour_actionPerformed(actionEvent);
109 chargeColour.setText(MessageManager.getString("label.charge_cysteine"));
110 chargeColour.addActionListener(new ActionListener()
112 public void actionPerformed(ActionEvent actionEvent)
114 chargeColour_actionPerformed(actionEvent);
117 zappoColour.setText(MessageManager.getString("label.zappo"));
118 zappoColour.addActionListener(new ActionListener()
120 public void actionPerformed(ActionEvent actionEvent)
122 zappoColour_actionPerformed(actionEvent);
125 taylorColour.setText(MessageManager.getString("label.taylor"));
126 taylorColour.addActionListener(new ActionListener()
128 public void actionPerformed(ActionEvent actionEvent)
130 taylorColour_actionPerformed(actionEvent);
133 hydroColour.setText(MessageManager.getString("label.hydrophobicity"));
134 hydroColour.addActionListener(new ActionListener()
136 public void actionPerformed(ActionEvent actionEvent)
138 hydroColour_actionPerformed(actionEvent);
141 strandColour.setText(MessageManager
142 .getString("label.strand_propensity"));
143 strandColour.addActionListener(new ActionListener()
145 public void actionPerformed(ActionEvent actionEvent)
147 strandColour_actionPerformed(actionEvent);
150 helixColour.setText(MessageManager.getString("label.helix_propensity"));
151 helixColour.addActionListener(new ActionListener()
153 public void actionPerformed(ActionEvent actionEvent)
155 helixColour_actionPerformed(actionEvent);
158 turnColour.setText(MessageManager.getString("label.turn_propensity"));
159 turnColour.addActionListener(new ActionListener()
161 public void actionPerformed(ActionEvent actionEvent)
163 turnColour_actionPerformed(actionEvent);
166 buriedColour.setText(MessageManager.getString("label.buried_index"));
167 buriedColour.addActionListener(new ActionListener()
169 public void actionPerformed(ActionEvent actionEvent)
171 buriedColour_actionPerformed(actionEvent);
174 purinePyrimidineColour.setText(MessageManager
175 .getString("label.purine_pyrimidine"));
176 purinePyrimidineColour.addActionListener(new ActionListener()
178 public void actionPerformed(ActionEvent actionEvent)
180 purinePyrimidineColour_actionPerformed(actionEvent);
184 userColour.setText(MessageManager.getString("action.user_defined"));
185 userColour.addActionListener(new ActionListener()
187 public void actionPerformed(ActionEvent actionEvent)
189 userColour_actionPerformed(actionEvent);
192 jmolColour.setSelected(false);
193 jmolColour.setText(MessageManager.getString("label.colour_with_jmol"));
194 jmolColour.setToolTipText(MessageManager
195 .getString("label.let_jmol_manage_structure_colours"));
196 jmolColour.addActionListener(new ActionListener()
198 public void actionPerformed(ActionEvent actionEvent)
200 jmolColour_actionPerformed(actionEvent);
203 helpMenu.setText(MessageManager.getString("action.help"));
204 jmolHelp.setText(MessageManager.getString("label.jmol_help"));
205 jmolHelp.addActionListener(new ActionListener()
207 public void actionPerformed(ActionEvent actionEvent)
209 jmolHelp_actionPerformed(actionEvent);
213 .setText(MessageManager.getString("label.align_structures"));
214 alignStructs.addActionListener(new ActionListener()
216 public void actionPerformed(ActionEvent actionEvent)
218 alignStructs_actionPerformed(actionEvent);
221 jmolActionMenu.setText(MessageManager.getString("label.jmol"));
222 menuBar.add(fileMenu);
223 menuBar.add(viewMenu);
224 menuBar.add(colourMenu);
225 menuBar.add(jmolActionMenu);
226 jmolActionMenu.setVisible(false);
227 menuBar.add(helpMenu);
228 fileMenu.add(savemenu);
229 fileMenu.add(viewMapping);
230 savemenu.add(pdbFile);
233 viewMenu.add(chainMenu);
235 colourMenu.add(seqColour);
236 colourMenu.add(chainColour);
237 colourMenu.add(chargeColour);
238 colourMenu.add(zappoColour);
239 colourMenu.add(taylorColour);
240 colourMenu.add(hydroColour);
241 colourMenu.add(helixColour);
242 colourMenu.add(strandColour);
243 colourMenu.add(turnColour);
244 colourMenu.add(buriedColour);
245 colourMenu.add(purinePyrimidineColour);
246 colourMenu.add(userColour);
247 colourMenu.add(jmolColour);
248 colourMenu.add(backGround);
250 colourButtons.add(seqColour);
251 colourButtons.add(chainColour);
252 colourButtons.add(chargeColour);
253 colourButtons.add(zappoColour);
254 colourButtons.add(taylorColour);
255 colourButtons.add(hydroColour);
256 colourButtons.add(helixColour);
257 colourButtons.add(strandColour);
258 colourButtons.add(turnColour);
259 colourButtons.add(buriedColour);
260 colourButtons.add(userColour);
261 colourButtons.add(jmolColour);
263 helpMenu.add(jmolHelp);
264 jmolActionMenu.add(alignStructs);
267 protected void jmolColour_actionPerformed(ActionEvent actionEvent)
271 protected void alignStructs_actionPerformed(ActionEvent actionEvent)
275 JMenuBar menuBar = new JMenuBar();
277 JMenu fileMenu = new JMenu();
279 JMenu savemenu = new JMenu();
281 JMenuItem pdbFile = new JMenuItem();
283 JMenuItem png = new JMenuItem();
285 JMenuItem eps = new JMenuItem();
287 JMenuItem viewMapping = new JMenuItem();
289 protected JMenu viewMenu = new JMenu();
291 protected JMenu chainMenu = new JMenu();
293 JMenu jMenu1 = new JMenu();
295 protected JMenu colourMenu = new JMenu();
297 protected JMenu jmolActionMenu = new JMenu();
299 protected JMenuItem alignStructs = new JMenuItem();
301 JMenuItem backGround = new JMenuItem();
303 protected JRadioButtonMenuItem seqColour = new JRadioButtonMenuItem();
305 protected JRadioButtonMenuItem chainColour = new JRadioButtonMenuItem();
307 protected JRadioButtonMenuItem chargeColour = new JRadioButtonMenuItem();
309 protected JRadioButtonMenuItem zappoColour = new JRadioButtonMenuItem();
311 protected JRadioButtonMenuItem taylorColour = new JRadioButtonMenuItem();
313 protected JRadioButtonMenuItem hydroColour = new JRadioButtonMenuItem();
315 protected JRadioButtonMenuItem strandColour = new JRadioButtonMenuItem();
317 protected JRadioButtonMenuItem helixColour = new JRadioButtonMenuItem();
319 protected JRadioButtonMenuItem turnColour = new JRadioButtonMenuItem();
321 protected JRadioButtonMenuItem buriedColour = new JRadioButtonMenuItem();
323 protected JRadioButtonMenuItem purinePyrimidineColour = new JRadioButtonMenuItem();
325 protected JRadioButtonMenuItem userColour = new JRadioButtonMenuItem();
327 protected JRadioButtonMenuItem jmolColour = new JRadioButtonMenuItem();
329 protected ButtonGroup colourButtons = new ButtonGroup();
331 JMenu helpMenu = new JMenu();
333 JMenuItem jmolHelp = new JMenuItem();
335 public void pdbFile_actionPerformed(ActionEvent actionEvent)
340 public void png_actionPerformed(ActionEvent actionEvent)
345 public void eps_actionPerformed(ActionEvent actionEvent)
350 public void viewMapping_actionPerformed(ActionEvent actionEvent)
355 public void seqColour_actionPerformed(ActionEvent actionEvent)
360 public void chainColour_actionPerformed(ActionEvent actionEvent)
365 public void chargeColour_actionPerformed(ActionEvent actionEvent)
370 public void zappoColour_actionPerformed(ActionEvent actionEvent)
375 public void taylorColour_actionPerformed(ActionEvent actionEvent)
380 public void hydroColour_actionPerformed(ActionEvent actionEvent)
385 public void helixColour_actionPerformed(ActionEvent actionEvent)
390 public void strandColour_actionPerformed(ActionEvent actionEvent)
395 public void turnColour_actionPerformed(ActionEvent actionEvent)
400 public void buriedColour_actionPerformed(ActionEvent actionEvent)
405 public void purinePyrimidineColour_actionPerformed(ActionEvent actionEvent)
410 public void userColour_actionPerformed(ActionEvent actionEvent)
415 public void backGround_actionPerformed(ActionEvent actionEvent)
420 public void jmolHelp_actionPerformed(ActionEvent actionEvent)