Merge branch 'develop' into features/JAL-2094_colourInterface
[jalview.git] / src / jalview / schemes / FeatureColour.java
index 37c85d4..d0babf4 100644 (file)
@@ -112,10 +112,10 @@ public class FeatureColour implements FeatureColourI
     }
 
     /*
-     * autoScaled == true: colours range over actual score range; autoScaled ==
-     * false ('abso'): colours range over min/max range
+     * autoScaled == true: colours range over actual score range; 
+     * autoScaled == false ('abso'): colours range over min/max range
      */
-    boolean autoScaled = false;
+    boolean autoScaled = true;
     String tok = null, minval, maxval;
     if (mincol != null)
     {
@@ -139,15 +139,15 @@ public class FeatureColour implements FeatureColourI
       }
       tok = gcol.nextToken();
       gcol.nextToken(); // skip next '|'
-      if (tok.toLowerCase().indexOf("abso") != 0)
+      if (tok.toLowerCase().startsWith("abso"))
       {
-        minval = tok;
-        autoScaled = true;
+        minval = gcol.nextToken();
+        gcol.nextToken(); // skip next '|'
+        autoScaled = false;
       }
       else
       {
-        minval = gcol.nextToken();
-        gcol.nextToken(); // skip next '|'
+        minval = tok;
       }
       maxval = gcol.nextToken();
       if (gcol.hasMoreTokens())
@@ -365,20 +365,6 @@ public class FeatureColour implements FeatureColourI
     return graduatedColour;
   }
 
-  /**
-   * Sets the 'graduated colour' flag. If true, also sets 'colour by label' to
-   * false.
-   */
-  @Override
-  public void setGraduatedColour(boolean b)
-  {
-    graduatedColour = b;
-    if (b)
-    {
-      setColourByLabel(false);
-    }
-  }
-
   @Override
   public ColorI getColour()
   {
@@ -416,6 +402,20 @@ public class FeatureColour implements FeatureColourI
       setGraduatedColour(false);
     }
   }
+
+  /**
+   * Sets the 'graduated colour' flag. If true, also sets 'colour by label' to
+   * false.
+   */
+  void setGraduatedColour(boolean b)
+  {
+    graduatedColour = b;
+    if (b)
+    {
+      setColourByLabel(false);
+    }
+  }
+
   @Override
   public boolean isBelowThreshold()
   {
@@ -654,7 +654,7 @@ public class FeatureColour implements FeatureColourI
       {
         sb.append(Format.getHexString(getMinColour())).append(BAR);
         sb.append(Format.getHexString(getMaxColour())).append(BAR);
-        if (isAutoScaled())
+        if (!isAutoScaled())
         {
           sb.append("abso").append(BAR);
         }