2 * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
3 * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
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/>.
18 package jalview.jbgui;
21 import java.awt.event.ActionListener;
22 import java.awt.event.ActionEvent;
24 public class GStructureViewer extends JInternalFrame
26 public GStructureViewer()
31 } catch (Exception ex)
37 private void jbInit() throws Exception
39 this.setJMenuBar(menuBar);
40 fileMenu.setText("File");
41 savemenu.setActionCommand("Save Image");
42 savemenu.setText("Save As");
43 pdbFile.setText("PDB File");
44 pdbFile.addActionListener(new ActionListener()
46 public void actionPerformed(ActionEvent actionEvent)
48 pdbFile_actionPerformed(actionEvent);
52 png.addActionListener(new ActionListener()
54 public void actionPerformed(ActionEvent actionEvent)
56 png_actionPerformed(actionEvent);
60 eps.addActionListener(new ActionListener()
62 public void actionPerformed(ActionEvent actionEvent)
64 eps_actionPerformed(actionEvent);
67 viewMapping.setText("View Mapping");
68 viewMapping.addActionListener(new ActionListener()
70 public void actionPerformed(ActionEvent actionEvent)
72 viewMapping_actionPerformed(actionEvent);
75 viewMenu.setText("View");
76 chainMenu.setText("Show Chain");
77 colourMenu.setText("Colours");
78 backGround.setText("Background Colour...");
79 backGround.addActionListener(new ActionListener()
81 public void actionPerformed(ActionEvent actionEvent)
83 backGround_actionPerformed(actionEvent);
86 seqColour.setSelected(false);
87 seqColour.setText("By Sequence");
88 seqColour.addActionListener(new ActionListener()
90 public void actionPerformed(ActionEvent actionEvent)
92 seqColour_actionPerformed(actionEvent);
95 chainColour.setText("By Chain");
96 chainColour.addActionListener(new ActionListener()
98 public void actionPerformed(ActionEvent actionEvent)
100 chainColour_actionPerformed(actionEvent);
103 chargeColour.setText("Charge & Cysteine");
104 chargeColour.addActionListener(new ActionListener()
106 public void actionPerformed(ActionEvent actionEvent)
108 chargeColour_actionPerformed(actionEvent);
111 zappoColour.setText("Zappo");
112 zappoColour.addActionListener(new ActionListener()
114 public void actionPerformed(ActionEvent actionEvent)
116 zappoColour_actionPerformed(actionEvent);
119 taylorColour.setText("Taylor");
120 taylorColour.addActionListener(new ActionListener()
122 public void actionPerformed(ActionEvent actionEvent)
124 taylorColour_actionPerformed(actionEvent);
127 hydroColour.setText("Hydro");
128 hydroColour.addActionListener(new ActionListener()
130 public void actionPerformed(ActionEvent actionEvent)
132 hydroColour_actionPerformed(actionEvent);
135 strandColour.setText("Strand");
136 strandColour.addActionListener(new ActionListener()
138 public void actionPerformed(ActionEvent actionEvent)
140 strandColour_actionPerformed(actionEvent);
143 helixColour.setText("Helix Propensity");
144 helixColour.addActionListener(new ActionListener()
146 public void actionPerformed(ActionEvent actionEvent)
148 helixColour_actionPerformed(actionEvent);
151 turnColour.setText("Turn Propensity");
152 turnColour.addActionListener(new ActionListener()
154 public void actionPerformed(ActionEvent actionEvent)
156 turnColour_actionPerformed(actionEvent);
159 buriedColour.setText("Buried Index");
160 buriedColour.addActionListener(new ActionListener()
162 public void actionPerformed(ActionEvent actionEvent)
164 buriedColour_actionPerformed(actionEvent);
167 purinePyrimidineColour.setText("Purine/Pyrimidine");
168 purinePyrimidineColour.addActionListener(new ActionListener()
170 public void actionPerformed(ActionEvent actionEvent)
172 purinePyrimidineColour_actionPerformed(actionEvent);
176 userColour.setText("User Defined ...");
177 userColour.addActionListener(new ActionListener()
179 public void actionPerformed(ActionEvent actionEvent)
181 userColour_actionPerformed(actionEvent);
184 jmolColour.setSelected(false);
185 jmolColour.setText("Colour with Jmol");
186 jmolColour.setToolTipText("Let Jmol manage structure colours.");
187 jmolColour.addActionListener(new ActionListener()
189 public void actionPerformed(ActionEvent actionEvent)
191 jmolColour_actionPerformed(actionEvent);
195 helpMenu.setText("Help");
196 jmolHelp.setText("Jmol Help");
197 jmolHelp.addActionListener(new ActionListener()
199 public void actionPerformed(ActionEvent actionEvent)
201 jmolHelp_actionPerformed(actionEvent);
204 alignStructs.setText("Align structures");
205 alignStructs.addActionListener(new ActionListener()
207 public void actionPerformed(ActionEvent actionEvent)
209 alignStructs_actionPerformed(actionEvent);
212 jmolActionMenu.setText("Jmol");
213 menuBar.add(fileMenu);
214 menuBar.add(viewMenu);
215 menuBar.add(colourMenu);
216 menuBar.add(jmolActionMenu);
217 jmolActionMenu.setVisible(false);
218 menuBar.add(helpMenu);
219 fileMenu.add(savemenu);
220 fileMenu.add(viewMapping);
221 savemenu.add(pdbFile);
224 viewMenu.add(chainMenu);
226 colourMenu.add(seqColour);
227 colourMenu.add(chainColour);
228 colourMenu.add(chargeColour);
229 colourMenu.add(zappoColour);
230 colourMenu.add(taylorColour);
231 colourMenu.add(hydroColour);
232 colourMenu.add(helixColour);
233 colourMenu.add(strandColour);
234 colourMenu.add(turnColour);
235 colourMenu.add(buriedColour);
236 colourMenu.add(purinePyrimidineColour);
237 colourMenu.add(userColour);
238 colourMenu.add(jmolColour);
239 colourMenu.add(backGround);
241 colourButtons.add(seqColour);
242 colourButtons.add(chainColour);
243 colourButtons.add(chargeColour);
244 colourButtons.add(zappoColour);
245 colourButtons.add(taylorColour);
246 colourButtons.add(hydroColour);
247 colourButtons.add(helixColour);
248 colourButtons.add(strandColour);
249 colourButtons.add(turnColour);
250 colourButtons.add(buriedColour);
251 colourButtons.add(userColour);
252 colourButtons.add(jmolColour);
254 helpMenu.add(jmolHelp);
255 jmolActionMenu.add(alignStructs);
258 protected void jmolColour_actionPerformed(ActionEvent actionEvent)
262 protected void alignStructs_actionPerformed(ActionEvent actionEvent)
266 JMenuBar menuBar = new JMenuBar();
268 JMenu fileMenu = new JMenu();
270 JMenu savemenu = new JMenu();
272 JMenuItem pdbFile = new JMenuItem();
274 JMenuItem png = new JMenuItem();
276 JMenuItem eps = new JMenuItem();
278 JMenuItem viewMapping = new JMenuItem();
280 protected JMenu viewMenu = new JMenu();
282 protected JMenu chainMenu = new JMenu();
284 JMenu jMenu1 = new JMenu();
286 protected JMenu colourMenu = new JMenu();
288 protected JMenu jmolActionMenu = new JMenu();
290 protected JMenuItem alignStructs = new JMenuItem();
292 JMenuItem backGround = new JMenuItem();
294 protected JRadioButtonMenuItem seqColour = new JRadioButtonMenuItem();
296 protected JRadioButtonMenuItem chainColour = new JRadioButtonMenuItem();
298 protected JRadioButtonMenuItem chargeColour = new JRadioButtonMenuItem();
300 protected JRadioButtonMenuItem zappoColour = new JRadioButtonMenuItem();
302 protected JRadioButtonMenuItem taylorColour = new JRadioButtonMenuItem();
304 protected JRadioButtonMenuItem hydroColour = new JRadioButtonMenuItem();
306 protected JRadioButtonMenuItem strandColour = new JRadioButtonMenuItem();
308 protected JRadioButtonMenuItem helixColour = new JRadioButtonMenuItem();
310 protected JRadioButtonMenuItem turnColour = new JRadioButtonMenuItem();
312 protected JRadioButtonMenuItem buriedColour = new JRadioButtonMenuItem();
314 protected JRadioButtonMenuItem purinePyrimidineColour = new JRadioButtonMenuItem();
317 protected JRadioButtonMenuItem userColour = new JRadioButtonMenuItem();
319 protected JRadioButtonMenuItem jmolColour = new JRadioButtonMenuItem();
321 protected ButtonGroup colourButtons = new ButtonGroup();
323 JMenu helpMenu = new JMenu();
325 JMenuItem jmolHelp = new JMenuItem();
327 public void pdbFile_actionPerformed(ActionEvent actionEvent)
332 public void png_actionPerformed(ActionEvent actionEvent)
337 public void eps_actionPerformed(ActionEvent actionEvent)
342 public void viewMapping_actionPerformed(ActionEvent actionEvent)
347 public void seqColour_actionPerformed(ActionEvent actionEvent)
352 public void chainColour_actionPerformed(ActionEvent actionEvent)
357 public void chargeColour_actionPerformed(ActionEvent actionEvent)
362 public void zappoColour_actionPerformed(ActionEvent actionEvent)
367 public void taylorColour_actionPerformed(ActionEvent actionEvent)
372 public void hydroColour_actionPerformed(ActionEvent actionEvent)
377 public void helixColour_actionPerformed(ActionEvent actionEvent)
382 public void strandColour_actionPerformed(ActionEvent actionEvent)
387 public void turnColour_actionPerformed(ActionEvent actionEvent)
392 public void buriedColour_actionPerformed(ActionEvent actionEvent)
397 public void purinePyrimidineColour_actionPerformed(ActionEvent actionEvent)
402 public void userColour_actionPerformed(ActionEvent actionEvent)
407 public void backGround_actionPerformed(ActionEvent actionEvent)
412 public void jmolHelp_actionPerformed(ActionEvent actionEvent)