JAL-3210 Improvements to eclipse detection. New src tree and SwingJS updated from...
[jalview.git] / src / jalview / datamodel / Alignment.java
index 1956df7..98510e3 100755 (executable)
@@ -125,8 +125,7 @@ public class Alignment implements AlignmentI
   /**
    * Make a new alignment from an array of SeqCigars
    * 
-   * @param seqs
-   *          SeqCigar[]
+   * @param alseqs
    */
   public Alignment(SeqCigar[] alseqs)
   {
@@ -399,6 +398,10 @@ public class Alignment implements AlignmentI
     return null;
   }
 
+  private static final SequenceGroup[] noGroups = new SequenceGroup[0];
+
+  private ArrayList<SequenceGroup> temp = new ArrayList<>();
+
   /*
    * (non-Javadoc)
    * 
@@ -408,11 +411,15 @@ public class Alignment implements AlignmentI
   @Override
   public SequenceGroup[] findAllGroups(SequenceI s)
   {
-    ArrayList<SequenceGroup> temp = new ArrayList<>();
 
     synchronized (groups)
     {
       int gSize = groups.size();
+      if (gSize == 0)
+      {
+        return noGroups;
+      }
+      temp.clear();
       for (int i = 0; i < gSize; i++)
       {
         SequenceGroup sg = groups.get(i);
@@ -2027,4 +2034,17 @@ public class Alignment implements AlignmentI
     }
   }
 
+  @Override
+  public void resetColors()
+  {
+    for (int i = getHeight(); --i >= 0;)
+    {
+      sequences.get(i).resetColors();
+    }
+    // if (dataset != null)
+    // {
+    // dataset.resetColors();
+    // }
+  }
+
 }