JAL-2808 reverted to develop (attribute filters removed)
[jalview.git] / src / jalview / schemes / FeatureColour.java
index 2dac7db..54d1c6c 100644 (file)
@@ -24,11 +24,9 @@ import jalview.api.FeatureColourI;
 import jalview.datamodel.SequenceFeature;
 import jalview.util.ColorUtils;
 import jalview.util.Format;
-import jalview.util.matcher.KeyedMatcherSetI;
 
 import java.awt.Color;
 import java.util.StringTokenizer;
-import java.util.function.Function;
 
 /**
  * A class that wraps either a simple colour or a graduated colour
@@ -75,11 +73,6 @@ public class FeatureColour implements FeatureColourI
 
   final private float deltaBlue;
 
-  /*
-   * optional filter(s) by attribute values
-   */
-  private KeyedMatcherSetI attributeFilters;
-
   /**
    * Parses a Jalview features file format colour descriptor
    * [label|][mincolour|maxcolour
@@ -366,7 +359,6 @@ public class FeatureColour implements FeatureColourI
     base = fc.base;
     range = fc.range;
     isHighToLow = fc.isHighToLow;
-    attributeFilters = fc.attributeFilters;
     setAboveThreshold(fc.isAboveThreshold());
     setBelowThreshold(fc.isBelowThreshold());
     setThreshold(fc.getThreshold());
@@ -548,11 +540,6 @@ public class FeatureColour implements FeatureColourI
   @Override
   public Color getColor(SequenceFeature feature)
   {
-    if (!matchesFilters(feature))
-    {
-      return null;
-    }
-
     if (isColourByLabel())
     {
       return ColorUtils.createColourFromName(feature.getDescription());
@@ -602,28 +589,6 @@ public class FeatureColour implements FeatureColourI
   }
 
   /**
-   * Answers true if either there are no attribute value filters defined, or the
-   * feature matches all of the filter conditions. Answers false if the feature
-   * fails the filter conditions.
-   * 
-   * @param feature
-   * 
-   * @return
-   */
-  boolean matchesFilters(SequenceFeature feature)
-  {
-    if (attributeFilters == null)
-    {
-      return true;
-    }
-
-    Function<String, String> valueProvider = key -> feature.otherDetails == null ? null
-                    : (feature.otherDetails.containsKey(key) ? feature.otherDetails
-                            .get(key).toString() : null);
-    return attributeFilters.matches(valueProvider);
-  }
-
-  /**
    * Returns the maximum score of the graduated colour range
    * 
    * @return
@@ -709,21 +674,4 @@ public class FeatureColour implements FeatureColourI
     return String.format("%s\t%s", featureType, colourString);
   }
 
-  /**
-   * Adds an attribute filter
-   * 
-   * @param attName
-   * @param filter
-   */
-  @Override
-  public void setAttributeFilters(KeyedMatcherSetI matcher)
-  {
-    attributeFilters = matcher;
-  }
-
-  @Override
-  public KeyedMatcherSetI getAttributeFilters()
-  {
-    return attributeFilters;
-  }
 }