X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fapi%2FFeatureColourI.java;h=98a37c4e93698cc7a846aae059506256ae98869d;hb=e086b0c30bee5fe084186c65ef1ded42c58560f9;hp=3b2313d2c468e16f5aa994b6aacfc2eda2b6989e;hpb=50ebdf8f3a7fdce1421a6af7a0afd317c347372c;p=jalview.git diff --git a/src/jalview/api/FeatureColourI.java b/src/jalview/api/FeatureColourI.java index 3b2313d..98a37c4 100644 --- a/src/jalview/api/FeatureColourI.java +++ b/src/jalview/api/FeatureColourI.java @@ -21,7 +21,6 @@ package jalview.api; import jalview.datamodel.SequenceFeature; -import jalview.util.matcher.KeyedMatcherSetI; import java.awt.Color; @@ -57,6 +56,14 @@ public interface FeatureColourI Color getMaxColour(); /** + * Returns the 'no value' colour (used when a feature lacks score, or the + * attribute, being used for colouring) + * + * @return + */ + Color getNoColour(); + + /** * Answers true if the feature has a single colour, i.e. if isColourByLabel() * and isGraduatedColour() both answer false * @@ -65,7 +72,8 @@ public interface FeatureColourI boolean isSimpleColour(); /** - * Answers true if the feature is coloured by label (description) + * Answers true if the feature is coloured by label (description) or by text + * value of an attribute * * @return */ @@ -94,18 +102,6 @@ public interface FeatureColourI void setAboveThreshold(boolean b); /** - * Answers true if the threshold is the minimum value (when - * isAboveThreshold()) or maximum value (when isBelowThreshold()) of the - * colour range; only applicable when isGraduatedColour and either - * isAboveThreshold() or isBelowThreshold() answers true - * - * @return - */ - boolean isThresholdMinMax(); - - void setThresholdMinMax(boolean b); - - /** * Returns the threshold value (if any), else zero * * @return @@ -157,7 +153,10 @@ public interface FeatureColourI Color getColor(SequenceFeature feature); /** - * Update the min-max range for a graduated colour scheme + * Update the min-max range for a graduated colour scheme. Note that the + * colour scheme may be configured to colour by feature score, or a + * (numeric-valued) attribute - the caller should ensure that the correct + * range is being set. * * @param min * @param max @@ -172,18 +171,45 @@ public interface FeatureColourI String toJalviewFormat(String featureType); /** - * Sets the attribute filter conditions, or removes them if the argument is - * null + * Answers true if colour is by attribute text or numerical value * - * @param filter + * @return + */ + boolean isColourByAttribute(); + + /** + * Answers the name of the attribute (and optional sub-attribute...) used for + * colouring if any, or null + * + * @return + */ + String[] getAttributeName(); + + /** + * Sets the name of the attribute (and optional sub-attribute...) used for + * colouring if any, or null to remove this property + * + * @return + */ + void setAttributeName(String... name); + + /** + * Answers true if colour has a threshold set, and the feature score (or other + * attribute selected for colouring) is outwith the threshold. + *

+ * Answers false if not a graduated colour, or no threshold is set, or value + * is not outwith the threshold, or value is null or non-numeric. + * + * @param sf + * @return */ - public void setAttributeFilters(KeyedMatcherSetI filter); + boolean isOutwithThreshold(SequenceFeature sf); /** - * Answers the attribute value filters for the colour scheme, or null if no - * filters are set + * Answers a human-readable text description of the colour, suitable for display + * as a tooltip, possibly internationalised for the user's locale. * * @return */ - public KeyedMatcherSetI getAttributeFilters(); + String getDescription(); }