Class MoveToolEventHandler.ViewerMover
java.lang.Object
qupath.lib.gui.viewer.tools.handlers.MoveToolEventHandler.ViewerMover
- Enclosing class:
MoveToolEventHandler
Helper class for panning a
QuPathViewer
(reasonably) smoothly.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
cancelDirection
(boolean xAxis) Cancel either the x- or y-axis direction of the movement.void
Stop moving, by smoothly decelerating.void
startMoving
(double dx, double dy, boolean constantVelocity) Start moving, with initial velocity given by dx and dy.void
Stop moving immediately.
-
Constructor Details
-
ViewerMover
Constructor.- Parameters:
viewer
- the viewer that will be controlled by this object
-
-
Method Details
-
startMoving
public void startMoving(double dx, double dy, boolean constantVelocity) Start moving, with initial velocity given by dx and dy.- Parameters:
dx
-dy
-constantVelocity
-
-
cancelDirection
public void cancelDirection(boolean xAxis) Cancel either the x- or y-axis direction of the movement.E.g. This can be used to change the direction from diagonal to straight (horizontal/vertical) when releasing an arrow key while another arrow key is pressed.
- Parameters:
xAxis
-
-
decelerate
public void decelerate()Stop moving, by smoothly decelerating. -
stopMoving
public void stopMoving()Stop moving immediately.
-