void drawVerticalScale(Graphics g, final int startx, final int endx,
final int ypos, final boolean left)
{
- int charHeight = av.getCharHeight();
- int charWidth = av.getCharWidth();
+ final int charHeight = av.getCharHeight();
+ final int charWidth = av.getCharWidth();
- int yPos = ypos + charHeight;
+ final int yPos = ypos + charHeight;
int startX = startx;
int endX = endx;
+ AlignmentI alignment = av.getAlignment();
if (av.hasHiddenColumns())
{
- HiddenColumns hiddenColumns = av.getAlignment().getHiddenColumns();
+ HiddenColumns hiddenColumns = alignment.getHiddenColumns();
startX = hiddenColumns.visibleToAbsoluteColumn(startx);
endX = hiddenColumns.visibleToAbsoluteColumn(endx);
}
FontMetrics fm = getFontMetrics(av.getFont());
- for (int i = 0; i < av.getAlignment().getHeight(); i++)
+ /*
+ * white fill the space for the scale for correct 'fast paint'
+ * (repainting only changed regions of the image)
+ * (fillRect origin is top left of rectangle)
+ */
+ g.setColor(Color.white);
+ g.fillRect(0, ypos, left ? labelWidthWest : labelWidthEast,
+ (alignment.getHeight() * charHeight));
+
+ for (int i = 0; i < alignment.getHeight(); i++)
{
- SequenceI seq = av.getAlignment().getSequenceAt(i);
+ SequenceI seq = alignment.getSequenceAt(i);
/*
* find sequence position of first non-gapped position -
}
}
- /*
- * white fill the space for the scale
- */
- g.setColor(Color.white);
- int y = (yPos + (i * charHeight)) - (charHeight / 5);
- // fillRect origin is top left of rectangle
- g.fillRect(0, y - charHeight, left ? labelWidthWest : labelWidthEast,
- charHeight + 1);
-
if (value != -1)
{
/*
int labelLength = fm.stringWidth(valueAsString);
int xOffset = labelSpace - labelLength;
g.setColor(Color.black);
+ int y = (yPos + (i * charHeight)) - (charHeight / 5);
g.drawString(valueAsString, xOffset, y);
}
}