3 import jalview.datamodel.SequenceFeature;
7 public interface FeatureColourI
11 * Answers true when the feature colour varies across the score range
15 boolean isGraduatedColour();
18 * Returns the feature colour (when isGraduatedColour answers false)
25 * Returns the minimum colour (when isGraduatedColour answers true)
32 * Returns the maximum colour (when isGraduatedColour answers true)
39 * Answers true if the feature has a single colour, i.e. if isColourByLabel()
40 * and isGraduatedColour() both answer false
44 boolean isSimpleColour();
47 * Answers true if the feature is coloured by label (description)
51 boolean isColourByLabel();
53 void setColourByLabel(boolean b);
56 * Answers true if the feature is coloured below a threshold value; only
57 * applicable when isGraduatedColour answers true
61 boolean isBelowThreshold();
63 void setBelowThreshold(boolean b);
66 * Answers true if the feature is coloured above a threshold value; only
67 * applicable when isGraduatedColour answers true
71 boolean isAboveThreshold();
73 void setAboveThreshold(boolean b);
76 * Answers true if the threshold is the minimum value (when
77 * isAboveThreshold()) or maximum value (when isBelowThreshold()) of the
78 * colour range; only applicable when isGraduatedColour and either
79 * isAboveThreshold() or isBelowThreshold() answers true
83 boolean isThresholdMinMax();
85 void setThresholdMinMax(boolean b);
88 * Returns the threshold value (if any), else zero
94 void setThreshold(float f);
97 * Answers true if the colour varies between the actual minimum and maximum
98 * score values of the feature, or false if between absolute minimum and
99 * maximum values (or if not a graduated colour).
103 boolean isAutoScaled();
105 void setAutoScaled(boolean b);
108 * Returns the maximum score of the graduated colour range
115 * Returns the minimum score of the graduated colour range
122 * Answers true if either isAboveThreshold or isBelowThreshold answers true
126 boolean hasThreshold();
129 * Returns the computed colour for the given sequence feature
134 Color getColor(SequenceFeature feature);
137 * Answers true if the feature has a simple colour, or is coloured by label,
138 * or has a graduated colour and the score of this feature instance is within
139 * the range to render (if any), i.e. does not lie below or above any
145 boolean isColored(SequenceFeature feature);
148 * Update the min-max range for a graduated colour scheme
153 void updateBounds(float min, float max);
156 * Returns the colour in Jalview features file format
160 String toJalviewFormat(String featureType);