+
+ /**
+ * {@inheritDoc} Callers should have already called resetAlignmentDims to
+ * refresh widthRatio
+ */
+ @Override
+ protected int getLeftXFromCentreX(int mousex, HiddenColumns hidden)
+ {
+ int vpx = Math.round(mousex * widthRatio);
+ return vpx - ranges.getViewportWidth() / 2;
+ }
+
+ /**
+ * {@inheritDoc} Callers should have already called resetAlignmentDims to
+ * refresh heightRatio
+ */
+ @Override
+ protected int getTopYFromCentreY(int mousey, HiddenSequences hidden)
+ {
+ int vpy = Math.round(mousey * heightRatio);
+ return vpy - ranges.getViewportHeight() / 2;
+ }
+
+ @Override
+ public void setDragPoint(int x, int y, HiddenSequences hiddenSeqs,
+ HiddenColumns hiddenCols)
+ {
+ resetAlignmentDims();
+
+ // get alignment position of x and box (can get directly from vpranges) and
+ // calculate difference between the positions
+ int vpx = Math.round(x * widthRatio);
+ int vpy = Math.round(y * heightRatio);
+
+ xdiff = ranges.getStartRes() - vpx;
+ ydiff = ranges.getStartSeq() - vpy;
+ }
+