}
String string;
- int maxX = 0;
-
+ boolean isrgap = false;
+ char rc;
+ int maxX = 0, refN, iadj;
+ SequenceI refSeq = av.getAlignment().getSeqrep();
+ int refSp = -1, refEp = -1;
+ if (refSeq != null)
+ {
+ refSp = refSeq.findIndex(refSeq.getStart()) - 1;
+ refEp = refSeq.findIndex(refSeq.getEnd()) - 1;
+ }
+ // todo: add a 'reference origin column' to set column number relative to
for (int i = scalestartx; i < endx; i += 5)
{
if ((i % 10) == 0)
{
- string = String.valueOf(av.getColumnSelection()
- .adjustForHiddenColumns(i));
+ iadj = av.getColumnSelection().adjustForHiddenColumns(i) - 1;
+ if (refSeq == null)
+ {
+ string = String.valueOf(iadj);
+ }
+ else
+ {
+ refN = refSeq.findPosition(iadj);
+ // TODO show bounds if position is a gap
+ // - ie L--R -> "1L|2R" for
+ // marker
+ if (iadj < refSp)
+ {
+ string = String.valueOf(iadj - refSp);
+ }
+ else if (iadj > refEp)
+ {
+ string = "+" + String.valueOf(iadj - refEp);
+ }
+ else
+ {
+ string = String.valueOf(refN) + refSeq.getCharAt(iadj);
+ }
+ }
if ((i - startx - 1) * avCharWidth > maxX)
{
gg.drawString(string, (i - startx - 1) * avCharWidth, y);