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.util.List;
30 * Abstract feature renderer interface
35 public interface FeatureRenderer
39 * compute the perceived colour for a given column position in sequenceI,
40 * taking transparency and feature visibility into account.
43 * - background colour (due to alignment/group shading schemes, etc).
45 * - sequence providing features
50 ColorI findFeatureColour(ColorI col, SequenceI sequenceI, int r);
53 * trigger the feature discovery process for a newly created feature renderer.
60 * @return display style for a feature
62 FeatureColourI getFeatureStyle(String ft);
65 * update the feature style for a particular feature
68 * @param featureColour
70 void setColour(String featureType, FeatureColourI featureColour);
72 AlignViewportI getViewport();
76 * @return container managing list of feature types and their visibility
78 FeaturesDisplayedI getFeaturesDisplayed();
81 * get display style for all features types - visible or invisible
85 Map<String, FeatureColourI> getFeatureColours();
88 * query the alignment view to find all features
90 * @param newMadeVisible
91 * - when true, automatically make newly discovered types visible
93 void findAllFeatures(boolean newMadeVisible);
96 * get display style for all features types currently visible
100 Map<String, FeatureColourI> getDisplayedFeatureCols();
103 * get all registered groups
107 List<String> getFeatureGroups();
110 * get groups that are visible/invisible
115 List<String> getGroups(boolean visible);
118 * change visibility for a range of groups
123 void setGroupVisibility(List<String> toset, boolean visible);
126 * change visibiilty of given group
131 void setGroupVisibility(String group, boolean visible);
134 * locate features at a particular position on the given sequence
140 List<SequenceFeature> findFeaturesAtRes(SequenceI sequence, int res);
143 * get current displayed types, in ordering of rendering (on top last)
145 * @return a (possibly empty) list of feature types
148 List<String> getDisplayedFeatureTypes();
151 * get current displayed groups
153 * @return a (possibly empty) list of feature groups
155 List<String> getDisplayedFeatureGroups();
158 * display all features of these types
160 * @param featureTypes
162 void setAllVisible(List<String> featureTypes);
165 * display featureType
169 void setVisible(String featureType);