X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fapi%2FFeatureRenderer.java;h=cf3c8da9513d718ea8e3212e1a9fbe157eb17754;hb=e42eed3a0089a8a064560df4cf17a5021fd1e16a;hp=edd236ba2f12ee549b9ca7854d77177920914905;hpb=60e252f7e0084336b0a85620842ce3db8f63e5b0;p=jalview.git diff --git a/src/jalview/api/FeatureRenderer.java b/src/jalview/api/FeatureRenderer.java index edd236b..cf3c8da 100644 --- a/src/jalview/api/FeatureRenderer.java +++ b/src/jalview/api/FeatureRenderer.java @@ -22,6 +22,7 @@ package jalview.api; import jalview.datamodel.SequenceFeature; import jalview.datamodel.SequenceI; +import jalview.datamodel.features.FeatureMatcherSetI; import java.awt.Color; import java.awt.Graphics; @@ -60,6 +61,7 @@ public interface FeatureRenderer * * @param sequence * @param column + * aligned column position (1..) * @param g * @return */ @@ -131,7 +133,7 @@ public interface FeatureRenderer List getGroups(boolean visible); /** - * change visibility for a range of groups + * Set visibility for a list of groups * * @param toset * @param visible @@ -139,7 +141,7 @@ public interface FeatureRenderer void setGroupVisibility(List toset, boolean visible); /** - * change visibiilty of given group + * Set visibility of the given feature group * * @param group * @param visible @@ -147,14 +149,27 @@ public interface FeatureRenderer void setGroupVisibility(String group, boolean visible); /** - * Returns features at the specified position on the given sequence. + * Returns visible features at the specified aligned column on the given + * sequence. Non-positional features are not included. If the column has a gap, + * then enclosing features are included (but not contact features). + * + * @param sequence + * @param column + * aligned column position (1..) + * @return + */ + List findFeaturesAtColumn(SequenceI sequence, int column); + + /** + * Returns features at the specified residue position on the given sequence. * Non-positional features are not included. * * @param sequence - * @param res + * @param resNo + * residue position (start..) * @return */ - List findFeaturesAtRes(SequenceI sequence, int res); + List findFeaturesAtResidue(SequenceI sequence, int resNo); /** * get current displayed types, in ordering of rendering (on top last) @@ -200,4 +215,54 @@ public interface FeatureRenderer * @return */ float getTransparency(); + + /** + * Answers the filters applied to the given feature type, or null if none is + * set + * + * @param featureType + * @return + */ + FeatureMatcherSetI getFeatureFilter(String featureType); + + /** + * Answers the feature filters map + * + * @return + */ + public Map getFeatureFilters(); + + /** + * Sets the filters for the feature type, or removes them if a null or empty + * filter is passed + * + * @param featureType + * @param filter + */ + void setFeatureFilter(String featureType, FeatureMatcherSetI filter); + + /** + * Replaces all feature filters with the given map + * + * @param filters + */ + void setFeatureFilters(Map filters); + + /** + * Returns the colour for a particular feature instance. This includes + * calculation of 'colour by label', or of a graduated score colour, if + * applicable. + *

+ * Returns null if + *

    + *
  • feature type is not visible, or
  • + *
  • feature group is not visible, or
  • + *
  • feature values lie outside any colour threshold, or
  • + *
  • feature is excluded by filter conditions
  • + *
+ * + * @param feature + * @return + */ + Color getColour(SequenceFeature feature); }