3 import jalview.datamodel.SequenceFeature;
7 public interface FeatureColourI
11 * Answers true when the feature colour varies across the score range
15 boolean isGraduatedColour();
17 void setGraduatedColour(boolean b);
20 * Returns the feature colour (when isGraduatedColour answers false)
27 * Returns the minimum colour (when isGraduatedColour answers true)
34 * Returns the maximum colour (when isGraduatedColour answers true)
41 * Answers true if the feature has a single colour, i.e. if isColourByLabel()
42 * and isGraduatedColour() both answer false
46 boolean isSimpleColour();
49 * Answers true if the feature is coloured by label (description)
53 boolean isColourByLabel();
55 void setColourByLabel(boolean b);
58 * Answers true if the feature is coloured below a threshold value; only
59 * applicable when isGraduatedColour answers true
63 boolean isBelowThreshold();
65 void setBelowThreshold(boolean b);
68 * Answers true if the feature is coloured above a threshold value; only
69 * applicable when isGraduatedColour answers true
73 boolean isAboveThreshold();
75 void setAboveThreshold(boolean b);
78 * Answers true if the threshold is the minimum value (when
79 * isAboveThreshold()) or maximum value (when isBelowThreshold()) of the
80 * colour range; only applicable when isGraduatedColour and either
81 * isAboveThreshold() or isBelowThreshold() answers true
85 boolean isThresholdMinMax();
87 void setThresholdMinMax(boolean b);
90 * Returns the threshold value (if any), else zero
96 void setThreshold(float f);
98 boolean isAutoScaled();
100 void setAutoScaled(boolean b);
103 * Returns the maximum score of the graduated colour range
110 * Returns the minimum score of the graduated colour range
117 * Answers true if either isAboveThreshold or isBelowThreshold answers true
121 boolean hasThreshold();
124 * Returns the computed colour for the given sequence feature
129 Color getColor(SequenceFeature feature);
132 * Answers true if the feature has a simple colour, or is coloured by label,
133 * or has a graduated colour and the score of this feature instance is within
134 * the range to render (if any), i.e. does not lie below or above any
140 boolean isColored(SequenceFeature feature);
143 * Update the min-max range for a graduated colour scheme
148 void updateBounds(float min, float max);
151 * Returns the colour in Jalview features file format
155 String toJalviewFormat(String featureType);