3 import jalview.datamodel.SequenceFeature;
5 public interface FeatureColourI
9 * Answers true when the feature colour varies across the score range
13 boolean isGraduatedColour();
16 * Returns the feature colour (when isGraduatedColour answers false)
23 * Returns the minimum colour (when isGraduatedColour answers true)
27 ColorI getMinColour();
30 * Returns the maximum colour (when isGraduatedColour answers true)
34 ColorI getMaxColour();
37 * Answers true if the feature has a single colour, i.e. if isColourByLabel()
38 * and isGraduatedColour() both answer false
42 boolean isSimpleColour();
45 * Answers true if the feature is coloured by label (description)
49 boolean isColourByLabel();
51 void setColourByLabel(boolean b);
54 * Answers true if the feature is coloured below a threshold value; only
55 * applicable when isGraduatedColour answers true
59 boolean isBelowThreshold();
61 void setBelowThreshold(boolean b);
64 * Answers true if the feature is coloured above a threshold value; only
65 * applicable when isGraduatedColour answers true
69 boolean isAboveThreshold();
71 void setAboveThreshold(boolean b);
74 * Answers true if the threshold is the minimum value (when
75 * isAboveThreshold()) or maximum value (when isBelowThreshold()) of the
76 * colour range; only applicable when isGraduatedColour and either
77 * isAboveThreshold() or isBelowThreshold() answers true
81 boolean isThresholdMinMax();
83 void setThresholdMinMax(boolean b);
86 * Returns the threshold value (if any), else zero
92 void setThreshold(float f);
95 * Answers true if either isAboveThreshold or isBelowThreshold answers true
99 boolean hasThreshold();
102 * Answers true if the colour varies between the actual minimum and maximum
103 * score values of the feature, or false if between absolute minimum and
104 * maximum values (or if not a graduated colour).
108 boolean isAutoScaled();
110 void setAutoScaled(boolean b);
113 * Answers true if the feature has a simple colour, or is coloured by label,
114 * or has a graduated colour and the score of this feature instance is within
115 * the range to render (if any), i.e. does not lie below or above any
121 boolean isColored(SequenceFeature feature);
124 * Update the min-max range for a graduated colour scheme
129 void updateBounds(float min, float max);
132 * Returns the colour in Jalview features file format
136 String toJalviewFormat(String featureType);
139 * Returns the maximum score of the graduated colour range
146 * Returns the minimum score of the graduated colour range
153 * Returns the computed colour for the given sequence feature
158 ColorI getColor(SequenceFeature feature);