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;
}
for (SequenceFeature sf : overlaps)
{
Color featureColour = fc.getColor(sf);
+ if (featureColour == null)
+ {
+ // score feature outwith threshold for colouring
+ continue;
+ }
/*
* if feature starts/ends outside the visible range,
int featureEndCol = sf.begin == sf.end ? featureStartCol : seq
.findIndex(visibleEnd);
- if (sf.isContactFeature())
+ // Color featureColour = getColour(sequenceFeature);
+
+ boolean isContactFeature = sf.isContactFeature();
+
+ if (isContactFeature)
{
boolean drawn = renderFeature(g, seq, featureStartCol - 1,
featureStartCol - 1, featureColour, start, end, y1,
drawnColour = featureColour;
}
}
- else if (showFeature(sf))
+ else
{
/*
* showing feature score by height of colour
}
/**
+<<<<<<< HEAD
+=======
+ * Answers true if the feature belongs to a feature group which is not
+ * currently displayed, else false
+ *
+ * @param sequenceFeature
+ * @return
+ */
+ @Override
+ protected boolean featureGroupNotShown(
+ final SequenceFeature sequenceFeature)
+ {
+ return featureGroups != null && sequenceFeature.featureGroup != null
+ && sequenceFeature.featureGroup.length() != 0
+ && featureGroups.containsKey(sequenceFeature.featureGroup)
+ && !featureGroups.get(sequenceFeature.featureGroup)
+ .booleanValue();
+ }
+
+ /**
+>>>>>>> refs/heads/develop
* Called when alignment in associated view has new/modified features to
* discover and display.
*
* 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))
{
if (!featureGroupNotShown(sequenceFeature))
{
- return getColour(sequenceFeature);
+ Color col = getColour(sequenceFeature);
+ if (col != null)
+ {
+ return col;
+ }
}
}
}
-
+
/*
* no displayed feature found at position
*/