import jalview.datamodel.AlignmentI;
import jalview.datamodel.HiddenColumns;
+import java.util.Arrays;
+
/**
* Supplies and updates viewport properties relating to position such as: start
* and end residues and sequences; ideally will serve hidden columns/rows too.
this.startRes = 0;
this.endRes = alignment.getWidth() - 1;
this.startSeq = 0;
- this.endSeq = alignment.getHeight() - 1;
+ this.setEndSeqTest(alignment.getHeight() - 1);
this.al = alignment;
}
+ public static String sTest = "";
+
+ private void setEndSeqTest(int val)
+ {
+ String st = Thread.currentThread().toString();
+ sTest += "ViewPortRanges.setEndseqTest " + val + " "
+ + st + "\n";
+ if (st.indexOf("Event") >= 0)
+ {
+ sTest += Arrays.toString(new NullPointerException().getStackTrace())
+ .substring(0, 500)
+ + "\n";
+ }
+ endSeq = val;
+ }
/**
* Get alignment width in cols, including hidden cols
*/
int oldendseq = this.endSeq;
if (end >= visibleHeight)
{
- endSeq = Math.max(visibleHeight - 1, 0);
+ setEndSeqTest(Math.max(visibleHeight - 1, 0));
}
else if (end < 0)
{
- endSeq = 0;
+ setEndSeqTest(0);
}
else
{
- endSeq = end;
+ setEndSeqTest(end);
}
return new int[] { oldstartseq, oldendseq };
}
return maxScroll;
}
+
+ @Override
+ public String toString()
+ {
+ return "[ViewportRange startRes=" + startRes + " endRes=" + endRes
+ + " startSeq=" + startSeq + " endSeq=" + endSeq + "]";
+ }
}