package jalview.renderer.seqfeatures;
import jalview.api.AlignViewportI;
-import jalview.datamodel.Range;
import jalview.datamodel.SequenceFeature;
import jalview.datamodel.SequenceI;
import jalview.util.Comparison;
/*
* simple case - just find the topmost rendered visible feature colour
*/
- renderedColour = findFeatureColour(seq, seq.findPosition(column));
+ renderedColour = findFeatureColour(seq, column);
}
else
{
transparency));
}
- /*
- * get range of sequence positions within column range
- */
- Range seqRange = seq.findPositions(start, end);
- if (seqRange == null)
- {
- return null;
- }
-
Color drawnColour = null;
/*
continue;
}
- List<SequenceFeature> overlaps = seq.findFeatures(seqRange.start,
- seqRange.end, type);
+ List<SequenceFeature> overlaps = seq.findFeatures(start + 1, end + 1,
+ type);
for (SequenceFeature sf : overlaps)
{
/*
.findIndex(sf.end);
if (isContactFeature)
{
- boolean drawn = renderFeature(g, seq,
- featureStartCol - 1,
- featureStartCol - 1, featureColour,
- start, end, y1, colourOnly);
- drawn |= renderFeature(g, seq,
- featureEndCol - 1,
- featureEndCol - 1, featureColour,
- start, end, y1, colourOnly);
+ boolean drawn = renderFeature(g, seq, featureStartCol - 1,
+ featureStartCol - 1, featureColour, start, end, y1,
+ colourOnly);
+ drawn |= renderFeature(g, seq, featureEndCol - 1,
+ featureEndCol - 1, featureColour, start, end, y1,
+ colourOnly);
if (drawn)
{
drawnColour = featureColour;
}
/**
- * Returns the sequence feature colour rendered at the given sequence
- * position, or null if none found. The feature of highest render order (i.e.
- * on top) is found, subject to both feature type and feature group being
- * visible, and its colour returned.
+ * Returns the sequence feature colour rendered at the given column position,
+ * or null if none found. The feature of highest render order (i.e. on top) is
+ * found, subject to both feature type and feature group being visible, and
+ * its colour returned.
+ * <p>
+ * Note this method does not check for a gap in the column so would return the
+ * colour for features enclosing a gapped column. Check for gap before calling
+ * if different behaviour is wanted.
*
* @param seq
- * @param pos
+ * @param column
+ * (1..)
* @return
*/
- Color findFeatureColour(SequenceI seq, int pos)
+ Color findFeatureColour(SequenceI seq, int column)
{
/*
* check for new feature added while processing
continue;
}
- List<SequenceFeature> overlaps = seq.findFeatures(pos, pos, type);
+ List<SequenceFeature> overlaps = seq.findFeatures(column, column,
+ type);
for (SequenceFeature sequenceFeature : overlaps)
{
if (!featureGroupNotShown(sequenceFeature))