X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fschemes%2FFeatureColour.java;h=f1bade151686ca674cfd23fae878ea45e64e9270;hb=d4271d32477e99e9fbbfa5db3e11f1b79324e60d;hp=0d36f4f3057f289fc43bf670f632ba99d56c9598;hpb=3027bfb4b1b13af8686abcd419888e03141bd672;p=jalview.git diff --git a/src/jalview/schemes/FeatureColour.java b/src/jalview/schemes/FeatureColour.java index 0d36f4f..f1bade1 100644 --- a/src/jalview/schemes/FeatureColour.java +++ b/src/jalview/schemes/FeatureColour.java @@ -20,6 +20,8 @@ */ package jalview.schemes; +import java.util.Locale; + import jalview.api.FeatureColourI; import jalview.datamodel.SequenceFeature; import jalview.datamodel.features.FeatureMatcher; @@ -46,8 +48,9 @@ import java.util.StringTokenizer; *
  • the range may be the full value range, or may be limited by the threshold * value
  • * - *
  • colour by (text) value of a named attribute
  • graduated colour by - * (numeric) value of a named attribute
  • + *
  • colour by (text) value of a named attribute
  • + *
  • graduated colour by (numeric) value of a named attribute
  • + * */ public class FeatureColour implements FeatureColourI { @@ -194,19 +197,19 @@ public class FeatureColour implements FeatureColourI "Expected either 'label' or a colour specification in the line: " + descriptor); } - if (nextToken.toLowerCase().startsWith(LABEL)) + if (nextToken.toLowerCase(Locale.ROOT).startsWith(LABEL)) { byLabel = true; // get the token after the next delimiter: mincol = (gcol.hasMoreTokens() ? gcol.nextToken() : null); mincol = (gcol.hasMoreTokens() ? gcol.nextToken() : null); } - else if (nextToken.toLowerCase().startsWith(SCORE)) + else if (nextToken.toLowerCase(Locale.ROOT).startsWith(SCORE)) { mincol = (gcol.hasMoreTokens() ? gcol.nextToken() : null); mincol = (gcol.hasMoreTokens() ? gcol.nextToken() : null); } - else if (nextToken.toLowerCase().startsWith(ATTRIBUTE)) + else if (nextToken.toLowerCase(Locale.ROOT).startsWith(ATTRIBUTE)) { byAttribute = true; attName = (gcol.hasMoreTokens() ? gcol.nextToken() : null); @@ -304,7 +307,7 @@ public class FeatureColour implements FeatureColourI } gcol.nextToken(); // skip next '|' - if (tok.toLowerCase().startsWith(ABSOLUTE)) + if (tok.toLowerCase(Locale.ROOT).startsWith(ABSOLUTE)) { minval = gcol.nextToken(); gcol.nextToken(); // skip next '|' @@ -380,17 +383,17 @@ public class FeatureColour implements FeatureColourI { // threshold type and possibly a threshold value ttype = gcol.nextToken(); - if (ttype.toLowerCase().startsWith(BELOW)) + if (ttype.toLowerCase(Locale.ROOT).startsWith(BELOW)) { featureColour.setBelowThreshold(true); } - else if (ttype.toLowerCase().startsWith(ABOVE)) + else if (ttype.toLowerCase(Locale.ROOT).startsWith(ABOVE)) { featureColour.setAboveThreshold(true); } else { - if (!ttype.toLowerCase().startsWith("no")) + if (!ttype.toLowerCase(Locale.ROOT).startsWith("no")) { System.err.println( "Ignoring unrecognised threshold type : " + ttype); @@ -696,8 +699,8 @@ public class FeatureColour implements FeatureColourI { String label = attributeName == null ? feature.getDescription() : feature.getValueAsString(attributeName); - return label == null ? noColour : ColorUtils - .createColourFromName(label); + return label == null ? noColour + : ColorUtils.createColourFromName(label); } if (!isGraduatedColour()) @@ -823,7 +826,7 @@ public class FeatureColour implements FeatureColourI sb.append(BAR).append(Format.getHexString(getMinColour())) .append(BAR); sb.append(Format.getHexString(getMaxColour())).append(BAR); - + /* * 'no value' colour should be null, min or max colour; * if none of these, coerce to minColour