+
+ /**
+ * Set the viewport location so that a position is visible
+ *
+ * @param x
+ * column to be visible
+ * @param y
+ * row to be visible
+ */
+ public boolean setViewportLocation(int x, int y)
+ {
+ // if (x,y) is already visible don't do anything
+ boolean changedLocation = false;
+ if (startRes > x || x > endRes || startSeq > y && y > endSeq)
+ {
+ int width = getViewportWidth();
+ int[] oldresvalues = updateStartEndRes(x, x + width - 1);
+
+ int startseq = y;
+ int height = getViewportHeight();
+ if (startseq + height - 1 > getVisibleAlignmentHeight() - 1)
+ {
+ startseq = getVisibleAlignmentHeight() - height;
+ }
+ int[] oldseqvalues = updateStartEndSeq(startseq,
+ startseq + height - 1);
+
+ int[] old = new int[] { oldresvalues[0], oldseqvalues[0] };
+ int[] newresseq = new int[] { startRes, startSeq };
+ changedLocation = true;
+ changeSupport.firePropertyChange(MOVE_VIEWPORT, old, newresseq);
+ }
+ return changedLocation;
+ }
+