Package org.netbeans.jemmy.drivers.input
Class MouseEventDriver
- java.lang.Object
-
- org.netbeans.jemmy.drivers.LightSupportiveDriver
-
- org.netbeans.jemmy.drivers.input.EventDriver
-
- org.netbeans.jemmy.drivers.input.MouseEventDriver
-
- All Implemented Interfaces:
LightDriver,MouseDriver
public class MouseEventDriver extends EventDriver implements MouseDriver
MouseDriver using event dispatching.- Author:
- Alexandre Iline(alexandre.iline@sun.com)
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.netbeans.jemmy.drivers.input.EventDriver
EventDriver.Dispatcher
-
-
Constructor Summary
Constructors Constructor Description MouseEventDriver()Constructs a MouseEventDriver object.MouseEventDriver(java.lang.String[] supported)Constructs a MouseEventDriver object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclickMouse(ComponentOperator oper, int x, int y, int clickCount, int mouseButton, int modifiers, Timeout mouseClick)Clicks mouse.protected voiddispatchEvent(java.awt.Component comp, int id, int modifiers, int x, int y, int clickCount, int mouseButton)Dispatches a mouse event to the component.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.-
Methods inherited from class org.netbeans.jemmy.drivers.input.EventDriver
checkVisibility, dispatchEvent
-
Methods inherited from class org.netbeans.jemmy.drivers.LightSupportiveDriver
checkSupported, getSupported
-
-
-
-
Method Detail
-
pressMouse
public void pressMouse(ComponentOperator oper, int x, int y, int mouseButton, int modifiers)
Description copied from interface:MouseDriverPresses mouse.- Specified by:
pressMousein interfaceMouseDriver- Parameters:
oper- Component operator.x- Relative x coordinate.y- Relative y coordinate.mouseButton- mouse button (InputEvent.BUTTON*_MASKfield)modifiers- a combination ofInputEvent.*_MASKfields.
-
releaseMouse
public void releaseMouse(ComponentOperator oper, int x, int y, int mouseButton, int modifiers)
Description copied from interface:MouseDriverReleases mouse.- Specified by:
releaseMousein interfaceMouseDriver- Parameters:
oper- Component operator.x- Relative x coordinate.y- Relative y coordinate.mouseButton- mouse button (InputEvent.BUTTON*_MASKfield)modifiers- a combination ofInputEvent.*_MASKfields.
-
moveMouse
public void moveMouse(ComponentOperator oper, int x, int y)
Description copied from interface:MouseDriverMoves mouse.- Specified by:
moveMousein interfaceMouseDriver- Parameters:
oper- Component operator.x- Relative x coordinate.y- Relative y coordinate.
-
clickMouse
public void clickMouse(ComponentOperator oper, int x, int y, int clickCount, int mouseButton, int modifiers, Timeout mouseClick)
Description copied from interface:MouseDriverClicks mouse.- Specified by:
clickMousein interfaceMouseDriver- 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.
-
dragMouse
public void dragMouse(ComponentOperator oper, int x, int y, int mouseButton, int modifiers)
Description copied from interface:MouseDriverDrags mouse.- Specified by:
dragMousein interfaceMouseDriver- Parameters:
oper- Component operator.x- Relative x coordinate.y- Relative y coordinate.mouseButton- mouse button (InputEvent.BUTTON*_MASKfield)modifiers- a combination ofInputEvent.*_MASKfields.
-
dragNDrop
public void dragNDrop(ComponentOperator oper, int start_x, int start_y, int end_x, int end_y, int mouseButton, int modifiers, Timeout before, Timeout after)
Description copied from interface:MouseDriverPerforms drag'n'drop.- Specified by:
dragNDropin interfaceMouseDriver- 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
public void enterMouse(ComponentOperator oper)
Description copied from interface:MouseDriverMoves mouse inside a component.- Specified by:
enterMousein interfaceMouseDriver- Parameters:
oper- Component operator.
-
exitMouse
public void exitMouse(ComponentOperator oper)
Description copied from interface:MouseDriverMoves mouse outside a component.- Specified by:
exitMousein interfaceMouseDriver- Parameters:
oper- Component operator.
-
dispatchEvent
protected void dispatchEvent(java.awt.Component comp, int id, int modifiers, int x, int y, int clickCount, int mouseButton)Dispatches a mouse event to the component.- Parameters:
comp- Component to dispatch events to.id- an event id.modifiers- a combination ofInputEvent.*_MASKfields.x- relative x coordinate of event pointy- relative y coordinate of event pointclickCount- click countmouseButton- mouse button.
-
-