X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=test%2Fjalview%2Fschemes%2FAnnotationColourGradientTest.java;h=c56da593d97236e67b67a2d1b9191e10732356ef;hb=033962da90469745dd6639a1346ecbcbe2ed071f;hp=be8b58dbc4727eb1a8404998c54c285b9ae2cce2;hpb=424648b2e57e45eaa21c006b44828d8fca418581;p=jalview.git diff --git a/test/jalview/schemes/AnnotationColourGradientTest.java b/test/jalview/schemes/AnnotationColourGradientTest.java index be8b58d..c56da59 100644 --- a/test/jalview/schemes/AnnotationColourGradientTest.java +++ b/test/jalview/schemes/AnnotationColourGradientTest.java @@ -208,15 +208,16 @@ public class AnnotationColourGradientTest { AnnotationColourGradient testee = new AnnotationColourGradient(ann, minColour, maxColour, AnnotationColourGradient.ABOVE_THRESHOLD); - testee = (AnnotationColourGradient) testee.getInstance(al, null); + testee = (AnnotationColourGradient) testee.getInstance(null, al); for (int col = 0; col < WIDTH; col++) { Color result = testee.findColour('a', col, seq); /* - * expect white below threshold of 5 + * expect white at or below threshold of 5 */ - Color expected = col < 5 ? Color.white : new Color(50 + 10 * col, + Color expected = col <= 5 ? Color.white + : new Color(50 + 10 * col, 200 - 10 * col, 150 + 10 * col); assertEquals(result, expected, "for column " + col); @@ -230,11 +231,12 @@ public class AnnotationColourGradientTest for (int col = 0; col < WIDTH; col++) { /* - * colours for values >= threshold are graduated + * colours for values > threshold are graduated * range is 6-10 so steps of 100/5 = 20 */ int factor = col - THRESHOLD_FIVE; - Color expected = col < 5 ? Color.white : new Color(50 + 20 * factor, + Color expected = col <= 5 ? Color.white + : new Color(50 + 20 * factor, 200 - 20 * factor, 150 + 20 * factor); Color result = testee.findColour('a', col, seq); @@ -250,12 +252,13 @@ public class AnnotationColourGradientTest { AnnotationColourGradient testee = new AnnotationColourGradient(ann, minColour, maxColour, AnnotationColourGradient.BELOW_THRESHOLD); - testee = (AnnotationColourGradient) testee.getInstance(al, null); + testee = (AnnotationColourGradient) testee.getInstance(null, al); for (int col = 0; col < WIDTH; col++) { Color result = testee.findColour('a', col, seq); - Color expected = col > 5 ? Color.white : new Color(50 + 10 * col, + Color expected = col >= 5 ? Color.white + : new Color(50 + 10 * col, 200 - 10 * col, 150 + 10 * col); assertEquals(result, expected, "for column " + col); } @@ -268,10 +271,11 @@ public class AnnotationColourGradientTest for (int col = 0; col < WIDTH; col++) { /* - * colours for values <= threshold are graduated + * colours for values < threshold are graduated * range is 0-5 so steps of 100/5 = 20 */ - Color expected = col > 5 ? Color.white : new Color(50 + 20 * col, + Color expected = col >= 5 ? Color.white + : new Color(50 + 20 * col, 200 - 20 * col, 150 + 20 * col); Color result = testee.findColour('a', col, seq); assertEquals(result, expected, "for column " + col); @@ -283,7 +287,7 @@ public class AnnotationColourGradientTest { AnnotationColourGradient testee = new AnnotationColourGradient(ann, minColour, maxColour, AnnotationColourGradient.NO_THRESHOLD); - testee = (AnnotationColourGradient) testee.getInstance(al, null); + testee = (AnnotationColourGradient) testee.getInstance(null, al); for (int col = 0; col < WIDTH; col++) { @@ -302,7 +306,7 @@ public class AnnotationColourGradientTest { AnnotationColourGradient testee = new AnnotationColourGradient(ann, minColour, maxColour, AnnotationColourGradient.NO_THRESHOLD); - testee = (AnnotationColourGradient) testee.getInstance(al, null); + testee = (AnnotationColourGradient) testee.getInstance(null, al); /* * flag corresponding to 'use original colours' checkbox