Interface MouseDriver
- All Known Implementing Classes:
MouseEventDriver, MouseRobotDriver
public interface MouseDriver
Defines how to simulate mouse operations.
-
Method Summary
Modifier and TypeMethodDescriptionvoidclickMouse(ComponentOperator oper, int x, int y, int clickCount, int mouseButton, int modifiers, Timeout mouseClick) Clicks mouse.voiddragMouse(ComponentOperator oper, int x, int y, int mouseButton, int modifiers) Drags mouse.voiddragNDrop(ComponentOperator oper, int start_x, int start_y, int end_x, int end_y, int mouseButton, int modifiers, Timeout before, Timeout after) Performs drag'n'drop.voidenterMouse(ComponentOperator oper) Moves mouse inside a component.voidexitMouse(ComponentOperator oper) Moves mouse outside a component.voidmoveMouse(ComponentOperator oper, int x, int y) Moves mouse.voidpressMouse(ComponentOperator oper, int x, int y, int mouseButton, int modifiers) Presses mouse.voidreleaseMouse(ComponentOperator oper, int x, int y, int mouseButton, int modifiers) Releases mouse.
-
Method Details
-
pressMouse
Presses mouse.- Parameters:
oper- Component operator.x- Relative x coordinate.y- Relative y coordinate.mouseButton- mouse button (InputEvent.BUTTON*_MASKfield)modifiers- a combination ofInputEvent.*_MASKfields.
-
releaseMouse
Releases mouse.- Parameters:
oper- Component operator.x- Relative x coordinate.y- Relative y coordinate.mouseButton- mouse button (InputEvent.BUTTON*_MASKfield)modifiers- a combination ofInputEvent.*_MASKfields.
-
clickMouse
void clickMouse(ComponentOperator oper, int x, int y, int clickCount, int mouseButton, int modifiers, Timeout mouseClick) Clicks mouse.- Parameters:
oper- Component operator.x- Relative x coordinate.y- Relative y coordinate.clickCount- How many times to click.mouseButton- mouse button (InputEvent.BUTTON*_MASKfield)modifiers- a combination ofInputEvent.*_MASKfields.mouseClick- Time between pressing and releasing mouse.
-
moveMouse
Moves mouse.- Parameters:
oper- Component operator.x- Relative x coordinate.y- Relative y coordinate.
-
dragMouse
Drags mouse.- Parameters:
oper- Component operator.x- Relative x coordinate.y- Relative y coordinate.mouseButton- mouse button (InputEvent.BUTTON*_MASKfield)modifiers- a combination ofInputEvent.*_MASKfields.
-
dragNDrop
void dragNDrop(ComponentOperator oper, int start_x, int start_y, int end_x, int end_y, int mouseButton, int modifiers, Timeout before, Timeout after) Performs drag'n'drop.- Parameters:
oper- Component operator.start_x- Relative x coordinate of start point.start_y- Relative y coordinate of start point.end_x- Relative x coordinate of end point.end_y- Relative y coordinate of end point.mouseButton- mouse button (InputEvent.BUTTON*_MASKfield)modifiers- a combination ofInputEvent.*_MASKfields.before- Time to sleep after taking (before dragging)after- Time to sleep before dropping (after dragging)
-
enterMouse
Moves mouse inside a component.- Parameters:
oper- Component operator.
-
exitMouse
Moves mouse outside a component.- Parameters:
oper- Component operator.
-