X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fjbgui%2FGStructureViewer.java;h=720138a7b01d73fcd8b2ce504b4f5fd0b7d198d5;hb=b2f9a8d7bce642ff4011bc6d49e02bb0569fbb11;hp=d60e5fad47716cc2b11c2267b68e57c1e336f29b;hpb=ea1bc94cb0d4ea4b877101cb7d93283ed4a199fe;p=jalview.git diff --git a/src/jalview/jbgui/GStructureViewer.java b/src/jalview/jbgui/GStructureViewer.java index d60e5fa..720138a 100644 --- a/src/jalview/jbgui/GStructureViewer.java +++ b/src/jalview/jbgui/GStructureViewer.java @@ -1,120 +1,417 @@ -/* - * Jalview - A Sequence Alignment Editor and Viewer - * Copyright (C) 2007 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA - */ - -package jalview.jbgui; - -import javax.swing.*; -import java.awt.event.ActionListener; -import java.awt.event.ActionEvent; - -public class GStructureViewer extends JInternalFrame -{ - public GStructureViewer() - { - try - { - jbInit(); - } - catch (Exception ex) - { - ex.printStackTrace(); - } - } - - private void jbInit() - throws Exception - { - this.setJMenuBar(menuBar); - fileMenu.setText("File"); - savemenu.setActionCommand("Save Image"); - savemenu.setText("Save As"); - pdbFile.setText("PDB File"); - pdbFile.addActionListener(new ActionListener() - { - public void actionPerformed(ActionEvent actionEvent) - { - pdbFile_actionPerformed(actionEvent); - } - }); - png.setText("PNG"); - png.addActionListener(new ActionListener() - { - public void actionPerformed(ActionEvent actionEvent) - { - png_actionPerformed(actionEvent); - } - }); - eps.setText("EPS"); - eps.addActionListener(new ActionListener() - { - public void actionPerformed(ActionEvent actionEvent) - { - eps_actionPerformed(actionEvent); - } - }); - viewMapping.setText("View Mapping"); - viewMapping.addActionListener(new ActionListener() - { - public void actionPerformed(ActionEvent actionEvent) - { - viewMapping_actionPerformed(actionEvent); - } - }); - viewMenu.setText("View"); - chainMenu.setText("Show Chain"); - menuBar.add(fileMenu); - menuBar.add(viewMenu); - fileMenu.add(savemenu); - fileMenu.add(viewMapping); - savemenu.add(pdbFile); - savemenu.add(png); - savemenu.add(eps); - viewMenu.add(chainMenu); - } - - JMenuBar menuBar = new JMenuBar(); - JMenu fileMenu = new JMenu(); - JMenu savemenu = new JMenu(); - JMenuItem pdbFile = new JMenuItem(); - JMenuItem png = new JMenuItem(); - JMenuItem eps = new JMenuItem(); - JMenuItem viewMapping = new JMenuItem(); - JMenu viewMenu = new JMenu(); - protected JMenu chainMenu = new JMenu(); - JMenu jMenu1 = new JMenu(); - public void pdbFile_actionPerformed(ActionEvent actionEvent) - { - - } - - public void png_actionPerformed(ActionEvent actionEvent) - { - - } - - public void eps_actionPerformed(ActionEvent actionEvent) - { - - } - - public void viewMapping_actionPerformed(ActionEvent actionEvent) - { - - } -} +/* + * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.1) + * Copyright (C) 2014 The Jalview Authors + * + * This file is part of Jalview. + * + * Jalview is free software: you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + * + * Jalview is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty + * of MERCHANTABILITY or FITNESS FOR A PARTICULAR + * PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along with Jalview. If not, see . + * The Jalview Authors are detailed in the 'AUTHORS' file. + */ +package jalview.jbgui; + +import jalview.util.MessageManager; + +import javax.swing.*; +import java.awt.event.ActionListener; +import java.awt.event.ActionEvent; + +public class GStructureViewer extends JInternalFrame +{ + public GStructureViewer() + { + try + { + jbInit(); + } catch (Exception ex) + { + ex.printStackTrace(); + } + } + + private void jbInit() throws Exception + { + this.setJMenuBar(menuBar); + fileMenu.setText(MessageManager.getString("action.file")); + savemenu.setActionCommand(MessageManager.getString("action.save_image")); + savemenu.setText(MessageManager.getString("action.save_as")); + pdbFile.setText(MessageManager.getString("label.pdb_file")); + pdbFile.addActionListener(new ActionListener() + { + public void actionPerformed(ActionEvent actionEvent) + { + pdbFile_actionPerformed(actionEvent); + } + }); + png.setText("PNG"); + png.addActionListener(new ActionListener() + { + public void actionPerformed(ActionEvent actionEvent) + { + png_actionPerformed(actionEvent); + } + }); + eps.setText("EPS"); + eps.addActionListener(new ActionListener() + { + public void actionPerformed(ActionEvent actionEvent) + { + eps_actionPerformed(actionEvent); + } + }); + viewMapping.setText(MessageManager.getString("label.view_mapping")); + viewMapping.addActionListener(new ActionListener() + { + public void actionPerformed(ActionEvent actionEvent) + { + viewMapping_actionPerformed(actionEvent); + } + }); + viewMenu.setText(MessageManager.getString("action.view")); + chainMenu.setText(MessageManager.getString("action.show_chain")); + colourMenu.setText(MessageManager.getString("label.colours")); + backGround.setText(MessageManager.getString("label.background_colour") + "..."); + backGround.addActionListener(new ActionListener() + { + public void actionPerformed(ActionEvent actionEvent) + { + backGround_actionPerformed(actionEvent); + } + }); + seqColour.setSelected(false); + seqColour.setText(MessageManager.getString("action.by_sequence")); + seqColour.addActionListener(new ActionListener() + { + public void actionPerformed(ActionEvent actionEvent) + { + seqColour_actionPerformed(actionEvent); + } + }); + chainColour.setText(MessageManager.getString("action.by_chain")); + chainColour.addActionListener(new ActionListener() + { + public void actionPerformed(ActionEvent actionEvent) + { + chainColour_actionPerformed(actionEvent); + } + }); + chargeColour.setText(MessageManager.getString("label.charge_cysteine")); + chargeColour.addActionListener(new ActionListener() + { + public void actionPerformed(ActionEvent actionEvent) + { + chargeColour_actionPerformed(actionEvent); + } + }); + zappoColour.setText(MessageManager.getString("label.zappo")); + zappoColour.addActionListener(new ActionListener() + { + public void actionPerformed(ActionEvent actionEvent) + { + zappoColour_actionPerformed(actionEvent); + } + }); + taylorColour.setText(MessageManager.getString("label.taylor")); + taylorColour.addActionListener(new ActionListener() + { + public void actionPerformed(ActionEvent actionEvent) + { + taylorColour_actionPerformed(actionEvent); + } + }); + hydroColour.setText(MessageManager.getString("label.hydrophobicity")); + hydroColour.addActionListener(new ActionListener() + { + public void actionPerformed(ActionEvent actionEvent) + { + hydroColour_actionPerformed(actionEvent); + } + }); + strandColour.setText(MessageManager.getString("label.strand_propensity")); + strandColour.addActionListener(new ActionListener() + { + public void actionPerformed(ActionEvent actionEvent) + { + strandColour_actionPerformed(actionEvent); + } + }); + helixColour.setText(MessageManager.getString("label.helix_propensity")); + helixColour.addActionListener(new ActionListener() + { + public void actionPerformed(ActionEvent actionEvent) + { + helixColour_actionPerformed(actionEvent); + } + }); + turnColour.setText(MessageManager.getString("label.turn_propensity")); + turnColour.addActionListener(new ActionListener() + { + public void actionPerformed(ActionEvent actionEvent) + { + turnColour_actionPerformed(actionEvent); + } + }); + buriedColour.setText(MessageManager.getString("label.buried_index")); + buriedColour.addActionListener(new ActionListener() + { + public void actionPerformed(ActionEvent actionEvent) + { + buriedColour_actionPerformed(actionEvent); + } + }); + purinePyrimidineColour.setText(MessageManager.getString("label.purine_pyrimidine")); + purinePyrimidineColour.addActionListener(new ActionListener() + { + public void actionPerformed(ActionEvent actionEvent) + { + purinePyrimidineColour_actionPerformed(actionEvent); + } + }); + + userColour.setText(MessageManager.getString("action.user_defined")); + userColour.addActionListener(new ActionListener() + { + public void actionPerformed(ActionEvent actionEvent) + { + userColour_actionPerformed(actionEvent); + } + }); + jmolColour.setSelected(false); + jmolColour.setText(MessageManager.getString("label.colour_with_jmol")); + jmolColour.setToolTipText(MessageManager.getString("label.let_jmol_manage_structure_colours")); + jmolColour.addActionListener(new ActionListener() + { + public void actionPerformed(ActionEvent actionEvent) + { + jmolColour_actionPerformed(actionEvent); + } + }); + helpMenu.setText(MessageManager.getString("action.help")); + jmolHelp.setText(MessageManager.getString("label.jmol_help")); + jmolHelp.addActionListener(new ActionListener() + { + public void actionPerformed(ActionEvent actionEvent) + { + jmolHelp_actionPerformed(actionEvent); + } + }); + alignStructs.setText(MessageManager.getString("label.align_structures")); + alignStructs.addActionListener(new ActionListener() + { + public void actionPerformed(ActionEvent actionEvent) + { + alignStructs_actionPerformed(actionEvent); + } + }); + jmolActionMenu.setText(MessageManager.getString("label.jmol")); + menuBar.add(fileMenu); + menuBar.add(viewMenu); + menuBar.add(colourMenu); + menuBar.add(jmolActionMenu); + jmolActionMenu.setVisible(false); + menuBar.add(helpMenu); + fileMenu.add(savemenu); + fileMenu.add(viewMapping); + savemenu.add(pdbFile); + savemenu.add(png); + savemenu.add(eps); + viewMenu.add(chainMenu); + + colourMenu.add(seqColour); + colourMenu.add(chainColour); + colourMenu.add(chargeColour); + colourMenu.add(zappoColour); + colourMenu.add(taylorColour); + colourMenu.add(hydroColour); + colourMenu.add(helixColour); + colourMenu.add(strandColour); + colourMenu.add(turnColour); + colourMenu.add(buriedColour); + colourMenu.add(purinePyrimidineColour); + colourMenu.add(userColour); + colourMenu.add(jmolColour); + colourMenu.add(backGround); + + colourButtons.add(seqColour); + colourButtons.add(chainColour); + colourButtons.add(chargeColour); + colourButtons.add(zappoColour); + colourButtons.add(taylorColour); + colourButtons.add(hydroColour); + colourButtons.add(helixColour); + colourButtons.add(strandColour); + colourButtons.add(turnColour); + colourButtons.add(buriedColour); + colourButtons.add(userColour); + colourButtons.add(jmolColour); + + helpMenu.add(jmolHelp); + jmolActionMenu.add(alignStructs); + } + + protected void jmolColour_actionPerformed(ActionEvent actionEvent) + { + } + + protected void alignStructs_actionPerformed(ActionEvent actionEvent) + { + } + + JMenuBar menuBar = new JMenuBar(); + + JMenu fileMenu = new JMenu(); + + JMenu savemenu = new JMenu(); + + JMenuItem pdbFile = new JMenuItem(); + + JMenuItem png = new JMenuItem(); + + JMenuItem eps = new JMenuItem(); + + JMenuItem viewMapping = new JMenuItem(); + + protected JMenu viewMenu = new JMenu(); + + protected JMenu chainMenu = new JMenu(); + + JMenu jMenu1 = new JMenu(); + + protected JMenu colourMenu = new JMenu(); + + protected JMenu jmolActionMenu = new JMenu(); + + protected JMenuItem alignStructs = new JMenuItem(); + + JMenuItem backGround = new JMenuItem(); + + protected JRadioButtonMenuItem seqColour = new JRadioButtonMenuItem(); + + protected JRadioButtonMenuItem chainColour = new JRadioButtonMenuItem(); + + protected JRadioButtonMenuItem chargeColour = new JRadioButtonMenuItem(); + + protected JRadioButtonMenuItem zappoColour = new JRadioButtonMenuItem(); + + protected JRadioButtonMenuItem taylorColour = new JRadioButtonMenuItem(); + + protected JRadioButtonMenuItem hydroColour = new JRadioButtonMenuItem(); + + protected JRadioButtonMenuItem strandColour = new JRadioButtonMenuItem(); + + protected JRadioButtonMenuItem helixColour = new JRadioButtonMenuItem(); + + protected JRadioButtonMenuItem turnColour = new JRadioButtonMenuItem(); + + protected JRadioButtonMenuItem buriedColour = new JRadioButtonMenuItem(); + + protected JRadioButtonMenuItem purinePyrimidineColour = new JRadioButtonMenuItem(); + + protected JRadioButtonMenuItem userColour = new JRadioButtonMenuItem(); + + protected JRadioButtonMenuItem jmolColour = new JRadioButtonMenuItem(); + + protected ButtonGroup colourButtons = new ButtonGroup(); + + JMenu helpMenu = new JMenu(); + + JMenuItem jmolHelp = new JMenuItem(); + + public void pdbFile_actionPerformed(ActionEvent actionEvent) + { + + } + + public void png_actionPerformed(ActionEvent actionEvent) + { + + } + + public void eps_actionPerformed(ActionEvent actionEvent) + { + + } + + public void viewMapping_actionPerformed(ActionEvent actionEvent) + { + + } + + public void seqColour_actionPerformed(ActionEvent actionEvent) + { + + } + + public void chainColour_actionPerformed(ActionEvent actionEvent) + { + + } + + public void chargeColour_actionPerformed(ActionEvent actionEvent) + { + + } + + public void zappoColour_actionPerformed(ActionEvent actionEvent) + { + + } + + public void taylorColour_actionPerformed(ActionEvent actionEvent) + { + + } + + public void hydroColour_actionPerformed(ActionEvent actionEvent) + { + + } + + public void helixColour_actionPerformed(ActionEvent actionEvent) + { + + } + + public void strandColour_actionPerformed(ActionEvent actionEvent) + { + + } + + public void turnColour_actionPerformed(ActionEvent actionEvent) + { + + } + + public void buriedColour_actionPerformed(ActionEvent actionEvent) + { + + } + + public void purinePyrimidineColour_actionPerformed(ActionEvent actionEvent) + { + + } + + public void userColour_actionPerformed(ActionEvent actionEvent) + { + + } + + public void backGround_actionPerformed(ActionEvent actionEvent) + { + + } + + public void jmolHelp_actionPerformed(ActionEvent actionEvent) + { + + } +}