Merge remote-tracking branch
[jalview.git] / src / jalview / jbgui / GStructureViewer.java
index 4471bbb..7885f74 100644 (file)
@@ -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.
  * 
  */
 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<String> _aps = new ArrayList<String>();
-
-  /**
-   * list of alignment panels to use for superposition
-   */
-  protected Vector<AlignmentPanel> _alignwith = new Vector<AlignmentPanel>();
-
-  /**
-   * list of alignment panels that are used for colouring structures by aligned
-   * sequences
-   */
-  protected Vector<AlignmentPanel> _colourwith = new Vector<AlignmentPanel>();
+  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;
-  }
 }