X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fschemes%2FFeatureColour.java;h=a40a6901decdb56137fadc5c84e4394065f733d0;hb=32c56f877253fa8917d4f4640ed65d6e63376dac;hp=70897de4ffd6c56db7f3f78ee29eaec0bf6d9ccc;hpb=b0cee3aaf7d8873910939f97b6acb217d518968d;p=jalview.git diff --git a/src/jalview/schemes/FeatureColour.java b/src/jalview/schemes/FeatureColour.java index 70897de..a40a690 100644 --- a/src/jalview/schemes/FeatureColour.java +++ b/src/jalview/schemes/FeatureColour.java @@ -125,8 +125,8 @@ public class FeatureColour implements FeatureColourI Color colour = ColorUtils.parseColourString(descriptor); if (colour == null) { - throw new IllegalArgumentException("Invalid colour descriptor: " - + descriptor); + throw new IllegalArgumentException( + "Invalid colour descriptor: " + descriptor); } return new FeatureColour(colour); } @@ -213,9 +213,9 @@ public class FeatureColour implements FeatureColourI FeatureColour featureColour; try { - featureColour = new FeatureColour( - new UserColourScheme(mincol).findColour(), - new UserColourScheme(maxcol).findColour(), min, max); + Color minColour = ColorUtils.parseColourString(mincol); + Color maxColour = ColorUtils.parseColourString(maxcol); + featureColour = new FeatureColour(minColour, maxColour, min, max); featureColour.setColourByLabel(labelColour); featureColour.setAutoScaled(autoScaled); // add in any additional parameters @@ -236,8 +236,8 @@ public class FeatureColour implements FeatureColourI { if (!ttype.toLowerCase().startsWith("no")) { - System.err.println("Ignoring unrecognised threshold type : " - + ttype); + System.err.println( + "Ignoring unrecognised threshold type : " + ttype); } } } @@ -256,8 +256,8 @@ public class FeatureColour implements FeatureColourI } if (gcol.hasMoreTokens()) { - System.err - .println("Ignoring additional tokens in parameters in graduated colour specification\n"); + System.err.println( + "Ignoring additional tokens in parameters in graduated colour specification\n"); while (gcol.hasMoreTokens()) { System.err.println("|" + gcol.nextToken()); @@ -307,6 +307,14 @@ public class FeatureColour implements FeatureColourI */ public FeatureColour(Color low, Color high, float min, float max) { + if (low == null) + { + low = Color.white; + } + if (high == null) + { + high = Color.black; + } graduatedColour = true; colour = null; minColour = low; @@ -534,8 +542,7 @@ public class FeatureColour implements FeatureColourI { if (isColourByLabel()) { - return ColorUtils - .createColourFromName(feature.getDescription()); + return ColorUtils.createColourFromName(feature.getDescription()); } if (!isGraduatedColour())