Package org.testfx.robot
Interface MouseRobot
- All Known Implementing Classes:
MouseRobotImpl
public interface MouseRobot
-
Method Summary
Modifier and TypeMethodDescriptionSet<javafx.scene.input.MouseButton> Gets the mouse buttons that have been pressed but not yet released.voidmove(javafx.geometry.Point2D location) Moves the mouse to the given location.voidmoveNoWait(javafx.geometry.Point2D location) Moves the mouse to the given location.voidpress(javafx.scene.input.MouseButton... buttons) Presses the given mouse buttons, until explicitly released viarelease(MouseButton...).voidpressNoWait(javafx.scene.input.MouseButton... buttons) Presses the given mouse buttons, until explicitly released viarelease(MouseButton...).voidrelease(javafx.scene.input.MouseButton... buttons) Releases the given mouse buttons.voidreleaseNoWait(javafx.scene.input.MouseButton... buttons) Releases the given mouse buttons.voidscroll(int wheelAmount) Scrolls the mouse wheel by the given amount.voidscrollNoWait(int wheelAmount) Scrolls the mouse wheel by the given amount.
-
Method Details
-
press
void press(javafx.scene.input.MouseButton... buttons) Presses the given mouse buttons, until explicitly released viarelease(MouseButton...). Once pressed, callsWaitForAsyncUtils.waitForFxEvents().Note: passing in an empty
MouseButton[]will callpress(MouseButton.PRIMARY).- Parameters:
buttons- the mouse buttons to press
-
pressNoWait
void pressNoWait(javafx.scene.input.MouseButton... buttons) Presses the given mouse buttons, until explicitly released viarelease(MouseButton...). Once pressed,WaitForAsyncUtils.waitForFxEvents()is not called.Note: passing in an empty
MouseButton[]will callpress(MouseButton.PRIMARY).- Parameters:
buttons- the mouse buttons to press without waiting afterwards
-
getPressedButtons
Set<javafx.scene.input.MouseButton> getPressedButtons()Gets the mouse buttons that have been pressed but not yet released.- Returns:
- an (unmodifiable) set containing the pressed (but not yet released) buttons
-
release
void release(javafx.scene.input.MouseButton... buttons) Releases the given mouse buttons. Once pressed, callsWaitForAsyncUtils.waitForFxEvents().Note: passing in an empty
MouseButton[]will release all pressedMouseButtons.- Parameters:
buttons- the mouse buttons to release
-
releaseNoWait
void releaseNoWait(javafx.scene.input.MouseButton... buttons) Releases the given mouse buttons. Once pressed,WaitForAsyncUtils.waitForFxEvents()is not called.Note: passing in an empty
MouseButton[]will release all pressedMouseButtons.- Parameters:
buttons- the mouse buttons to release without waiting afterwards
-
move
void move(javafx.geometry.Point2D location) Moves the mouse to the given location. Once moved, callsWaitForAsyncUtils.waitForFxEvents().- Parameters:
location- the location to move the mouse to
-
moveNoWait
void moveNoWait(javafx.geometry.Point2D location) Moves the mouse to the given location. Once moved,WaitForAsyncUtils.waitForFxEvents()is not called.- Parameters:
location- the location to move the mouse to without waiting afterwards
-
scroll
void scroll(int wheelAmount) Scrolls the mouse wheel by the given amount. Once scrolled, callsWaitForAsyncUtils.waitForFxEvents().- Parameters:
wheelAmount- the amount to scroll the mouse by
-
scrollNoWait
void scrollNoWait(int wheelAmount) Scrolls the mouse wheel by the given amount. Once scrolled,WaitForAsyncUtils.waitForFxEvents()is not called.- Parameters:
wheelAmount- the amount to scroll the mouse by without waiting afterwards
-