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.datamodel.SequenceI;
26 import java.awt.Color;
27 import java.awt.Graphics;
28 import java.util.List;
32 * Abstract feature renderer interface
37 public interface FeatureRenderer
41 * compute the perceived colour for a given column position in sequenceI,
42 * taking transparency and feature visibility into account.
45 * - background colour (due to alignment/group shading schemes, etc).
47 * - sequence providing features
53 Color findFeatureColour(Color col, SequenceI sequenceI, int r, Graphics g);
56 * trigger the feature discovery process for a newly created feature renderer.
63 * @return display style for a feature
65 FeatureColourI getFeatureStyle(String ft);
68 * update the feature style for a particular feature
73 void setColour(String ft, FeatureColourI ggc);
75 AlignViewportI getViewport();
79 * @return container managing list of feature types and their visibility
81 FeaturesDisplayedI getFeaturesDisplayed();
84 * get display style for all features types - visible or invisible
88 Map<String, FeatureColourI> getFeatureColours();
91 * query the alignment view to find all features
93 * @param newMadeVisible
94 * - when true, automatically make newly discovered types visible
96 void findAllFeatures(boolean newMadeVisible);
99 * get display style for all features types currently visible
103 Map<String, FeatureColourI> getDisplayedFeatureCols();
106 * get all registered groups
110 List<String> getFeatureGroups();
113 * get groups that are visible/invisible
118 List<String> getGroups(boolean visible);
121 * change visibility for a range of groups
126 void setGroupVisibility(List<String> toset, boolean visible);
129 * change visibiilty of given group
134 void setGroupVisibility(String group, boolean visible);
137 * Returns features at the specified position on the given sequence.
138 * Non-positional features are not included.
144 List<SequenceFeature> findFeaturesAtRes(SequenceI sequence, int res);
147 * get current displayed types, in ordering of rendering (on top last)
149 * @return a (possibly empty) list of feature types
152 List<String> getDisplayedFeatureTypes();
155 * get current displayed groups
157 * @return a (possibly empty) list of feature groups
159 List<String> getDisplayedFeatureGroups();
162 * display all features of these types
164 * @param featureTypes
166 void setAllVisible(List<String> featureTypes);
169 * display featureType
173 void setVisible(String featureType);
176 * Sets the transparency value, between 0 (full transparency) and 1 (no
181 void setTransparency(float value);
184 * Returns the transparency value, between 0 (full transparency) and 1 (no
189 float getTransparency();