X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fjbgui%2FGStructureViewer.java;h=bd0f1de5f098c57b85a76a0dbbade4192c85d176;hb=15a5ef9f79696762a81ed5a77930fc1936959f5a;hp=4471bbb9c4c84b4efcd5edf8b2c3b22d41ed1430;hpb=c66902a9536b10a5477b58aaf7c2d75772890a5d;p=jalview.git diff --git a/src/jalview/jbgui/GStructureViewer.java b/src/jalview/jbgui/GStructureViewer.java index 4471bbb..bd0f1de 100644 --- a/src/jalview/jbgui/GStructureViewer.java +++ b/src/jalview/jbgui/GStructureViewer.java @@ -1,6 +1,6 @@ /* - * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.2) - * Copyright (C) 2014 The Jalview Authors + * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$) + * Copyright (C) $$Year-Rel$$ The Jalview Authors * * This file is part of Jalview. * @@ -21,19 +21,19 @@ package jalview.jbgui; import jalview.api.structures.JalviewStructureDisplayI; -import jalview.gui.AlignmentPanel; import jalview.util.MessageManager; +import java.awt.GridLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; -import java.util.ArrayList; -import java.util.Vector; import javax.swing.ButtonGroup; import javax.swing.JInternalFrame; +import javax.swing.JLabel; import javax.swing.JMenu; import javax.swing.JMenuBar; import javax.swing.JMenuItem; +import javax.swing.JPanel; import javax.swing.JRadioButtonMenuItem; public abstract class GStructureViewer extends JInternalFrame implements @@ -51,6 +51,8 @@ public abstract class GStructureViewer extends JInternalFrame implements protected JMenuItem alignStructs = new JMenuItem(); + protected JMenuItem fitToWindow = new JMenuItem(); + protected JRadioButtonMenuItem seqColour = new JRadioButtonMenuItem(); protected JRadioButtonMenuItem chainColour = new JRadioButtonMenuItem(); @@ -79,23 +81,9 @@ public abstract class GStructureViewer extends JInternalFrame implements protected JMenuItem helpItem = new JMenuItem(); - /** - * list of sequenceSet ids associated with the view - */ - protected ArrayList _aps = new ArrayList(); + protected JLabel statusBar = new JLabel(); - /** - * list of alignment panels to use for superposition - */ - protected Vector _alignwith = new Vector(); - - /** - * list of alignment panels that are used for colouring structures by aligned - * sequences - */ - protected Vector _colourwith = new Vector(); - - private String viewId = null; + protected JPanel statusPanel = new JPanel(); /** * Constructor @@ -126,6 +114,7 @@ public abstract class GStructureViewer extends JInternalFrame implements pdbFile.setText(MessageManager.getString("label.pdb_file")); pdbFile.addActionListener(new ActionListener() { + @Override public void actionPerformed(ActionEvent actionEvent) { pdbFile_actionPerformed(actionEvent); @@ -136,6 +125,7 @@ public abstract class GStructureViewer extends JInternalFrame implements png.setText("PNG"); png.addActionListener(new ActionListener() { + @Override public void actionPerformed(ActionEvent actionEvent) { png_actionPerformed(actionEvent); @@ -146,6 +136,7 @@ public abstract class GStructureViewer extends JInternalFrame implements eps.setText("EPS"); eps.addActionListener(new ActionListener() { + @Override public void actionPerformed(ActionEvent actionEvent) { eps_actionPerformed(actionEvent); @@ -156,22 +147,35 @@ public abstract class GStructureViewer extends JInternalFrame implements viewMapping.setText(MessageManager.getString("label.view_mapping")); viewMapping.addActionListener(new ActionListener() { + @Override public void actionPerformed(ActionEvent actionEvent) { viewMapping_actionPerformed(actionEvent); } }); viewMenu.setText(MessageManager.getString("action.view")); + chainMenu.setText(MessageManager.getString("action.show_chain")); + fitToWindow.setText(MessageManager.getString("label.fit_to_window")); + fitToWindow.addActionListener(new ActionListener() + { + @Override + public void actionPerformed(ActionEvent actionEvent) + { + fitToWindow_actionPerformed(); + } + }); + JMenu colourMenu = new JMenu(); colourMenu.setText(MessageManager.getString("label.colours")); JMenuItem backGround = new JMenuItem(); - backGround.setText(MessageManager.getString("label.background_colour") - + "..."); + backGround + .setText(MessageManager.getString("action.background_colour")); backGround.addActionListener(new ActionListener() { + @Override public void actionPerformed(ActionEvent actionEvent) { backGround_actionPerformed(actionEvent); @@ -181,6 +185,7 @@ public abstract class GStructureViewer extends JInternalFrame implements seqColour.setText(MessageManager.getString("action.by_sequence")); seqColour.addActionListener(new ActionListener() { + @Override public void actionPerformed(ActionEvent actionEvent) { seqColour_actionPerformed(actionEvent); @@ -189,6 +194,7 @@ public abstract class GStructureViewer extends JInternalFrame implements chainColour.setText(MessageManager.getString("action.by_chain")); chainColour.addActionListener(new ActionListener() { + @Override public void actionPerformed(ActionEvent actionEvent) { chainColour_actionPerformed(actionEvent); @@ -197,6 +203,7 @@ public abstract class GStructureViewer extends JInternalFrame implements chargeColour.setText(MessageManager.getString("label.charge_cysteine")); chargeColour.addActionListener(new ActionListener() { + @Override public void actionPerformed(ActionEvent actionEvent) { chargeColour_actionPerformed(actionEvent); @@ -205,6 +212,7 @@ public abstract class GStructureViewer extends JInternalFrame implements zappoColour.setText(MessageManager.getString("label.zappo")); zappoColour.addActionListener(new ActionListener() { + @Override public void actionPerformed(ActionEvent actionEvent) { zappoColour_actionPerformed(actionEvent); @@ -213,6 +221,7 @@ public abstract class GStructureViewer extends JInternalFrame implements taylorColour.setText(MessageManager.getString("label.taylor")); taylorColour.addActionListener(new ActionListener() { + @Override public void actionPerformed(ActionEvent actionEvent) { taylorColour_actionPerformed(actionEvent); @@ -221,6 +230,7 @@ public abstract class GStructureViewer extends JInternalFrame implements hydroColour.setText(MessageManager.getString("label.hydrophobicity")); hydroColour.addActionListener(new ActionListener() { + @Override public void actionPerformed(ActionEvent actionEvent) { hydroColour_actionPerformed(actionEvent); @@ -230,6 +240,7 @@ public abstract class GStructureViewer extends JInternalFrame implements .getString("label.strand_propensity")); strandColour.addActionListener(new ActionListener() { + @Override public void actionPerformed(ActionEvent actionEvent) { strandColour_actionPerformed(actionEvent); @@ -238,6 +249,7 @@ public abstract class GStructureViewer extends JInternalFrame implements helixColour.setText(MessageManager.getString("label.helix_propensity")); helixColour.addActionListener(new ActionListener() { + @Override public void actionPerformed(ActionEvent actionEvent) { helixColour_actionPerformed(actionEvent); @@ -246,6 +258,7 @@ public abstract class GStructureViewer extends JInternalFrame implements turnColour.setText(MessageManager.getString("label.turn_propensity")); turnColour.addActionListener(new ActionListener() { + @Override public void actionPerformed(ActionEvent actionEvent) { turnColour_actionPerformed(actionEvent); @@ -254,6 +267,7 @@ public abstract class GStructureViewer extends JInternalFrame implements buriedColour.setText(MessageManager.getString("label.buried_index")); buriedColour.addActionListener(new ActionListener() { + @Override public void actionPerformed(ActionEvent actionEvent) { buriedColour_actionPerformed(actionEvent); @@ -263,6 +277,7 @@ public abstract class GStructureViewer extends JInternalFrame implements .getString("label.purine_pyrimidine")); purinePyrimidineColour.addActionListener(new ActionListener() { + @Override public void actionPerformed(ActionEvent actionEvent) { purinePyrimidineColour_actionPerformed(actionEvent); @@ -272,6 +287,7 @@ public abstract class GStructureViewer extends JInternalFrame implements userColour.setText(MessageManager.getString("action.user_defined")); userColour.addActionListener(new ActionListener() { + @Override public void actionPerformed(ActionEvent actionEvent) { userColour_actionPerformed(actionEvent); @@ -284,6 +300,7 @@ public abstract class GStructureViewer extends JInternalFrame implements .getString("label.let_jmol_manage_structure_colours")); viewerColour.addActionListener(new ActionListener() { + @Override public void actionPerformed(ActionEvent actionEvent) { viewerColour_actionPerformed(actionEvent); @@ -295,6 +312,7 @@ public abstract class GStructureViewer extends JInternalFrame implements helpItem.setText(MessageManager.getString("label.jmol_help")); helpItem.addActionListener(new ActionListener() { + @Override public void actionPerformed(ActionEvent actionEvent) { showHelp_actionPerformed(actionEvent); @@ -304,6 +322,7 @@ public abstract class GStructureViewer extends JInternalFrame implements .setText(MessageManager.getString("label.align_structures")); alignStructs.addActionListener(new ActionListener() { + @Override public void actionPerformed(ActionEvent actionEvent) { alignStructs_actionPerformed(actionEvent); @@ -350,11 +369,24 @@ public abstract class GStructureViewer extends JInternalFrame implements colourButtons.add(strandColour); colourButtons.add(turnColour); colourButtons.add(buriedColour); + colourButtons.add(purinePyrimidineColour); colourButtons.add(userColour); colourButtons.add(viewerColour); helpMenu.add(helpItem); viewerActionMenu.add(alignStructs); + + statusPanel.setLayout(new GridLayout()); + this.getContentPane().add(statusPanel, java.awt.BorderLayout.SOUTH); + statusPanel.add(statusBar, null); + } + + protected void fitToWindow_actionPerformed() + { + } + + protected void highlightSelection_actionPerformed() + { } protected void viewerColour_actionPerformed(ActionEvent actionEvent) @@ -464,52 +496,4 @@ public abstract class GStructureViewer extends JInternalFrame implements // this.bindingModel = bindingModel; // } - /** - * - * @param ap2 - * @return true if this Jmol instance is linked with the given alignPanel - */ - public boolean isLinkedWith(AlignmentPanel ap2) - { - return _aps.contains(ap2.av.getSequenceSetId()); - } - - public boolean isUsedforaligment(AlignmentPanel ap2) - { - - return (_alignwith != null) && _alignwith.contains(ap2); - } - - public boolean isUsedforcolourby(AlignmentPanel ap2) - { - return (_colourwith != null) && _colourwith.contains(ap2); - } - - /** - * - * @return TRUE if the view is NOT being coloured by the alignment colours. - */ - public boolean isColouredByViewer() - { - return !getBinding().isColourBySequence(); - } - - public String getViewId() - { - if (viewId == null) - { - viewId = System.currentTimeMillis() + "." + this.hashCode(); - } - return viewId; - } - - protected void setViewId(String viewId) - { - this.viewId = viewId; - } - - public String getStateInfo() - { - return null; - } }