X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fjbgui%2FGStructureViewer.java;h=7885f740ce76551f3037be770351420a31cbd9e1;hb=5bd245162908974e3c96329da6a803598341bae1;hp=4471bbb9c4c84b4efcd5edf8b2c3b22d41ed1430;hpb=c66902a9536b10a5477b58aaf7c2d75772890a5d;p=jalview.git diff --git a/src/jalview/jbgui/GStructureViewer.java b/src/jalview/jbgui/GStructureViewer.java index 4471bbb..7885f74 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. * @@ -20,22 +20,22 @@ */ 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; +import jalview.api.structures.JalviewStructureDisplayI; +import jalview.util.MessageManager; + public abstract class GStructureViewer extends JInternalFrame implements JalviewStructureDisplayI { @@ -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(); - - /** - * 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(); + protected JLabel statusBar = new JLabel(); - private String viewId = null; + protected JPanel statusPanel = new JPanel(); /** * Constructor @@ -162,8 +150,18 @@ public abstract class GStructureViewer extends JInternalFrame implements } }); 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() + { + public void actionPerformed(ActionEvent actionEvent) + { + fitToWindow_actionPerformed(); + } + }); + JMenu colourMenu = new JMenu(); colourMenu.setText(MessageManager.getString("label.colours")); @@ -350,11 +348,20 @@ 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 viewerColour_actionPerformed(ActionEvent actionEvent) @@ -464,52 +471,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; - } }