- int y = avCharHeight - fm.getDescent();
-
- if (refSeq == null && scalestartx % 10 == 0)
- {
- scalestartx += 5;
- }
-
- String string;
- int maxX = 0, refN, iadj;
- // todo: add a 'reference origin column' to set column number relative to
- for (int i = scalestartx; i < endx; i += 5)
- {
- if (((i - refSp) % 10) == 0)
- {
- iadj = av.getColumnSelection().adjustForHiddenColumns(i) - 1;
- if (refSeq == null)
- {
- string = String.valueOf(iadj + 1);
- }
- else
- {
- refN = refSeq.findPosition(iadj);
- // TODO show bounds if position is a gap
- // - ie L--R -> "1L|2R" for
- // marker
- if (iadj < refStartI)
- {
- string = String.valueOf(iadj - refStartI);
- }
- else if (iadj > refEndI)
- {
- string = "+" + String.valueOf(iadj - refEndI);
- }
- else
- {
- string = String.valueOf(refN) + refSeq.getCharAt(iadj);
- }
- }
- if ((i - startx - 1) * avCharWidth > maxX)
- {
- gg.drawString(string, (i - startx - 1) * avCharWidth, y);
- maxX = (i - startx + 1) * avCharWidth + fm.stringWidth(string);
- }
-
- gg.drawLine(((i - startx - 1) * avCharWidth) + (avCharWidth / 2),
- y + 2,
- ((i - startx - 1) * avCharWidth) + (avCharWidth / 2), y
- + (fm.getDescent() * 2));
- }
- else
- {
- gg.drawLine(((i - startx - 1) * avCharWidth) + (avCharWidth / 2), y
- + fm.getDescent(), ((i - startx - 1) * avCharWidth)
- + (avCharWidth / 2), y + (fm.getDescent() * 2));
- }
- }
-