Merge remote-tracking branch 'origin/merge/JAL-845_JAL-1640' into
[jalview.git] / src / jalview / jbgui / GAlignFrame.java
index 6f963a5..4b36729 100755 (executable)
@@ -218,6 +218,8 @@ public class GAlignFrame extends JInternalFrame
 
   JMenuItem createPNG = new JMenuItem();
 
+  JMenuItem createBioJS = new JMenuItem();
+
   JMenuItem createSVG = new JMenuItem();
 
   protected JMenuItem font = new JMenuItem();
@@ -272,6 +274,8 @@ public class GAlignFrame extends JInternalFrame
 
   JMenuItem annotationColour = new JMenuItem();
 
+  JMenuItem annotationColumn = new JMenuItem();
+
   protected JMenuItem rnahelicesColour = new JMenuItem();
 
   JMenuItem associatedData = new JMenuItem();
@@ -342,7 +346,7 @@ public class GAlignFrame extends JInternalFrame
 
   JMenuItem textColour = new JMenuItem();
 
-  JMenu formatMenu = new JMenu();
+  protected JMenu formatMenu = new JMenu();
 
   JMenu selectMenu = new JMenu();
 
@@ -390,7 +394,7 @@ public class GAlignFrame extends JInternalFrame
 
   private boolean showAutoCalculatedAbove = false;
 
-  private Map<KeyStroke, ActionListener> accelerators = new HashMap<KeyStroke, ActionListener>();
+  private Map<KeyStroke, JMenuItem> accelerators = new HashMap<KeyStroke, JMenuItem>();
 
   public GAlignFrame()
   {
@@ -1196,6 +1200,19 @@ public class GAlignFrame extends JInternalFrame
         htmlMenuItem_actionPerformed(e);
       }
     });
+
+    // TODO uncomment when supported by MassageManager
+    // createBioJS.setText(MessageManager.getString("label.biojs_html_export"));
+    createBioJS.setText("BioJS");
+    createBioJS.addActionListener(new java.awt.event.ActionListener()
+    {
+      @Override
+      public void actionPerformed(ActionEvent e)
+      {
+        bioJSMenuItem_actionPerformed(e);
+      }
+    });
+
     overviewMenuItem.setText(MessageManager
             .getString("label.overview_window"));
     overviewMenuItem.addActionListener(new ActionListener()
@@ -1614,7 +1631,6 @@ public class GAlignFrame extends JInternalFrame
         font_actionPerformed(e);
       }
     });
-
     seqLimits.setText(MessageManager
             .getString("label.show_sequence_limits"));
     seqLimits.setState(jalview.bin.Cache.getDefault("SHOW_JVSUFFIX", true));
@@ -1914,6 +1930,17 @@ public class GAlignFrame extends JInternalFrame
       }
     });
 
+    annotationColumn.setText(MessageManager
+            .getString("action.select_by_annotation"));
+    annotationColumn.addActionListener(new ActionListener()
+    {
+      @Override
+      public void actionPerformed(ActionEvent e)
+      {
+        annotationColumn_actionPerformed(e);
+      }
+    });
+
     rnahelicesColour.setText(MessageManager
             .getString("action.by_rna_helixes"));
     rnahelicesColour.addActionListener(new ActionListener()
@@ -2417,6 +2444,7 @@ public class GAlignFrame extends JInternalFrame
     jMenu2.add(htmlMenuItem);
     jMenu2.add(epsFile);
     jMenu2.add(createPNG);
+    jMenu2.add(createBioJS);
     jMenu2.add(createSVG);
     addSequenceMenu.add(addFromFile);
     addSequenceMenu.add(addFromText);
@@ -2457,6 +2485,7 @@ public class GAlignFrame extends JInternalFrame
     selectMenu.add(unGroup);
     selectMenu.add(grpsFromSelection);
     selectMenu.add(deleteGroups);
+    selectMenu.add(annotationColumn);
     calculateMenu.add(expandAlignment);
     // TODO - determine if the listenToViewSelections button is needed : see bug
     // JAL-574
@@ -2476,7 +2505,7 @@ public class GAlignFrame extends JInternalFrame
           JMenuItem menuItem, ActionListener actionListener)
   {
     menuItem.setAccelerator(keyStroke);
-    accelerators.put(keyStroke, actionListener);
+    accelerators.put(keyStroke, menuItem);
     menuItem.addActionListener(actionListener);
   }
 
@@ -2699,6 +2728,11 @@ public class GAlignFrame extends JInternalFrame
   {
   }
 
+  protected void bioJSMenuItem_actionPerformed(ActionEvent e)
+  {
+
+  }
+
   protected void closeMenuItem_actionPerformed(boolean b)
   {
   }
@@ -3054,6 +3088,11 @@ public class GAlignFrame extends JInternalFrame
 
   }
 
+  public void annotationColumn_actionPerformed(ActionEvent e)
+  {
+
+  }
+
   public void rnahelicesColour_actionPerformed(ActionEvent e)
   {
 
@@ -3210,8 +3249,24 @@ public class GAlignFrame extends JInternalFrame
     this.annotationSortOrder = annotationSortOrder;
   }
 
-  public Map<KeyStroke, ActionListener> getAccelerators()
+  public Map<KeyStroke, JMenuItem> getAccelerators()
   {
     return this.accelerators;
   }
+
+  /**
+   * Returns the selected index of the tabbed pane, or -1 if none selected
+   * (including the case where the tabbed pane has not been made visible).
+   * 
+   * @return
+   */
+  public int getTabIndex()
+  {
+    return tabbedPane.getSelectedIndex();
+  }
+
+  public JPanel getStatusPanel()
+  {
+    return statusPanel;
+  }
 }