Merge commit 'ab43013b7e357b84b4abade0dba949668dfb2a0e' into develop
[jalview.git] / src / jalview / appletgui / AlignFrame.java
index 691aa17..cdfed1d 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.2)
+ * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.2b1)
  * Copyright (C) 2014 The Jalview Authors
  * 
  * This file is part of Jalview.
@@ -63,6 +63,7 @@ import jalview.schemes.TaylorColourScheme;
 import jalview.schemes.TurnColourScheme;
 import jalview.schemes.ZappoColourScheme;
 import jalview.structure.StructureSelectionManager;
+import jalview.structures.models.AAStructureBindingModel;
 import jalview.util.MessageManager;
 
 import java.awt.BorderLayout;
@@ -1106,6 +1107,10 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,
     {
       new AnnotationColourChooser(viewport, alignPanel);
     }
+    else if (source == annotationColumnSelection)
+    {
+      new AnnotationColumnChooser(viewport, alignPanel);
+    }
     else if (source == sortPairwiseMenuItem)
     {
       sortPairwiseMenuItem_actionPerformed();
@@ -1275,7 +1280,12 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,
   {
     StringBuffer url = new StringBuffer(jalviewServletURL);
 
-    url.append("?open="
+    // allow servlet parameters to be passed in applet parameter
+    String firstSep = url.lastIndexOf("?") > url.lastIndexOf("/") ? "&"
+            : "?";
+    url.append(firstSep);
+
+    url.append("open="
             + appendProtocol(viewport.applet.getParameter("file")));
 
     if (viewport.applet.getParameter("features") != null)
@@ -1685,11 +1695,8 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,
     {
       copiedHiddenColumns = new Vector();
       int hiddenOffset = viewport.getSelectionGroup().getStartRes();
-      for (int i = 0; i < viewport.getColumnSelection().getHiddenColumns()
-              .size(); i++)
+      for (int[] region : viewport.getColumnSelection().getHiddenColumns())
       {
-        int[] region = (int[]) viewport.getColumnSelection()
-                .getHiddenColumns().elementAt(i);
 
         copiedHiddenColumns.addElement(new int[]
         { region[0] - hiddenOffset, region[1] - hiddenOffset });
@@ -3270,6 +3277,10 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,
     annotationColour.setLabel(MessageManager
             .getString("action.by_annotation"));
     annotationColour.addActionListener(this);
+
+    annotationColumnSelection.setLabel("Select by Annotation");
+    annotationColumnSelection.addActionListener(this);
+
     invertSequenceMenuItem.setLabel(MessageManager
             .getString("action.invert_sequence_selection"));
     invertColSel.setLabel(MessageManager
@@ -3458,6 +3469,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,
     selectMenu.add(unGroup);
     selectMenu.add(grpsFromSelection);
     selectMenu.add(deleteGroups);
+    selectMenu.add(annotationColumnSelection);
 
   }
 
@@ -3472,6 +3484,8 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,
 
   MenuItem annotationColour = new MenuItem();
 
+  MenuItem annotationColumnSelection = new MenuItem();
+
   MenuItem invertColSel = new MenuItem();
 
   Menu menu1 = new Menu();
@@ -3628,7 +3642,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,
         return null;
       }
     }
-    ExtJmol jmv = null;
+    AAStructureBindingModel jmv = null;
     // TODO: search for a jmv that involves viewer
     if (jmv == null)
     { // create a new viewer/jalview binding.