Use paintAlignment
[jalview.git] / src / jalview / gui / AlignViewport.java
index cfffbb9..fa458a6 100755 (executable)
@@ -292,7 +292,7 @@ public class AlignViewport
           {
             if (ap != null)
             {
-              ap.repaint();
+              ap.paintAlignment(true);
             }
             Thread.sleep(200);
           }
@@ -425,7 +425,7 @@ public class AlignViewport
 
       if (ap != null)
       {
-        ap.repaint();
+        ap.paintAlignment(true);
       }
 
     }
@@ -486,7 +486,7 @@ public class AlignViewport
         {
           if (ap != null)
           {
-            ap.repaint();
+            ap.paintAlignment(true);
           }
 
           Thread.sleep(200);
@@ -577,7 +577,7 @@ public class AlignViewport
 
       if (ap != null)
       {
-        ap.repaint();
+        ap.paintAlignment(true);
       }
     }
   }
@@ -1334,7 +1334,7 @@ public class AlignViewport
 
   public void hideAllSelectedSeqs()
   {
-    if (selectionGroup == null)
+    if (selectionGroup == null || selectionGroup.getSize()<1)
     {
       return;
     }
@@ -1629,6 +1629,51 @@ public class AlignViewport
     return selection;
   }
 
+  public int [][] getVisibleRegionBoundaries(int min, int max)
+  {
+    Vector regions = new Vector();
+    int start = min;
+    int end = max;
+
+    do
+    {
+      if (hasHiddenColumns)
+      {
+        if (start == 0)
+        {
+          start = colSel.adjustForHiddenColumns(start);
+        }
+
+        end = colSel.getHiddenBoundaryRight(start);
+        if (start == end)
+        {
+          end = max;
+        }
+        if (end > max)
+        {
+          end = max;
+        }
+      }
+
+      regions.addElement(new int[]
+                         {start, end});
+
+      if (hasHiddenColumns)
+      {
+        start = colSel.adjustForHiddenColumns(end);
+        start = colSel.getHiddenBoundaryLeft(start) + 1;
+      }
+    }
+    while (end < max);
+
+    int[][] startEnd = new int[regions.size()][2];
+
+    regions.copyInto(startEnd);
+
+    return startEnd;
+
+  }
+
   public boolean getShowHiddenMarkers()
   {
     return showHiddenMarkers;