Class | Line # | Actions | ||||
---|---|---|---|---|---|---|
FeatureSettingsModelI | 31 | 0 | 0 | 0 |
1 | /* | |
2 | * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$) | |
3 | * Copyright (C) $$Year-Rel$$ The Jalview Authors | |
4 | * | |
5 | * This file is part of Jalview. | |
6 | * | |
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. | |
11 | * | |
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. | |
16 | * | |
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. | |
20 | */ | |
21 | package jalview.api; | |
22 | ||
23 | import java.util.Comparator; | |
24 | ||
25 | /** | |
26 | * An interface that describes the settings configurable in the Feature Settings | |
27 | * dialog. | |
28 | * | |
29 | * @author gmcarstairs | |
30 | */ | |
31 | public interface FeatureSettingsModelI extends Comparator<String> | |
32 | { | |
33 | ||
34 | // note Java 8 will allow default implementations of these methods in the | |
35 | // interface, simplifying instantiating classes | |
36 | ||
37 | /** | |
38 | * Answers true if the specified feature type is displayed | |
39 | * | |
40 | * @param type | |
41 | * @return | |
42 | */ | |
43 | boolean isFeatureDisplayed(String type); | |
44 | ||
45 | /** | |
46 | * Answers true if the specified feature group is displayed | |
47 | * | |
48 | * @param group | |
49 | * @return | |
50 | */ | |
51 | boolean isGroupDisplayed(String group); | |
52 | ||
53 | /** | |
54 | * Returns the colour (or graduated colour) for the feature type, or null if | |
55 | * not known | |
56 | * | |
57 | * @param type | |
58 | * @return | |
59 | */ | |
60 | FeatureColourI getFeatureColour(String type); | |
61 | ||
62 | /** | |
63 | * Returns the transparency value, from 0 (fully transparent) to 1 (fully | |
64 | * opaque) | |
65 | * | |
66 | * @return | |
67 | */ | |
68 | float getTransparency(); | |
69 | ||
70 | /** | |
71 | * Returns -1 if feature1 is displayed before (below) feature 2, +1 if | |
72 | * feature2 is displayed after (on top of) feature1, or 0 if we don't care. | |
73 | * | |
74 | * <br> | |
75 | * Note that this is the opposite ordering to how features are displayed in | |
76 | * the feature settings dialogue. FeatureRendererModel.setFeaturePriority | |
77 | * takes care of converting between the two. | |
78 | * | |
79 | * @param feature1 | |
80 | * @param feature2 | |
81 | * @return | |
82 | */ | |
83 | @Override | |
84 | int compare(String feature1, String feature2); | |
85 | ||
86 | /** | |
87 | * Answers true if features should be initially sorted so that features with a | |
88 | * shorter average length are displayed on top of those with a longer average | |
89 | * length | |
90 | * | |
91 | * @return | |
92 | */ | |
93 | boolean optimiseOrder(); | |
94 | ||
95 | } |