X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fapi%2FFeatureRenderer.java;h=ef0abbd1b95ea9487f33a1bebf35c3bb293ebb86;hb=f8b17a9e7363b8a9e7cd12d61bc6d611c7c97d7d;hp=679cdeda7daef95d91745ec5a50d69465499adb9;hpb=47168f025aefdaa044802bd5f8f510ffe43a4808;p=jalview.git diff --git a/src/jalview/api/FeatureRenderer.java b/src/jalview/api/FeatureRenderer.java index 679cded..ef0abbd 100644 --- a/src/jalview/api/FeatureRenderer.java +++ b/src/jalview/api/FeatureRenderer.java @@ -1,6 +1,6 @@ /* - * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.2) - * Copyright (C) 2014 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,9 +20,14 @@ */ package jalview.api; +import jalview.datamodel.SequenceFeature; import jalview.datamodel.SequenceI; +import jalview.util.matcher.KeyedMatcherSetI; import java.awt.Color; +import java.awt.Graphics; +import java.util.List; +import java.util.Map; /** * Abstract feature renderer interface @@ -33,8 +38,231 @@ import java.awt.Color; public interface FeatureRenderer { - Color findFeatureColour(Color col, SequenceI sequenceI, int r); + /** + * Computes the feature colour for a given sequence and column position, + * taking into account sequence feature locations, feature colour schemes, + * render ordering, feature and feature group visibility, and transparency. + *
+ * The graphics argument should be provided if transparency is applied + * (getTransparency() < 1). With feature transparency, visible features are + * written to the graphics context and the composite colour may be read off + * from it. In this case, the returned feature colour is not the composite + * colour but that of the last feature drawn. + *
+ * If no transparency applies, then the graphics argument may be null, and the + * returned colour is the one that would be drawn for the feature. + *
+ * Returns null if there is no visible feature at the position. + *
+ * This is provided to support rendering of feature colours other than on the
+ * sequence alignment, including by structure viewers and the overview window.
+ * Note this method takes no account of whether the sequence or column is
+ * hidden.
+ *
+ * @param sequence
+ * @param column
+ * aligned column position (1..)
+ * @param g
+ * @return
+ */
+ Color findFeatureColour(SequenceI sequence, int column, Graphics g);
+ /**
+ * trigger the feature discovery process for a newly created feature renderer.
+ */
void featuresAdded();
+ /**
+ *
+ * @param ft
+ * @return display style for a feature
+ */
+ FeatureColourI getFeatureStyle(String ft);
+
+ /**
+ * update the feature style for a particular feature
+ *
+ * @param ft
+ * @param ggc
+ */
+ void setColour(String ft, FeatureColourI ggc);
+
+ AlignViewportI getViewport();
+
+ /**
+ *
+ * @return container managing list of feature types and their visibility
+ */
+ FeaturesDisplayedI getFeaturesDisplayed();
+
+ /**
+ * get display style for all features types - visible or invisible
+ *
+ * @return
+ */
+ Map
+ * Returns null if
+ *
+ *
+ *
+ * @param feature
+ * @return
+ */
+ Color getColour(SequenceFeature feature);
}