Merge branch 'develop' into bug/JAL-2510amendFeatures
[jalview.git] / src / jalview / appletgui / AlignFrame.java
index cd1e1a9..f914108 100644 (file)
@@ -46,6 +46,7 @@ import jalview.datamodel.AlignmentAnnotation;
 import jalview.datamodel.AlignmentI;
 import jalview.datamodel.AlignmentOrder;
 import jalview.datamodel.ColumnSelection;
+import jalview.datamodel.HiddenColumns;
 import jalview.datamodel.PDBEntry;
 import jalview.datamodel.Sequence;
 import jalview.datamodel.SequenceGroup;
@@ -172,14 +173,14 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,
   }
 
   public AlignFrame(AlignmentI al, SequenceI[] hiddenSeqs,
-          ColumnSelection columnSelection, JalviewLite applet,
+          HiddenColumns hidden, JalviewLite applet,
           String title, boolean embedded)
   {
-    this(al, hiddenSeqs, columnSelection, applet, title, embedded, true);
+    this(al, hiddenSeqs, hidden, applet, title, embedded, true);
   }
 
   public AlignFrame(AlignmentI al, SequenceI[] hiddenSeqs,
-          ColumnSelection columnSelection, JalviewLite applet,
+          HiddenColumns hidden, JalviewLite applet,
           String title, boolean embedded, boolean addToDisplay)
   {
     if (applet != null)
@@ -222,9 +223,9 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,
     {
       viewport.hideSequence(hiddenSeqs);
     }
-    if (columnSelection != null)
+    if (hidden != null)
     {
-      viewport.setColumnSelection(columnSelection);
+      viewport.getAlignment().setHiddenColumns(hidden);
     }
     viewport.setScaleAboveWrapped(scaleAbove.getState());
 
@@ -1927,7 +1928,8 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,
     {
       copiedHiddenColumns = new Vector();
       int hiddenOffset = viewport.getSelectionGroup().getStartRes();
-      for (int[] region : viewport.getColumnSelection().getHiddenColumns())
+      for (int[] region : viewport.getAlignment().getHiddenColumns()
+              .getHiddenRegions())
       {
         copiedHiddenColumns.addElement(new int[] {
             region[0] - hiddenOffset, region[1] - hiddenOffset });
@@ -4207,9 +4209,10 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,
    * @param csel
    *          - columns to be selected on the alignment
    */
-  public void select(SequenceGroup sel, ColumnSelection csel)
+  public void select(SequenceGroup sel, ColumnSelection csel,
+          HiddenColumns hidden)
   {
-    alignPanel.seqPanel.selection(sel, csel, null);
+    alignPanel.seqPanel.selection(sel, csel, hidden, null);
   }
 
   public void scrollTo(int row, int column)