X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fapi%2FFeatureSettingsModelI.java;h=c8a835aba0fcefd8f637ab46ec2b341e03fc148b;hb=8479d86d490c841168c9eed1ac80960ce4191c78;hp=f85a709cf2ea2b528f421548aa06c1526b4a3565;hpb=838e4f91d4a53dd315640dbc9ff6ef7a815ee576;p=jalview.git diff --git a/src/jalview/api/FeatureSettingsModelI.java b/src/jalview/api/FeatureSettingsModelI.java index f85a709..c8a835a 100644 --- a/src/jalview/api/FeatureSettingsModelI.java +++ b/src/jalview/api/FeatureSettingsModelI.java @@ -1,6 +1,6 @@ /* - * Jalview - A Sequence Alignment Editor and Viewer (Version 2.9.0b1) - * Copyright (C) 2015 The Jalview Authors + * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$) + * Copyright (C) $$Year-Rel$$ The Jalview Authors * * This file is part of Jalview. * @@ -20,7 +20,86 @@ */ 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 to be displayed, false if no + * preference + * + * @param type + * @return + */ + boolean isFeatureDisplayed(String type); + + /** + * Answers true if the specified feature type is to be hidden, false if no + * preference + * + * @param type + * @return + */ + boolean isFeatureHidden(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 is displayed before (below) feature 2, +1 if + * feature2 is displayed after (on top of) feature1, or 0 if we don't care. + * + *
+ * Note that this is the opposite ordering to how features are displayed in + * the feature settings dialogue. FeatureRendererModel.setFeaturePriority + * takes care of converting between the two. + * + * @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(); + }