X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fschemes%2FGraduatedColor.java;h=2d1c572ae8028c9561029da05b63bb8c5201cc47;hb=65d6d09cd08743d481d39521bb0298ea683888f8;hp=4f1cb58ea93951031b12958def55fb4abd4d3b40;hpb=ad15cff29620f960119f80176f1fd443da9f6763;p=jalview.git diff --git a/src/jalview/schemes/GraduatedColor.java b/src/jalview/schemes/GraduatedColor.java index 4f1cb58..2d1c572 100644 --- a/src/jalview/schemes/GraduatedColor.java +++ b/src/jalview/schemes/GraduatedColor.java @@ -20,6 +20,7 @@ */ package jalview.schemes; +import jalview.api.FeatureColourI; import jalview.datamodel.SequenceFeature; import java.awt.Color; @@ -118,6 +119,11 @@ public class GraduatedColor updateBounds(min, max); } + public GraduatedColor(FeatureColourI col) + { + setColourByLabel(col.isColourByLabel()); + } + public Color getMinColor() { return new Color(lr, lg, lb); @@ -145,7 +151,7 @@ public class GraduatedColor public boolean isColored(SequenceFeature feature) { float val = feature.getScore(); - if (val == Float.NaN) + if (Float.isNaN(val)) { return true; } @@ -153,7 +159,7 @@ public class GraduatedColor { return true; } - if (this.thrsh == Float.NaN) + if (Float.isNaN(this.thrsh)) { return true; } @@ -211,7 +217,7 @@ public class GraduatedColor return getMaxColor(); } float scr = feature.getScore(); - if (scr == Float.NaN) + if (Float.isNaN(scr)) { return getMinColor(); }