Class DragRobotImpl

java.lang.Object
org.testfx.robot.impl.DragRobotImpl
All Implemented Interfaces:
DragRobot

public class DragRobotImpl extends Object implements DragRobot
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final MouseRobot
     
    private final MoveRobot
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    DragRobotImpl(MouseRobot mouseRobot, MoveRobot moveRobot)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    drag(javafx.scene.input.MouseButton... buttons)
    Presses the given mouse button(s) on whatever is under the mouse's current location.
    void
    drag(PointQuery pointQuery, javafx.scene.input.MouseButton... buttons)
    Moves the mouse to the location specified by the given PointQuery.query() and then presses the given mouse button(s) on whatever is under the mouse's new location.
    void
    Releases the mouse at its' current position.
    void
    dropBy(double x, double y)
    Moves the mouse horizontally by x and vertically by y before releasing the mouse.
    void
    dropTo(PointQuery pointQuery)
    Moves the mouse to the location specified by the given PointQuery.query() and then releases the mouse.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • mouseRobot

      private final MouseRobot mouseRobot
    • moveRobot

      private final MoveRobot moveRobot
  • Constructor Details

  • Method Details

    • drag

      public void drag(javafx.scene.input.MouseButton... buttons)
      Description copied from interface: DragRobot
      Presses the given mouse button(s) on whatever is under the mouse's current location.
      Specified by:
      drag in interface DragRobot
      Parameters:
      buttons - the mouse buttons to press
    • drag

      public void drag(PointQuery pointQuery, javafx.scene.input.MouseButton... buttons)
      Description copied from interface: DragRobot
      Moves the mouse to the location specified by the given PointQuery.query() and then presses the given mouse button(s) on whatever is under the mouse's new location.
      Specified by:
      drag in interface DragRobot
      Parameters:
      pointQuery - the pointQuery that specifies where to move the mouse to
      buttons - the mouse buttons to press
    • drop

      public void drop()
      Description copied from interface: DragRobot
      Releases the mouse at its' current position.
      Specified by:
      drop in interface DragRobot
    • dropTo

      public void dropTo(PointQuery pointQuery)
      Description copied from interface: DragRobot
      Moves the mouse to the location specified by the given PointQuery.query() and then releases the mouse.
      Specified by:
      dropTo in interface DragRobot
      Parameters:
      pointQuery - the pointQuery that specifies where to move the mouse to
    • dropBy

      public void dropBy(double x, double y)
      Description copied from interface: DragRobot
      Moves the mouse horizontally by x and vertically by y before releasing the mouse.
      Specified by:
      dropBy in interface DragRobot
      Parameters:
      x - the amount by which to move the mouse horizontally
      y - the amount by which to move the mouse vertically