JAL-3285 small code changes to ConsensusThread not included in merge
[jalview.git] / src / jalview / workers / ConsensusThread.java
index 4242b2a..f5cad71 100644 (file)
@@ -64,7 +64,7 @@ public class ConsensusThread extends AlignCalcWorker
         {
           if (ap != null)
           {
-            ap.paintAlignment(false);
+            ap.paintAlignment(false, false);
           }
           Thread.sleep(200);
         } catch (Exception ex)
@@ -93,7 +93,7 @@ public class ConsensusThread extends AlignCalcWorker
 
       if (ap != null)
       {
-        ap.paintAlignment(true);
+        ap.paintAlignment(true, true);
       }
     } catch (OutOfMemoryError error)
     {
@@ -118,7 +118,10 @@ public class ConsensusThread extends AlignCalcWorker
   protected void eraseConsensus(int aWidth)
   {
     AlignmentAnnotation consensus = getConsensusAnnotation();
-    consensus.annotations = new Annotation[aWidth];
+    if (consensus != null)
+    {
+      consensus.annotations = new Annotation[aWidth];
+    }
     AlignmentAnnotation gap = getGapAnnotation();
     if (gap != null)
     {
@@ -202,7 +205,7 @@ public class ConsensusThread extends AlignCalcWorker
       AlignmentAnnotation gap = getGapAnnotation();
       if (gap != null)
       {
-        deriveGap(gap, hconsensus);
+        deriveOccupancy(gap, hconsensus);
       }
     }
   }
@@ -219,7 +222,6 @@ public class ConsensusThread extends AlignCalcWorker
   protected void deriveConsensus(AlignmentAnnotation consensusAnnotation,
           ProfilesI hconsensus)
   {
-
     long nseq = getSequences().length;
     AAFrequency.completeConsensus(consensusAnnotation, hconsensus,
             hconsensus.getStartColumn(), hconsensus.getEndColumn() + 1,