2 * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
3 * Copyright (C) $$Year-Rel$$ The Jalview Authors
5 * This file is part of Jalview.
7 * Jalview is free software: you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation, either version 3
10 * of the License, or (at your option) any later version.
12 * Jalview is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty
14 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with Jalview. If not, see <http://www.gnu.org/licenses/>.
19 * The Jalview Authors are detailed in the 'AUTHORS' file.
23 import jalview.datamodel.SequenceFeature;
24 import jalview.util.matcher.KeyedMatcherI;
26 import java.awt.Color;
28 public interface FeatureColourI
32 * Answers true when the feature colour varies across the score range
36 boolean isGraduatedColour();
39 * Returns the feature colour (when isGraduatedColour answers false)
46 * Returns the minimum colour (when isGraduatedColour answers true)
53 * Returns the maximum colour (when isGraduatedColour answers true)
60 * Answers true if the feature has a single colour, i.e. if isColourByLabel()
61 * and isGraduatedColour() both answer false
65 boolean isSimpleColour();
68 * Answers true if the feature is coloured by label (description)
72 boolean isColourByLabel();
74 void setColourByLabel(boolean b);
77 * Answers true if the feature is coloured below a threshold value; only
78 * applicable when isGraduatedColour answers true
82 boolean isBelowThreshold();
84 void setBelowThreshold(boolean b);
87 * Answers true if the feature is coloured above a threshold value; only
88 * applicable when isGraduatedColour answers true
92 boolean isAboveThreshold();
94 void setAboveThreshold(boolean b);
97 * Answers true if the threshold is the minimum value (when
98 * isAboveThreshold()) or maximum value (when isBelowThreshold()) of the
99 * colour range; only applicable when isGraduatedColour and either
100 * isAboveThreshold() or isBelowThreshold() answers true
104 boolean isThresholdMinMax();
106 void setThresholdMinMax(boolean b);
109 * Returns the threshold value (if any), else zero
113 float getThreshold();
115 void setThreshold(float f);
118 * Answers true if the colour varies between the actual minimum and maximum
119 * score values of the feature, or false if between absolute minimum and
120 * maximum values (or if not a graduated colour).
124 boolean isAutoScaled();
126 void setAutoScaled(boolean b);
129 * Returns the maximum score of the graduated colour range
136 * Returns the minimum score of the graduated colour range
143 * Answers true if either isAboveThreshold or isBelowThreshold answers true
147 boolean hasThreshold();
150 * Returns the computed colour for the given sequence feature. Answers null if
151 * the score of this feature instance is outside the range to render (if any),
152 * i.e. lies below or above a configured threshold.
157 Color getColor(SequenceFeature feature);
160 * Update the min-max range for a graduated colour scheme
165 void updateBounds(float min, float max);
168 * Returns the colour in Jalview features file format
172 String toJalviewFormat(String featureType);
175 * Sets the attribute filter conditions, or removes them if the argument is
180 public void setAttributeFilters(KeyedMatcherI filter);
183 * Answers the attribute value filters for the colour scheme, or null if no
188 public KeyedMatcherI getAttributeFilters();