JAL-2791 ignore feature type visibility in getColor()
authorgmungoc <g.m.carstairs@dundee.ac.uk>
Wed, 10 Jan 2018 15:17:53 +0000 (15:17 +0000)
committergmungoc <g.m.carstairs@dundee.ac.uk>
Wed, 10 Jan 2018 15:17:53 +0000 (15:17 +0000)
src/jalview/viewmodel/seqfeatures/FeatureRendererModel.java
test/jalview/renderer/seqfeatures/FeatureRendererTest.java

index 16cb684..e4d9d88 100644 (file)
@@ -1100,8 +1100,8 @@ public abstract class FeatureRendererModel
 
   /**
    * Answers the colour for the feature, or null if the feature is excluded by
-   * feature type or group visibility, by filters, or by colour threshold
-   * settings
+   * feature group visibility, by filters, or by colour threshold settings. This
+   * method does not take feature visibility into account.
    * 
    * @param sf
    * @param fc
@@ -1110,14 +1110,6 @@ public abstract class FeatureRendererModel
   public Color getColor(SequenceFeature sf, FeatureColourI fc)
   {
     /*
-     * is the feature type displayed?
-     */
-    if (!showFeatureOfType(sf.getType()))
-    {
-      return null;
-    }
-
-    /*
      * is the feature group displayed?
      */
     if (featureGroupNotShown(sf))
index 03398c0..cebef11 100644 (file)
@@ -378,11 +378,12 @@ public class FeatureRendererTest
 
     /*
      * hide feature type, then unhide
+     * - feature type visibility should not affect the result
      */
     FeatureSettingsBean[] data = new FeatureSettingsBean[1];
     data[0] = new FeatureSettingsBean("Cath", fc, null, false);
     fr.setFeaturePriority(data);
-    assertNull(fr.getColour(sf1));
+    assertEquals(fr.getColour(sf1), Color.red);
     data[0] = new FeatureSettingsBean("Cath", fc, null, true);
     fr.setFeaturePriority(data);
     assertEquals(fr.getColour(sf1), Color.red);