X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;ds=inline;f=src%2Fjalview%2Fapi%2FFeatureRenderer.java;h=7123b8ca896aa453de720c829122df5298bf4853;hb=fc4aebb30bebcd7582b549053a353e528119a5fe;hp=a0552dc4839b2ffbbc8ae41d9fa32b5c5ad7b41a;hpb=e1cd94839128776e14e51ded3f3be2dcc7e72273;p=jalview.git diff --git a/src/jalview/api/FeatureRenderer.java b/src/jalview/api/FeatureRenderer.java index a0552dc..7123b8c 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. * @@ -22,9 +22,11 @@ package jalview.api; import jalview.datamodel.SequenceFeature; import jalview.datamodel.SequenceI; -import jalview.schemes.GraduatedColor; import java.awt.Color; +import java.awt.Graphics; +import java.util.List; +import java.util.Map; /** * Abstract feature renderer interface @@ -35,12 +37,167 @@ 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
+ * @param g
+ * @return
+ */
+ Color findFeatureColour(SequenceI sequence, int column, Graphics g);
+ /**
+ * trigger the feature discovery process for a newly created feature renderer.
+ */
void featuresAdded();
- Object getFeatureStyle(String ft);
+ /**
+ *
+ * @param ft
+ * @return display style for a feature
+ */
+ FeatureColourI getFeatureStyle(String ft);
- void setColour(String ft, Object ggc);
+ /**
+ * 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