- /*
- * If there is one, scroll the (Protein/cDNA) complementary alignment to
- * match, unless we are ourselves doing that.
- */
- /* if (isFollowingComplementScroll())
- {
- setFollowingComplementScroll(false);
- }
- else
- {
- AlignmentPanel ap = getComplementPanel();
- av.scrollComplementaryAlignment(ap);
- }*/
+ private void adjustVertical(int newY)
+ {
+ if (av.getWrapAlignment())
+ {
+ /*
+ * if we're scrolling to the position we're already at, stop
+ * this prevents infinite recursion of events when the scroll/viewport
+ * ranges values are the same
+ */
+ int oldX = vpRanges.getStartRes();
+ int oldY = vpRanges.getWrappedScrollPosition(oldX);
+ if (oldY == newY)
+ {
+ return;
+ }
+ if (newY > -1)
+ {
+ /*
+ * limit page up/down to one width's worth of positions
+ */
+ int rowSize = vpRanges.getViewportWidth();
+ int newX = newY > oldY ? oldX + rowSize : oldX - rowSize;
+ vpRanges.setViewportStartAndWidth(Math.max(0, newX), rowSize);
+ }
+ }
+ else
+ {
+ int height = seqPanel.seqCanvas.getHeight() / av.getCharHeight();
+ int oldY = vpRanges.getStartSeq();
+ int oldheight = vpRanges.getViewportHeight();