}
int start = r[0];
int end = r[1];
- // System.err.println("Seq : "+seqIndex+" Scroll to "+start+","+end); //
// DEBUG
+// System.err.println(this.av.viewName + " Seq : " + seqIndex
+// + " Scroll to " + start + "," + end);
/*
* To centre results, scroll to positions half the visible width
{
int offset = (av.getEndRes() - av.getStartRes() + 1) / 2 - 1;
start = Math.max(start - offset, 0);
- end = Math.min(end + offset, seq.getEnd() - 1);
+ end = end + offset - 1;
}
if (start < 0)
{
*/
seqIndex = Math.max(0, seqIndex - verticalOffset);
+ // System.out.println("start=" + start + ", end=" + end + ", startv="
+ // + av.getStartRes() + ", endv=" + av.getEndRes() + ", starts="
+ // + av.getStartSeq() + ", ends=" + av.getEndSeq());
if (!av.getWrapAlignment())
{
if ((startv = av.getStartRes()) >= start)
* Adjust row/column scrollers to show a visible position in the alignment.
*
* @param x
- * visible column to scroll to DOCUMENT ME!
+ * visible column to scroll to
* @param y
* visible row to scroll to
*
*/
public void setScrollValues(int x, int y)
{
- // System.err.println("Scroll to "+x+","+y);
+ // System.err.println("Scroll " + this.av.viewName + " to " + x + "," + y);
if (av == null || av.getAlignment() == null)
{
return;
int middleColumn = getStartRes() + (getEndRes() - getStartRes()) / 2;
final HiddenSequences hiddenSequences = getAlignment()
.getHiddenSequences();
- for (int seqNo = getStartSeq(); seqNo < getEndSeq(); seqNo++, seqOffset++)
+
+ /*
+ * searching to the bottom of the alignment gives smoother scrolling across all gapped visible regions
+ */
+ int lastSeq = alignment.getHeight() - 1;
+ for (int seqNo = getStartSeq(); seqNo < lastSeq; seqNo++, seqOffset++)
{
sequence = getAlignment().getSequenceAt(seqNo);
if (hiddenSequences != null && hiddenSequences.isHidden(sequence))