|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.rim.device.api.system.EventInjector.Event
net.rim.device.api.system.EventInjector.TouchEvent
public static class EventInjector.TouchEvent
The event class that defines a touch screen event.
| Field Summary | ||
|---|---|---|
|
static int |
CLICK
Touch screen click input event. |
|
static int |
DOWN
Touch screen down input event. |
|
static int |
MOVE
Touch screen move input event. |
|
static int |
UNCLICK
Touch screen unclick input event. |
|
static int |
UP
Touch screen up input event. |
| Constructor Summary | ||
|---|---|---|
|
EventInjector.TouchEvent(int event,
int x1,
int y1,
int x2,
int y2,
int time)
Creates a TouchEvent with a touch screen event code, coordinates of two touch (finger) points, and time. |
|
| Method Summary | ||
|---|---|---|
|
int |
getPoint1X()
Returns the x coordinate for the first touch point. |
|
int |
getPoint1Y()
Returns the y coordinate for the first touch point. |
|
int |
getPoint2X()
Returns the x coordinate for the second touch point. |
|
int |
getPoint2Y()
Returns the y coordinate for the second touch point. |
|
static void |
injectSwipeGesture(int originX,
int originY,
EventInjector.TouchEvent[] moveEvents)
Injects a swipe gesture. |
|
static void |
injectTapGesture(int x,
int y,
int taps)
Injects a tap or multi tap sequence. |
|
static void |
injectTwoFingerTap(int x1,
int y1,
int x2,
int y2,
int touchPoint)
Injects a two finger TAP gesture associating the TAP with either the first or second touch point. |
|
static void |
invokeClickThrough(int x1,
int y1,
int x2,
int y2)
Creates and invokes the sequence of events (DOWN, CLICK, UNCLICK, UP) which form a click-through. |
|
void |
setPoint1(int x1,
int y1)
Sets coordinates for the first touch point. |
|
void |
setPoint2(int x2,
int y2)
Sets coordinates for the second touch point. |
| Methods inherited from class net.rim.device.api.system.EventInjector.Event |
|---|
getEvent, getStatus, getTime, post, setEvent, setStatus, setTimeToCurrent |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int DOWN
public static final int UP
public static final int MOVE
public static final int CLICK
public static final int UNCLICK
| Constructor Detail |
|---|
public EventInjector.TouchEvent(int event,
int x1,
int y1,
int x2,
int y2,
int time)
event - One of the following touchscreen event codes: EventInjector.TouchEvent.DOWN,
EventInjector.TouchEvent.UP, EventInjector.TouchEvent.MOVE, EventInjector.TouchEvent.CLICK, EventInjector.TouchEvent.UNCLICK,x1 - X coordinate of the first touch point. Set to -1 if it does not exist. Cannot be less than -1 or greater than screen width.y1 - Y coordinate of the first touch point. Set to -1 if it does not exist. Cannot be less than -1 or greater than screen height.x2 - X coordinate of the second touch point. Set to -1 if it does not exist. Cannot be less than -1 or greater than screen width.y2 - Y coordinate of the second touch point. Set to -1 if it does not exist. Cannot be less than -1 or greater than screen height.time - Ticks in milliseconds. Set to -1 to apply system uptime.
IllegalArgumentException - if event or coordinate values are invalid| Method Detail |
|---|
public static void injectSwipeGesture(int originX,
int originY,
EventInjector.TouchEvent[] moveEvents)
originX - Origin X coordinate. Cannot be less than 0 and cannot be greater than screen width.originY - Origin Y coordinate. Cannot be less than 0 and cannot be greater than screen height.moveEvents - An array of move events. Specify null if no move events desired as part of the gesture.
IllegalArgumentException - if coordinate values are invalid
public static void injectTapGesture(int x,
int y,
int taps)
x - X coordinate of the first touch point. Cannot be less than 0 and cannot be greater than screen width.y - Y coordinate of the first touch point. Cannot be less than 0 and cannot be greater than screen height.taps - Indicates number of taps to inject. Must be 1 or greater.
IllegalArgumentException - if coordinate or taps values are invalid
public static void injectTwoFingerTap(int x1,
int y1,
int x2,
int y2,
int touchPoint)
x1 - X coordinate of the first touch point. Cannot be less than 0 and cannot be greater than screen width.y1 - Y coordinate of the first touch point Cannot be less than 0 and cannot be greater than screen height.x2 - X coordinate of the second touch point Cannot be less than 0 and cannot be greater than screen width.y2 - Y coordinate of the second touch point Cannot be less than 0 and cannot be greater than screen height.touchPoint - Indicates the touchPoint with which to associate the TAP gesture. Must be 1 or 2.
IllegalArgumentException - if coordinate or touch point values are invalid
public static final void invokeClickThrough(int x1,
int y1,
int x2,
int y2)
x1 - X coordinate of the first touch point. Cannot be less than -1 or greater than screen width. Set to -1 if it does not exist.y1 - Y coordinate of the first touch point. Cannot be less than -1 or greater than screen height. Set to -1 if it does not exist.x2 - X coordinate of the second touch point. Cannot be less than -1 or greater than screen width. Set to -1 if it does not exist.y2 - Y coordinate of the second touch point. Cannot be less than -1 or greater than screen height. Set to -1 if it does not exist.
IllegalArgumentException - if coordinate values are invalid
public void setPoint1(int x1,
int y1)
x1 - X coordinate of the first touch point. Set to -1 if it does not exist. Cannot be less than -1 or greater than screen width.y1 - Y coordinate of the first touch point. Set to -1 if it does not exist. Cannot be less than -1 or greater than screen height.
IllegalArgumentException - if coordinate values are invalid
public void setPoint2(int x2,
int y2)
x2 - X coordinate of the second touch point. Set to -1 if it does not exist. Cannot be less than -1 or greater than screen width.y2 - Y coordinate of the second touch point. Set to -1 if it does not exist. Cannot be less than -1 or greater than screen width.
IllegalArgumentException - if coordinate values are invalid or if this method is called with positive arguments while first touch point exists and event = MOVE.
IllegalStateException - if this method is called with positive arguments while first touch point exists and event is not MOVE.public int getPoint1X()
public int getPoint1Y()
public int getPoint2X()
public int getPoint2Y()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
Copyright 1999-2010 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Copyright 1993-2003 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A. All Rights Reserved.
Copyright 2002-2003 Nokia Corporation All Rights Reserved.
Java is a trademark of Sun Microsystems, Inc.