private void drawNorthScale(Graphics g, int startx, int endx, int ypos)
{
updateViewport();
- int scalestartx = startx - (startx % 10) + 10;
-
- g.setColor(Color.black);
- // NORTH SCALE
- for (int i = scalestartx; i < endx; i += 10)
+ for (Object[] mark : jalview.renderer.ScaleRenderer.calculateMarks(av,
+ startx, endx))
{
- int value = i;
- if (av.hasHiddenColumns())
+ int mpos = ((Integer) mark[1]).intValue(); // (i - startx - 1)
+ if (mpos < 0)
{
- value = av.getColumnSelection().adjustForHiddenColumns(value);
+ continue;
}
+ String mstring = (String) mark[2];
- g.drawString(String.valueOf(value), (i - startx - 1) * charWidth,
- ypos - (charHeight / 2));
-
- g.drawLine(((i - startx - 1) * charWidth) + (charWidth / 2),
- (ypos + 2) - (charHeight / 2), ((i - startx - 1) * charWidth)
- + (charWidth / 2), ypos - 2);
+ if (Boolean.valueOf((Boolean) mark[0]))
+ {
+ if (mstring != null)
+ {
+ g.drawString(mstring, mpos * charWidth, ypos - (charHeight / 2));
+ }
+ g.drawLine((mpos * charWidth) + (charWidth / 2), (ypos + 2)
+ - (charHeight / 2), (mpos * charWidth) + (charWidth / 2),
+ ypos - 2);
+ }
}
}