2 * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.0b1)
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 of the License, or (at your option) any later version.
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.
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 * The Jalview Authors are detailed in the 'AUTHORS' file.
19 package jalview.jbgui;
21 import jalview.util.MessageManager;
24 import java.awt.event.ActionListener;
25 import java.awt.event.ActionEvent;
27 public class GStructureViewer extends JInternalFrame
29 public GStructureViewer()
34 } catch (Exception ex)
40 private void jbInit() throws Exception
42 this.setJMenuBar(menuBar);
43 fileMenu.setText(MessageManager.getString("action.file"));
44 savemenu.setActionCommand(MessageManager.getString("action.save_image"));
45 savemenu.setText(MessageManager.getString("action.save_as"));
46 pdbFile.setText(MessageManager.getString("label.pdb_file"));
47 pdbFile.addActionListener(new ActionListener()
49 public void actionPerformed(ActionEvent actionEvent)
51 pdbFile_actionPerformed(actionEvent);
55 png.addActionListener(new ActionListener()
57 public void actionPerformed(ActionEvent actionEvent)
59 png_actionPerformed(actionEvent);
63 eps.addActionListener(new ActionListener()
65 public void actionPerformed(ActionEvent actionEvent)
67 eps_actionPerformed(actionEvent);
70 viewMapping.setText(MessageManager.getString("label.view_mapping"));
71 viewMapping.addActionListener(new ActionListener()
73 public void actionPerformed(ActionEvent actionEvent)
75 viewMapping_actionPerformed(actionEvent);
78 viewMenu.setText(MessageManager.getString("action.view"));
79 chainMenu.setText(MessageManager.getString("action.show_chain"));
80 colourMenu.setText(MessageManager.getString("label.colours"));
81 backGround.setText(MessageManager.getString("label.background_colour") + "...");
82 backGround.addActionListener(new ActionListener()
84 public void actionPerformed(ActionEvent actionEvent)
86 backGround_actionPerformed(actionEvent);
89 seqColour.setSelected(false);
90 seqColour.setText(MessageManager.getString("action.by_sequence"));
91 seqColour.addActionListener(new ActionListener()
93 public void actionPerformed(ActionEvent actionEvent)
95 seqColour_actionPerformed(actionEvent);
98 chainColour.setText(MessageManager.getString("action.by_chain"));
99 chainColour.addActionListener(new ActionListener()
101 public void actionPerformed(ActionEvent actionEvent)
103 chainColour_actionPerformed(actionEvent);
106 chargeColour.setText(MessageManager.getString("label.charge_cysteine"));
107 chargeColour.addActionListener(new ActionListener()
109 public void actionPerformed(ActionEvent actionEvent)
111 chargeColour_actionPerformed(actionEvent);
114 zappoColour.setText(MessageManager.getString("label.zappo"));
115 zappoColour.addActionListener(new ActionListener()
117 public void actionPerformed(ActionEvent actionEvent)
119 zappoColour_actionPerformed(actionEvent);
122 taylorColour.setText(MessageManager.getString("label.taylor"));
123 taylorColour.addActionListener(new ActionListener()
125 public void actionPerformed(ActionEvent actionEvent)
127 taylorColour_actionPerformed(actionEvent);
130 hydroColour.setText(MessageManager.getString("label.hydrophobicity"));
131 hydroColour.addActionListener(new ActionListener()
133 public void actionPerformed(ActionEvent actionEvent)
135 hydroColour_actionPerformed(actionEvent);
138 strandColour.setText(MessageManager.getString("label.strand_propensity"));
139 strandColour.addActionListener(new ActionListener()
141 public void actionPerformed(ActionEvent actionEvent)
143 strandColour_actionPerformed(actionEvent);
146 helixColour.setText(MessageManager.getString("label.helix_propensity"));
147 helixColour.addActionListener(new ActionListener()
149 public void actionPerformed(ActionEvent actionEvent)
151 helixColour_actionPerformed(actionEvent);
154 turnColour.setText(MessageManager.getString("label.turn_propensity"));
155 turnColour.addActionListener(new ActionListener()
157 public void actionPerformed(ActionEvent actionEvent)
159 turnColour_actionPerformed(actionEvent);
162 buriedColour.setText(MessageManager.getString("label.buried_index"));
163 buriedColour.addActionListener(new ActionListener()
165 public void actionPerformed(ActionEvent actionEvent)
167 buriedColour_actionPerformed(actionEvent);
170 purinePyrimidineColour.setText(MessageManager.getString("label.purine_pyrimidine"));
171 purinePyrimidineColour.addActionListener(new ActionListener()
173 public void actionPerformed(ActionEvent actionEvent)
175 purinePyrimidineColour_actionPerformed(actionEvent);
179 userColour.setText(MessageManager.getString("action.user_defined"));
180 userColour.addActionListener(new ActionListener()
182 public void actionPerformed(ActionEvent actionEvent)
184 userColour_actionPerformed(actionEvent);
187 jmolColour.setSelected(false);
188 jmolColour.setText(MessageManager.getString("label.colour_with_jmol"));
189 jmolColour.setToolTipText(MessageManager.getString("label.let_jmol_manage_structure_colours"));
190 jmolColour.addActionListener(new ActionListener()
192 public void actionPerformed(ActionEvent actionEvent)
194 jmolColour_actionPerformed(actionEvent);
197 helpMenu.setText(MessageManager.getString("action.help"));
198 jmolHelp.setText(MessageManager.getString("label.jmol_help"));
199 jmolHelp.addActionListener(new ActionListener()
201 public void actionPerformed(ActionEvent actionEvent)
203 jmolHelp_actionPerformed(actionEvent);
206 alignStructs.setText(MessageManager.getString("label.align_structures"));
207 alignStructs.addActionListener(new ActionListener()
209 public void actionPerformed(ActionEvent actionEvent)
211 alignStructs_actionPerformed(actionEvent);
214 jmolActionMenu.setText(MessageManager.getString("label.jmol"));
215 menuBar.add(fileMenu);
216 menuBar.add(viewMenu);
217 menuBar.add(colourMenu);
218 menuBar.add(jmolActionMenu);
219 jmolActionMenu.setVisible(false);
220 menuBar.add(helpMenu);
221 fileMenu.add(savemenu);
222 fileMenu.add(viewMapping);
223 savemenu.add(pdbFile);
226 viewMenu.add(chainMenu);
228 colourMenu.add(seqColour);
229 colourMenu.add(chainColour);
230 colourMenu.add(chargeColour);
231 colourMenu.add(zappoColour);
232 colourMenu.add(taylorColour);
233 colourMenu.add(hydroColour);
234 colourMenu.add(helixColour);
235 colourMenu.add(strandColour);
236 colourMenu.add(turnColour);
237 colourMenu.add(buriedColour);
238 colourMenu.add(purinePyrimidineColour);
239 colourMenu.add(userColour);
240 colourMenu.add(jmolColour);
241 colourMenu.add(backGround);
243 colourButtons.add(seqColour);
244 colourButtons.add(chainColour);
245 colourButtons.add(chargeColour);
246 colourButtons.add(zappoColour);
247 colourButtons.add(taylorColour);
248 colourButtons.add(hydroColour);
249 colourButtons.add(helixColour);
250 colourButtons.add(strandColour);
251 colourButtons.add(turnColour);
252 colourButtons.add(buriedColour);
253 colourButtons.add(userColour);
254 colourButtons.add(jmolColour);
256 helpMenu.add(jmolHelp);
257 jmolActionMenu.add(alignStructs);
260 protected void jmolColour_actionPerformed(ActionEvent actionEvent)
264 protected void alignStructs_actionPerformed(ActionEvent actionEvent)
268 JMenuBar menuBar = new JMenuBar();
270 JMenu fileMenu = new JMenu();
272 JMenu savemenu = new JMenu();
274 JMenuItem pdbFile = new JMenuItem();
276 JMenuItem png = new JMenuItem();
278 JMenuItem eps = new JMenuItem();
280 JMenuItem viewMapping = new JMenuItem();
282 protected JMenu viewMenu = new JMenu();
284 protected JMenu chainMenu = new JMenu();
286 JMenu jMenu1 = new JMenu();
288 protected JMenu colourMenu = new JMenu();
290 protected JMenu jmolActionMenu = new JMenu();
292 protected JMenuItem alignStructs = new JMenuItem();
294 JMenuItem backGround = new JMenuItem();
296 protected JRadioButtonMenuItem seqColour = new JRadioButtonMenuItem();
298 protected JRadioButtonMenuItem chainColour = new JRadioButtonMenuItem();
300 protected JRadioButtonMenuItem chargeColour = new JRadioButtonMenuItem();
302 protected JRadioButtonMenuItem zappoColour = new JRadioButtonMenuItem();
304 protected JRadioButtonMenuItem taylorColour = new JRadioButtonMenuItem();
306 protected JRadioButtonMenuItem hydroColour = new JRadioButtonMenuItem();
308 protected JRadioButtonMenuItem strandColour = new JRadioButtonMenuItem();
310 protected JRadioButtonMenuItem helixColour = new JRadioButtonMenuItem();
312 protected JRadioButtonMenuItem turnColour = new JRadioButtonMenuItem();
314 protected JRadioButtonMenuItem buriedColour = new JRadioButtonMenuItem();
316 protected JRadioButtonMenuItem purinePyrimidineColour = new JRadioButtonMenuItem();
318 protected JRadioButtonMenuItem userColour = new JRadioButtonMenuItem();
320 protected JRadioButtonMenuItem jmolColour = new JRadioButtonMenuItem();
322 protected ButtonGroup colourButtons = new ButtonGroup();
324 JMenu helpMenu = new JMenu();
326 JMenuItem jmolHelp = new JMenuItem();
328 public void pdbFile_actionPerformed(ActionEvent actionEvent)
333 public void png_actionPerformed(ActionEvent actionEvent)
338 public void eps_actionPerformed(ActionEvent actionEvent)
343 public void viewMapping_actionPerformed(ActionEvent actionEvent)
348 public void seqColour_actionPerformed(ActionEvent actionEvent)
353 public void chainColour_actionPerformed(ActionEvent actionEvent)
358 public void chargeColour_actionPerformed(ActionEvent actionEvent)
363 public void zappoColour_actionPerformed(ActionEvent actionEvent)
368 public void taylorColour_actionPerformed(ActionEvent actionEvent)
373 public void hydroColour_actionPerformed(ActionEvent actionEvent)
378 public void helixColour_actionPerformed(ActionEvent actionEvent)
383 public void strandColour_actionPerformed(ActionEvent actionEvent)
388 public void turnColour_actionPerformed(ActionEvent actionEvent)
393 public void buriedColour_actionPerformed(ActionEvent actionEvent)
398 public void purinePyrimidineColour_actionPerformed(ActionEvent actionEvent)
403 public void userColour_actionPerformed(ActionEvent actionEvent)
408 public void backGround_actionPerformed(ActionEvent actionEvent)
413 public void jmolHelp_actionPerformed(ActionEvent actionEvent)