import jalview.api.AlignViewportI;
import jalview.api.FeatureColourI;
-import jalview.datamodel.Range;
+import jalview.datamodel.ContiguousI;
import jalview.datamodel.SequenceFeature;
import jalview.datamodel.SequenceI;
import jalview.util.Comparison;
g.setColor(featureColour);
- g.fillRect((i - start) * charWidth, y1, charWidth,
- charHeight);
+ g.fillRect((i - start) * charWidth, y1, charWidth, charHeight);
if (colourOnly || !validCharWidth)
{
g.setColor(Color.white);
int charOffset = (charWidth - fm.charWidth(s)) / 2;
- g.drawString(String.valueOf(s), charOffset
- + (charWidth * (i - start)), pady);
+ g.drawString(String.valueOf(s),
+ charOffset + (charWidth * (i - start)), pady);
}
return true;
}
g.setColor(Color.black);
int charOffset = (charWidth - fm.charWidth(s)) / 2;
- g.drawString(String.valueOf(s), charOffset
- + (charWidth * (i - start)), pady);
+ g.drawString(String.valueOf(s),
+ charOffset + (charWidth * (i - start)), pady);
}
return true;
}
return null;
}
- if (Comparison.isGap(seq.getCharAt(column)))
+ // column is 'base 1' but getCharAt is an array index (ie from 0)
+ if (Comparison.isGap(seq.getCharAt(column - 1)))
{
/*
* returning null allows the colour scheme to provide gap colour
/*
* if columns are all gapped, or sequence has no features, nothing to do
*/
- Range visiblePositions = seq.findPositions(start+1, end+1);
+ ContiguousI visiblePositions = seq.findPositions(start + 1, end + 1);
if (visiblePositions == null || !seq.getFeatures().hasFeatures())
{
return null;
List<SequenceFeature> overlaps = seq.getFeatures().findFeatures(
visiblePositions.getBegin(), visiblePositions.getEnd(), type);
- filterFeaturesForDisplay(overlaps, fc);
+ if (fc.isSimpleColour())
+ {
+ filterFeaturesForDisplay(overlaps);
+ }
for (SequenceFeature sf : overlaps)
{
- Color featureColour = fc.getColor(sf);
+ Color featureColour = getColor(sf, fc);
if (featureColour == null)
{
- // score feature outwith threshold for colouring
+ /*
+ * feature excluded by visibility settings, filters, or colour threshold
+ */
continue;
}
* 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.
+ * its colour returned. This method is suitable when no feature transparency
+ * applied (only the topmost visible feature colour is rendered).
* <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
* inspect features in reverse renderOrder (the last in the array is
* displayed on top) until we find one that is rendered at the position
*/
- for (int renderIndex = renderOrder.length - 1; renderIndex >= 0; renderIndex--)
+ for (int renderIndex = renderOrder.length
+ - 1; renderIndex >= 0; renderIndex--)
{
String type = renderOrder[renderIndex];
if (!showFeatureOfType(type))
}
}
}
-
+
/*
* no displayed feature found at position
*/