Module org.testfx

Class MouseRobotImpl

    • Method Summary

      Modifier and Type Method Description
      Set<javafx.scene.input.MouseButton> getPressedButtons()
      Gets the mouse buttons that have been pressed but not yet released.
      void move​(javafx.geometry.Point2D location)
      Moves the mouse to the given location.
      void moveNoWait​(javafx.geometry.Point2D location)
      Moves the mouse to the given location.
      void press​(javafx.scene.input.MouseButton... buttons)
      Presses the given mouse buttons, until explicitly released via MouseRobot.release(MouseButton...).
      void pressNoWait​(javafx.scene.input.MouseButton... buttons)
      Presses the given mouse buttons, until explicitly released via MouseRobot.release(MouseButton...).
      void release​(javafx.scene.input.MouseButton... buttons)
      Releases the given mouse buttons.
      void releaseNoWait​(javafx.scene.input.MouseButton... buttons)
      Releases the given mouse buttons.
      void scroll​(int wheelAmount)
      Scrolls the mouse wheel by the given amount.
      void scrollNoWait​(int wheelAmount)
      Scrolls the mouse wheel by the given amount.
    • Constructor Detail

      • MouseRobotImpl

        public MouseRobotImpl​(BaseRobot baseRobot)
    • Method Detail

      • pressNoWait

        public void pressNoWait​(javafx.scene.input.MouseButton... buttons)
        Description copied from interface: MouseRobot
        Presses the given mouse buttons, until explicitly released via MouseRobot.release(MouseButton...). Once pressed, WaitForAsyncUtils.waitForFxEvents() is not called.

        Note: passing in an empty MouseButton[] will call press(MouseButton.PRIMARY).

        Specified by:
        pressNoWait in interface MouseRobot
        Parameters:
        buttons - the mouse buttons to press without waiting afterwards
      • release

        public void release​(javafx.scene.input.MouseButton... buttons)
        Description copied from interface: MouseRobot
        Releases the given mouse buttons. Once pressed, calls WaitForAsyncUtils.waitForFxEvents().

        Note: passing in an empty MouseButton[] will release all pressed MouseButtons.

        Specified by:
        release in interface MouseRobot
        Parameters:
        buttons - the mouse buttons to release
      • releaseNoWait

        public void releaseNoWait​(javafx.scene.input.MouseButton... buttons)
        Description copied from interface: MouseRobot
        Releases the given mouse buttons. Once pressed, WaitForAsyncUtils.waitForFxEvents() is not called.

        Note: passing in an empty MouseButton[] will release all pressed MouseButtons.

        Specified by:
        releaseNoWait in interface MouseRobot
        Parameters:
        buttons - the mouse buttons to release without waiting afterwards
      • move

        public void move​(javafx.geometry.Point2D location)
        Description copied from interface: MouseRobot
        Moves the mouse to the given location. Once moved, calls WaitForAsyncUtils.waitForFxEvents().
        Specified by:
        move in interface MouseRobot
        Parameters:
        location - the location to move the mouse to
      • moveNoWait

        public void moveNoWait​(javafx.geometry.Point2D location)
        Description copied from interface: MouseRobot
        Moves the mouse to the given location. Once moved, WaitForAsyncUtils.waitForFxEvents() is not called.
        Specified by:
        moveNoWait in interface MouseRobot
        Parameters:
        location - the location to move the mouse to without waiting afterwards
      • scroll

        public void scroll​(int wheelAmount)
        Description copied from interface: MouseRobot
        Scrolls the mouse wheel by the given amount. Once scrolled, calls WaitForAsyncUtils.waitForFxEvents().
        Specified by:
        scroll in interface MouseRobot
        Parameters:
        wheelAmount - the amount to scroll the mouse by
      • scrollNoWait

        public void scrollNoWait​(int wheelAmount)
        Description copied from interface: MouseRobot
        Scrolls the mouse wheel by the given amount. Once scrolled, WaitForAsyncUtils.waitForFxEvents() is not called.
        Specified by:
        scrollNoWait in interface MouseRobot
        Parameters:
        wheelAmount - the amount to scroll the mouse by without waiting afterwards
      • getPressedButtons

        public final Set<javafx.scene.input.MouseButton> getPressedButtons()
        Description copied from interface: MouseRobot
        Gets the mouse buttons that have been pressed but not yet released.
        Specified by:
        getPressedButtons in interface MouseRobot
        Returns:
        an (unmodifiable) set containing the pressed (but not yet released) buttons