X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fjbgui%2FGStructureViewer.java;h=270acbed96c103ec4eb32a2b3151a78a12864122;hb=47168f025aefdaa044802bd5f8f510ffe43a4808;hp=f7fa6db1b1c52e3cc5b7a071248ca71a5b21fa92;hpb=0061941739d032ad91aed23bda07e2ad543c2ccb;p=jalview.git diff --git a/src/jalview/jbgui/GStructureViewer.java b/src/jalview/jbgui/GStructureViewer.java index f7fa6db..270acbe 100644 --- a/src/jalview/jbgui/GStructureViewer.java +++ b/src/jalview/jbgui/GStructureViewer.java @@ -1,22 +1,27 @@ /* - * Jalview - A Sequence Alignment Editor and Viewer (Version 2.5) - * Copyright (C) 2010 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle + * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.2) + * 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. - * + * 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 . + * 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; @@ -37,10 +42,10 @@ public class GStructureViewer extends JInternalFrame private void jbInit() throws Exception { this.setJMenuBar(menuBar); - fileMenu.setText("File"); - savemenu.setActionCommand("Save Image"); - savemenu.setText("Save As"); - pdbFile.setText("PDB File"); + 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) @@ -64,7 +69,7 @@ public class GStructureViewer extends JInternalFrame eps_actionPerformed(actionEvent); } }); - viewMapping.setText("View Mapping"); + viewMapping.setText(MessageManager.getString("label.view_mapping")); viewMapping.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent actionEvent) @@ -72,10 +77,10 @@ public class GStructureViewer extends JInternalFrame viewMapping_actionPerformed(actionEvent); } }); - viewMenu.setText("View"); - chainMenu.setText("Show Chain"); - colourMenu.setText("Colours"); - backGround.setText("Background Colour..."); + 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) @@ -83,8 +88,8 @@ public class GStructureViewer extends JInternalFrame backGround_actionPerformed(actionEvent); } }); - seqColour.setSelected(true); - seqColour.setText("By Sequence"); + seqColour.setSelected(false); + seqColour.setText(MessageManager.getString("action.by_sequence")); seqColour.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent actionEvent) @@ -92,7 +97,7 @@ public class GStructureViewer extends JInternalFrame seqColour_actionPerformed(actionEvent); } }); - chainColour.setText("By Chain"); + chainColour.setText(MessageManager.getString("action.by_chain")); chainColour.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent actionEvent) @@ -100,7 +105,7 @@ public class GStructureViewer extends JInternalFrame chainColour_actionPerformed(actionEvent); } }); - chargeColour.setText("Charge & Cysteine"); + chargeColour.setText(MessageManager.getString("label.charge_cysteine")); chargeColour.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent actionEvent) @@ -108,7 +113,7 @@ public class GStructureViewer extends JInternalFrame chargeColour_actionPerformed(actionEvent); } }); - zappoColour.setText("Zappo"); + zappoColour.setText(MessageManager.getString("label.zappo")); zappoColour.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent actionEvent) @@ -116,7 +121,7 @@ public class GStructureViewer extends JInternalFrame zappoColour_actionPerformed(actionEvent); } }); - taylorColour.setText("Taylor"); + taylorColour.setText(MessageManager.getString("label.taylor")); taylorColour.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent actionEvent) @@ -124,7 +129,7 @@ public class GStructureViewer extends JInternalFrame taylorColour_actionPerformed(actionEvent); } }); - hydroColour.setText("Hydro"); + hydroColour.setText(MessageManager.getString("label.hydrophobicity")); hydroColour.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent actionEvent) @@ -132,7 +137,7 @@ public class GStructureViewer extends JInternalFrame hydroColour_actionPerformed(actionEvent); } }); - strandColour.setText("Strand"); + strandColour.setText(MessageManager.getString("label.strand_propensity")); strandColour.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent actionEvent) @@ -140,7 +145,7 @@ public class GStructureViewer extends JInternalFrame strandColour_actionPerformed(actionEvent); } }); - helixColour.setText("Helix Propensity"); + helixColour.setText(MessageManager.getString("label.helix_propensity")); helixColour.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent actionEvent) @@ -148,7 +153,7 @@ public class GStructureViewer extends JInternalFrame helixColour_actionPerformed(actionEvent); } }); - turnColour.setText("Turn Propensity"); + turnColour.setText(MessageManager.getString("label.turn_propensity")); turnColour.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent actionEvent) @@ -156,7 +161,7 @@ public class GStructureViewer extends JInternalFrame turnColour_actionPerformed(actionEvent); } }); - buriedColour.setText("Buried Index"); + buriedColour.setText(MessageManager.getString("label.buried_index")); buriedColour.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent actionEvent) @@ -164,7 +169,16 @@ public class GStructureViewer extends JInternalFrame buriedColour_actionPerformed(actionEvent); } }); - userColour.setText("User Defined ..."); + 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) @@ -172,8 +186,18 @@ public class GStructureViewer extends JInternalFrame userColour_actionPerformed(actionEvent); } }); - helpMenu.setText("Help"); - jmolHelp.setText("Jmol Help"); + 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) @@ -181,9 +205,20 @@ public class GStructureViewer extends JInternalFrame 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); @@ -202,7 +237,9 @@ public class GStructureViewer extends JInternalFrame colourMenu.add(strandColour); colourMenu.add(turnColour); colourMenu.add(buriedColour); + colourMenu.add(purinePyrimidineColour); colourMenu.add(userColour); + colourMenu.add(jmolColour); colourMenu.add(backGround); colourButtons.add(seqColour); @@ -216,8 +253,18 @@ public class GStructureViewer extends JInternalFrame 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(); @@ -234,13 +281,17 @@ public class GStructureViewer extends JInternalFrame JMenuItem viewMapping = new JMenuItem(); - JMenu viewMenu = new JMenu(); + protected JMenu viewMenu = new JMenu(); protected JMenu chainMenu = new JMenu(); JMenu jMenu1 = new JMenu(); - JMenu colourMenu = new JMenu(); + protected JMenu colourMenu = new JMenu(); + + protected JMenu jmolActionMenu = new JMenu(); + + protected JMenuItem alignStructs = new JMenuItem(); JMenuItem backGround = new JMenuItem(); @@ -264,8 +315,12 @@ public class GStructureViewer extends JInternalFrame 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(); @@ -342,6 +397,11 @@ public class GStructureViewer extends JInternalFrame } + public void purinePyrimidineColour_actionPerformed(ActionEvent actionEvent) + { + + } + public void userColour_actionPerformed(ActionEvent actionEvent) {