JAL-1753 statusPanel added (for ProgressBar); 'Fit to Window' menu
authorgmungoc <g.m.carstairs@dundee.ac.uk>
Thu, 4 Jun 2015 12:53:21 +0000 (13:53 +0100)
committergmungoc <g.m.carstairs@dundee.ac.uk>
Thu, 4 Jun 2015 12:53:21 +0000 (13:53 +0100)
option added

src/jalview/jbgui/GStructureViewer.java

index 5768509..c76fb23 100644 (file)
  */
 package jalview.jbgui;
 
-import jalview.api.structures.JalviewStructureDisplayI;
-import jalview.util.MessageManager;
-
+import java.awt.GridLayout;
 import java.awt.event.ActionEvent;
 import java.awt.event.ActionListener;
 
 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
 {
@@ -48,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();
@@ -76,6 +81,10 @@ public abstract class GStructureViewer extends JInternalFrame implements
 
   protected JMenuItem helpItem = new JMenuItem();
 
+  protected JLabel statusBar = new JLabel();
+
+  protected JPanel statusPanel = new JPanel();
+
   /**
    * Constructor
    */
@@ -141,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"));
 
@@ -334,6 +353,14 @@ public abstract class GStructureViewer extends JInternalFrame implements
 
     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)