// If EPS graphics, stringWidth will be a double, not an int
double dwidth = fm.getStringBounds("M", g).getWidth();
- monospacedFont = (dwidth == fm.getStringBounds("|", g).getWidth() && av
- .getCharWidth() == dwidth);
+ monospacedFont = (dwidth == fm.getStringBounds("|", g).getWidth()
+ && av.getCharWidth() == dwidth);
this.renderGaps = renderGaps;
}
public Color getResidueColour(final SequenceI seq, int position,
FeatureColourFinder finder)
{
- return resColourFinder.getResidueColour(av.getResidueShading(),
+ allGroups = av.getAlignment().findAllGroups(seq);
+ return resColourFinder.getResidueColour(av.getShowBoxes(),
+ av.getResidueShading(),
allGroups, seq, position,
finder);
}
-
-
/**
* DOCUMENT ME!
*
int length = seq.getLength();
int curStart = -1;
- int curWidth = av.getCharWidth(), avWidth = av.getCharWidth(), avHeight = av
- .getCharHeight();
+ int curWidth = av.getCharWidth(), avWidth = av.getCharWidth(),
+ avHeight = av.getCharHeight();
Color tempColour = null;
else
{
char gap = av.getGapCharacter();
- graphics.drawString(seq.getSequenceAsString(start, end + 1)
- .replace(gap, ' '), 0, y1);
+ graphics.drawString(
+ seq.getSequenceAsString(start, end + 1).replace(gap, ' '),
+ 0, y1);
}
}
else
if (currentSequenceGroup.thresholdTextColour > 0)
{
if (resBoxColour.getRed() + resBoxColour.getBlue()
- + resBoxColour.getGreen() < currentSequenceGroup.thresholdTextColour)
+ + resBoxColour
+ .getGreen() < currentSequenceGroup.thresholdTextColour)
{
graphics.setColor(currentSequenceGroup.textColour2);
}
// currentSequenceGroup.getConsensus()
char conschar = (usesrep) ? (currentGroup == null
|| position < currentGroup.getStartRes()
- || position > currentGroup.getEndRes() ? av.getAlignment()
- .getSeqrep().getCharAt(position)
- : (currentGroup.getSeqrep() != null ? currentGroup.getSeqrep()
- .getCharAt(position) : av.getAlignment().getSeqrep()
- .getCharAt(position)))
+ || position > currentGroup.getEndRes()
+ ? av.getAlignment().getSeqrep().getCharAt(position)
+ : (currentGroup.getSeqrep() != null
+ ? currentGroup.getSeqrep().getCharAt(position)
+ : av.getAlignment().getSeqrep()
+ .getCharAt(position)))
: (currentGroup != null && currentGroup.getConsensus() != null
&& position >= currentGroup.getStartRes()
- && position <= currentGroup.getEndRes() && currentGroup
- .getConsensus().annotations.length > position) ? currentGroup
- .getConsensus().annotations[position].displayCharacter
- .charAt(0)
- : av.getAlignmentConsensusAnnotation().annotations[position].displayCharacter
- .charAt(0);
+ && position <= currentGroup.getEndRes()
+ && currentGroup
+ .getConsensus().annotations.length > position)
+ ? currentGroup
+ .getConsensus().annotations[position].displayCharacter
+ .charAt(0)
+ : av.getAlignmentConsensusAnnotation().annotations[position].displayCharacter
+ .charAt(0);
if (!jalview.util.Comparison.isGap(conschar)
- && (sequenceChar == conschar || sequenceChar + CHAR_TO_UPPER == conschar))
+ && (sequenceChar == conschar
+ || sequenceChar + CHAR_TO_UPPER == conschar))
{
sequenceChar = conservedChar;
}
* @param height
* DOCUMENT ME!
*/
- public void drawHighlightedText(SequenceI seq, int start, int end,
- int x1, int y1)
+ public void drawHighlightedText(SequenceI seq, int start, int end, int x1,
+ int y1)
{
int pady = av.getCharHeight() / 5;
int charOffset = 0;
}
}
- public void drawCursor(SequenceI seq, int res, int x1, int y1)
+ /**
+ * Draw a sequence canvas cursor
+ *
+ * @param g
+ * graphics context to draw on
+ * @param s
+ * character to draw at cursor
+ * @param x1
+ * x position of cursor in graphics context
+ * @param y1
+ * y position of cursor in graphics context
+ */
+ public void drawCursor(Graphics g, char s, int x1, int y1)
{
int pady = av.getCharHeight() / 5;
int charOffset = 0;
- graphics.setColor(Color.black);
- graphics.fillRect(x1, y1, av.getCharWidth(), av.getCharHeight());
+ g.setColor(Color.black);
+ g.fillRect(x1, y1, av.getCharWidth(), av.getCharHeight());
if (av.isValidCharWidth())
{
- graphics.setColor(Color.white);
-
- char s = seq.getCharAt(res);
-
+ g.setColor(Color.white);
charOffset = (av.getCharWidth() - fm.charWidth(s)) / 2;
- graphics.drawString(String.valueOf(s), charOffset + x1,
+ g.drawString(String.valueOf(s), charOffset + x1,
(y1 + av.getCharHeight()) - pady);
}