From a576517d22220abb490437a02c9b37a1f4c2839e Mon Sep 17 00:00:00 2001 From: gmungoc Date: Thu, 4 Jun 2015 13:53:21 +0100 Subject: [PATCH] JAL-1753 statusPanel added (for ProgressBar); 'Fit to Window' menu option added --- src/jalview/jbgui/GStructureViewer.java | 33 ++++++++++++++++++++++++++++--- 1 file changed, 30 insertions(+), 3 deletions(-) diff --git a/src/jalview/jbgui/GStructureViewer.java b/src/jalview/jbgui/GStructureViewer.java index 5768509..c76fb23 100644 --- a/src/jalview/jbgui/GStructureViewer.java +++ b/src/jalview/jbgui/GStructureViewer.java @@ -20,19 +20,22 @@ */ 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) -- 1.7.10.2