From: gmungoc Date: Fri, 9 Jun 2017 14:21:35 +0000 (+0100) Subject: JAL-2589 render colour scheme gap colour in overview X-Git-Tag: Release_2_10_3b1~183^2~4^2~1^2 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=refs%2Fheads%2Fbug%2FJAL-2589gapColour;p=jalview.git JAL-2589 render colour scheme gap colour in overview --- diff --git a/src/jalview/renderer/seqfeatures/FeatureRenderer.java b/src/jalview/renderer/seqfeatures/FeatureRenderer.java index 72ac2c8..98f5bff 100644 --- a/src/jalview/renderer/seqfeatures/FeatureRenderer.java +++ b/src/jalview/renderer/seqfeatures/FeatureRenderer.java @@ -223,7 +223,11 @@ public class FeatureRenderer extends FeatureRendererModel if (Comparison.isGap(seq.getCharAt(column))) { - return Color.white; + /* + * returning null allows the colour scheme to provide gap colour + * - normally white, but can be customised otherwise + */ + return null; } Color renderedColour = null; diff --git a/test/jalview/renderer/seqfeatures/FeatureColourFinderTest.java b/test/jalview/renderer/seqfeatures/FeatureColourFinderTest.java index 59566ed..9b68b43 100644 --- a/test/jalview/renderer/seqfeatures/FeatureColourFinderTest.java +++ b/test/jalview/renderer/seqfeatures/FeatureColourFinderTest.java @@ -2,6 +2,7 @@ package jalview.renderer.seqfeatures; import static org.testng.Assert.assertEquals; import static org.testng.Assert.assertFalse; +import static org.testng.Assert.assertNull; import static org.testng.Assert.assertTrue; import jalview.api.FeatureColourI; @@ -126,6 +127,10 @@ public class FeatureColourFinderTest assertEquals(c, Color.red); } + /** + * feature colour at a gap is null (not white) - a user defined colour scheme + * can then provide a bespoke gap colour if configured to do so + */ @Test(groups = "Functional") public void testFindFeatureColour_gapPosition() { @@ -135,7 +140,7 @@ public class FeatureColourFinderTest fr.featuresAdded(); av.setShowSequenceFeatures(true); Color c = finder.findFeatureColour(null, seq, 6); - assertEquals(c, Color.white); + assertNull(c); } @Test(groups = "Functional")