- java.lang.Object
-
- org.testfx.robot.impl.MouseRobotImpl
-
- All Implemented Interfaces:
MouseRobot
public class MouseRobotImpl extends Object implements MouseRobot
-
-
Constructor Summary
Constructors Constructor Description MouseRobotImpl(BaseRobot baseRobot)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Set<MouseButton>getPressedButtons()Gets the mouse buttons that have been pressed but not yet released.voidmove(Point2D location)Moves the mouse to the given location.voidmoveNoWait(Point2D location)Moves the mouse to the given location.voidpress(MouseButton... buttons)Presses the given mouse buttons, until explicitly released viaMouseRobot.release(MouseButton...).voidpressNoWait(MouseButton... buttons)Presses the given mouse buttons, until explicitly released viaMouseRobot.release(MouseButton...).voidrelease(MouseButton... buttons)Releases the given mouse buttons.voidreleaseNoWait(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.
-
-
-
Constructor Detail
-
MouseRobotImpl
public MouseRobotImpl(BaseRobot baseRobot)
-
-
Method Detail
-
press
public void press(MouseButton... buttons)
Description copied from interface:MouseRobotPresses the given mouse buttons, until explicitly released viaMouseRobot.release(MouseButton...). Once pressed, callsWaitForAsyncUtils.waitForFxEvents().Note: passing in an empty
MouseButton[]will callpress(MouseButton.PRIMARY).- Specified by:
pressin interfaceMouseRobot- Parameters:
buttons- the mouse buttons to press
-
pressNoWait
public void pressNoWait(MouseButton... buttons)
Description copied from interface:MouseRobotPresses the given mouse buttons, until explicitly released viaMouseRobot.release(MouseButton...). Once pressed,WaitForAsyncUtils.waitForFxEvents()is not called.Note: passing in an empty
MouseButton[]will callpress(MouseButton.PRIMARY).- Specified by:
pressNoWaitin interfaceMouseRobot- Parameters:
buttons- the mouse buttons to press without waiting afterwards
-
release
public void release(MouseButton... buttons)
Description copied from interface:MouseRobotReleases the given mouse buttons. Once pressed, callsWaitForAsyncUtils.waitForFxEvents().Note: passing in an empty
MouseButton[]will release all pressedMouseButtons.- Specified by:
releasein interfaceMouseRobot- Parameters:
buttons- the mouse buttons to release
-
releaseNoWait
public void releaseNoWait(MouseButton... buttons)
Description copied from interface:MouseRobotReleases the given mouse buttons. Once pressed,WaitForAsyncUtils.waitForFxEvents()is not called.Note: passing in an empty
MouseButton[]will release all pressedMouseButtons.- Specified by:
releaseNoWaitin interfaceMouseRobot- Parameters:
buttons- the mouse buttons to release without waiting afterwards
-
move
public void move(Point2D location)
Description copied from interface:MouseRobotMoves the mouse to the given location. Once moved, callsWaitForAsyncUtils.waitForFxEvents().- Specified by:
movein interfaceMouseRobot- Parameters:
location- the location to move the mouse to
-
moveNoWait
public void moveNoWait(Point2D location)
Description copied from interface:MouseRobotMoves the mouse to the given location. Once moved,WaitForAsyncUtils.waitForFxEvents()is not called.- Specified by:
moveNoWaitin interfaceMouseRobot- Parameters:
location- the location to move the mouse to without waiting afterwards
-
scroll
public void scroll(int wheelAmount)
Description copied from interface:MouseRobotScrolls the mouse wheel by the given amount. Once scrolled, callsWaitForAsyncUtils.waitForFxEvents().- Specified by:
scrollin interfaceMouseRobot- Parameters:
wheelAmount- the amount to scroll the mouse by
-
scrollNoWait
public void scrollNoWait(int wheelAmount)
Description copied from interface:MouseRobotScrolls the mouse wheel by the given amount. Once scrolled,WaitForAsyncUtils.waitForFxEvents()is not called.- Specified by:
scrollNoWaitin interfaceMouseRobot- Parameters:
wheelAmount- the amount to scroll the mouse by without waiting afterwards
-
getPressedButtons
public final Set<MouseButton> getPressedButtons()
Description copied from interface:MouseRobotGets the mouse buttons that have been pressed but not yet released.- Specified by:
getPressedButtonsin interfaceMouseRobot- Returns:
- an (unmodifiable) set containing the pressed (but not yet released) buttons
-
-