X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fapi%2FFeatureSettingsModelI.java;h=28f5c77a974d529edca4413c3b93cc3cc76cd1ed;hb=28c2ec20b26a85cc5634238f1261a14930550594;hp=5474f4e09b07d209b280014f5f76426badc9fc6a;hpb=6fb341da6a316869ba5fc87c146c30d1279f06fa;p=jalview.git diff --git a/src/jalview/api/FeatureSettingsModelI.java b/src/jalview/api/FeatureSettingsModelI.java index 5474f4e..28f5c77 100644 --- a/src/jalview/api/FeatureSettingsModelI.java +++ b/src/jalview/api/FeatureSettingsModelI.java @@ -20,7 +20,71 @@ */ package jalview.api; -public interface FeatureSettingsModelI +import java.util.Comparator; + +/** + * An interface that describes the settings configurable in the Feature Settings + * dialog. + * + * @author gmcarstairs + */ +public interface FeatureSettingsModelI extends Comparator { + // note Java 8 will allow default implementations of these methods in the + // interface, simplifying instantiating classes + + /** + * Answers true if the specified feature type is displayed + * + * @param type + * @return + */ + boolean isFeatureDisplayed(String type); + + /** + * Answers true if the specified feature group is displayed + * + * @param group + * @return + */ + boolean isGroupDisplayed(String group); + + /** + * Returns the colour (or graduated colour) for the feature type, or null if + * not known + * + * @param type + * @return + */ + FeatureColourI getFeatureColour(String type); + + /** + * Returns the transparency value, from 0 (fully transparent) to 1 (fully + * opaque) + * + * @return + */ + float getTransparency(); + + /** + * Returns -1 if feature1 'precedes' (is displayed on top of) feature 2, +1 if + * feature2 is on top of feature1, or 0 if we don't care + * + * @param feature1 + * @param feature2 + * @return + */ + @Override + int compare(String feature1, String feature2); + + /** + * Answers true if features should be initially sorted so that features with a + * shorter average length are displayed on top of those with a longer average + * length + * + * @return + */ + boolean optimiseOrder(); + }