Merge branch 'feature/JAL-3127_seqidChainshading' into merge/JAL-3127
[jalview.git] / src / jalview / api / FeatureRenderer.java
index ef0abbd..404c497 100644 (file)
@@ -22,7 +22,7 @@ package jalview.api;
 
 import jalview.datamodel.SequenceFeature;
 import jalview.datamodel.SequenceI;
-import jalview.util.matcher.KeyedMatcherSetI;
+import jalview.datamodel.features.FeatureMatcherSetI;
 
 import java.awt.Color;
 import java.awt.Graphics;
@@ -223,14 +223,14 @@ public interface FeatureRenderer
    * @param featureType
    * @return
    */
-  KeyedMatcherSetI getFeatureFilter(String featureType);
+  FeatureMatcherSetI getFeatureFilter(String featureType);
 
   /**
-   * Answers a shallow copy of the feature filters map
+   * Answers the feature filters map
    * 
    * @return
    */
-  public Map<String, KeyedMatcherSetI> getFeatureFilters();
+  public Map<String, FeatureMatcherSetI> getFeatureFilters();
 
   /**
    * Sets the filters for the feature type, or removes them if a null or empty
@@ -239,14 +239,14 @@ public interface FeatureRenderer
    * @param featureType
    * @param filter
    */
-  void setFeatureFilter(String featureType, KeyedMatcherSetI filter);
+  void setFeatureFilter(String featureType, FeatureMatcherSetI filter);
 
   /**
    * Replaces all feature filters with the given map
    * 
    * @param filters
    */
-  void setFeatureFilters(Map<String, KeyedMatcherSetI> filters);
+  void setFeatureFilters(Map<String, FeatureMatcherSetI> filters);
 
   /**
    * Returns the colour for a particular feature instance. This includes
@@ -255,14 +255,29 @@ public interface FeatureRenderer
    * <p>
    * Returns null if
    * <ul>
-   * <li>feature type is not visible, or</li>
    * <li>feature group is not visible, or</li>
    * <li>feature values lie outside any colour threshold, or</li>
    * <li>feature is excluded by filter conditions</li>
    * </ul>
+   * This method does not check feature type visibility.
    * 
    * @param feature
    * @return
    */
   Color getColour(SequenceFeature feature);
+
+  /**
+   * Answers true if feature would be shown, else false. A feature is shown if
+   * <ul>
+   * <li>its feature type is set to visible</li>
+   * <li>its feature group is either null, or set to visible</li>
+   * <li>it is not excluded by a colour threshold on score or other numeric
+   * attribute</li>
+   * <li>it is not excluded by a filter condition</li>
+   * </ul>
+   * 
+   * @param feature
+   * @return
+   */
+  boolean isVisible(SequenceFeature feature);
 }