JAL-2228 removed FeatureCounterI in favour of FeatureSetCounterI with
[jalview.git] / src / jalview / workers / ColumnCounterSetWorker.java
index cf6a229..e1cbd2a 100644 (file)
@@ -140,6 +140,12 @@ class ColumnCounterSetWorker extends AlignCalcWorker
     {
       max[crow] = 0;
     }
+
+    int[] minC = counter.getMinColour();
+    int[] maxC = counter.getMaxColour();
+    Color minColour = new Color(minC[0], minC[1], minC[2]);
+    Color maxColour = new Color(maxC[0], maxC[1], maxC[2]);
+
     for (int col = 0; col < width; col++)
     {
       int[] count = counts[col];
@@ -175,8 +181,8 @@ class ColumnCounterSetWorker extends AlignCalcWorker
         int count = counts[i][anrow];
         if (count > 0)
         {
-          Color color = ColorUtils.getGraduatedColour(count, 0, Color.cyan,
-                  max[anrow], Color.blue);
+          Color color = ColorUtils.getGraduatedColour(count, 0, minColour,
+                  max[anrow], maxColour);
           String str = String.valueOf(count);
           anns[i] = new Annotation(str, str, '0', count, color);
         }
@@ -185,11 +191,11 @@ class ColumnCounterSetWorker extends AlignCalcWorker
       /*
        * construct or update the annotation
        */
+      String description = counter.getDescriptions()[anrow];
       AlignmentAnnotation ann = alignViewport.getAlignment()
               .findOrCreateAnnotation(counter.getNames()[anrow],
-                      counter.getDescriptions()[anrow], false, null,
-                      null);
-      ann.description = counter.getDescriptions()[anrow];
+                      description, false, null, null);
+      ann.description = description;
       ann.showAllColLabels = true;
       ann.scaleColLabel = true;
       ann.graph = AlignmentAnnotation.BAR_GRAPH;