JAL-1705 first pass at applying preset feature colouring for EnsemblGene
[jalview.git] / src / jalview / api / FeatureSettingsI.java
1 package jalview.api;
2
3 import java.util.Comparator;
4
5 /**
6  * An interface that describes the settings configurable in the Feature Settings
7  * dialog.
8  * 
9  * @author gmcarstairs
10  *
11  */
12 public interface FeatureSettingsI extends Comparator<String>
13 {
14   // note Java 8 will allow default implementations of these methods in the
15   // interface, simplifying instantiating classes
16
17   /**
18    * Answers true if the specified feature type is displayed
19    * 
20    * @param type
21    * @return
22    */
23   boolean isFeatureDisplayed(String type);
24
25   /**
26    * Answers true if the specified feature group is displayed
27    * 
28    * @param group
29    * @return
30    */
31   boolean isGroupDisplayed(String group);
32
33   /**
34    * Returns the colour (or graduated colour) for the feature type, or null if
35    * not known
36    * 
37    * @param type
38    * @return
39    */
40   FeatureColourI getFeatureColour(String type);
41
42   /**
43    * Returns the transparency value, from 0 (fully transparent) to 1 (fully
44    * opaque)
45    * 
46    * @return
47    */
48   float getTransparency();
49
50   /**
51    * Returns -1 if feature1 'precedes' (is displayed on top of) feature 2, +1 if
52    * feature2 is on top of feature1, or 0 if we don't care
53    * 
54    * @param feature1
55    * @param feature2
56    * @return
57    */
58   @Override
59   int compare(String feature1, String feature2);
60
61   /**
62    * Answers true if features should be initially sorted so that features with a
63    * shorter average length are displayed on top of those with a longer average
64    * length
65    * 
66    * @return
67    */
68   boolean optimiseOrder();
69 }