Class MoveToolEventHandler.ViewerMover

java.lang.Object
qupath.lib.gui.viewer.tools.handlers.MoveToolEventHandler.ViewerMover
Enclosing class:
MoveToolEventHandler

public static class MoveToolEventHandler.ViewerMover extends Object
Helper class for panning a QuPathViewer (reasonably) smoothly.
  • Constructor Details

    • ViewerMover

      public ViewerMover(QuPathViewer viewer)
      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.