X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fjalview%2Fschemes%2FFeatureColour.java;h=a40a6901decdb56137fadc5c84e4394065f733d0;hb=488e8b4ff975fbb83eac40f9e9f16d40c5a33d34;hp=23087a8a0e6954e61e18ad6f2b88d54fa094d36d;hpb=604cbee405a837565ba1a74aa9bddd62aed685ab;p=jalview.git diff --git a/src/jalview/schemes/FeatureColour.java b/src/jalview/schemes/FeatureColour.java index 23087a8..a40a690 100644 --- a/src/jalview/schemes/FeatureColour.java +++ b/src/jalview/schemes/FeatureColour.java @@ -22,6 +22,7 @@ package jalview.schemes; import jalview.api.FeatureColourI; import jalview.datamodel.SequenceFeature; +import jalview.util.ColorUtils; import jalview.util.Format; import java.awt.Color; @@ -121,11 +122,11 @@ public class FeatureColour implements FeatureColourI /* * only a simple colour specification - parse it */ - Color colour = UserColourScheme.getColourFromString(descriptor); + 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); } @@ -212,9 +213,9 @@ public class FeatureColour implements FeatureColourI FeatureColour featureColour; try { - featureColour = new FeatureColour( - new UserColourScheme(mincol).findColour('A'), - new UserColourScheme(maxcol).findColour('A'), 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 @@ -235,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); } } } @@ -255,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()); @@ -306,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; @@ -533,8 +542,7 @@ public class FeatureColour implements FeatureColourI { if (isColourByLabel()) { - return UserColourScheme - .createColourFromName(feature.getDescription()); + return ColorUtils.createColourFromName(feature.getDescription()); } if (!isGraduatedColour())