JAL-2589 render colour scheme gap colour in overview bug/JAL-2589gapColour
authorgmungoc <g.m.carstairs@dundee.ac.uk>
Fri, 9 Jun 2017 14:21:35 +0000 (15:21 +0100)
committergmungoc <g.m.carstairs@dundee.ac.uk>
Fri, 9 Jun 2017 14:21:35 +0000 (15:21 +0100)
src/jalview/renderer/seqfeatures/FeatureRenderer.java
test/jalview/renderer/seqfeatures/FeatureColourFinderTest.java

index 72ac2c8..98f5bff 100644 (file)
@@ -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;
index 59566ed..9b68b43 100644 (file)
@@ -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")