Package org.eclipse.swt.events
Class GestureEvent
java.lang.Object
SWTEventObject
org.eclipse.swt.events.TypedEvent
org.eclipse.swt.events.GestureEvent
Instances of this class are sent in response to
touch-based gestures that are triggered by the user.
- Since:
- 1.4
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionint
The gesture type.boolean
This flag indicates whether the operation should be allowed.double
This field is valid when thedetail
field is set toGESTURE_MAGNIFY
.double
This field is valid when thedetail
field is set toGESTURE_ROTATE
.int
The state of the keyboard modifier keys and mouse masks at the time the event was generated.int
The meaning of this field is dependent on the value of thedetail
field and the platform.int
This field is valid when thedetail
field is set toGESTURE_SWIPE
orGESTURE_PAN
.int
The meaning of this field is dependent on the value of thedetail
field and the platform.int
This field is valid when thedetail
field is set toGESTURE_SWIPE
orGESTURE_PAN
.Fields inherited from class org.eclipse.swt.events.TypedEvent
data, display, time, widget
-
Constructor Summary
ConstructorDescriptionConstructs a new instance of this class based on the information in the given untyped event. -
Method Summary
-
Field Details
-
stateMask
public int stateMaskThe state of the keyboard modifier keys and mouse masks at the time the event was generated.- See Also:
-
detail
public int detailThe gesture type.SWT.GESTURE_BEGIN
SWT.GESTURE_END
SWT.GESTURE_MAGNIFY
SWT.GESTURE_PAN
SWT.GESTURE_ROTATE
SWT.GESTURE_SWIPE
GestureEvent
fields that contain valid data. -
x
public int xThe meaning of this field is dependent on the value of thedetail
field and the platform. It can represent either the x coordinate of the centroid of the touches that make up the gesture, or the x coordinate of the cursor at the time the gesture was performed. -
y
public int yThe meaning of this field is dependent on the value of thedetail
field and the platform. It can represent either the y coordinate of the centroid of the touches that make up the gesture, or the y coordinate of the cursor at the time the gesture was performed. -
rotation
public double rotationThis field is valid when thedetail
field is set toGESTURE_ROTATE
. It specifies the number of degrees rotated on the device since the gesture started. Positive values indicate counter-clockwise rotation, and negative values indicate clockwise rotation. -
xDirection
public int xDirectionThis field is valid when thedetail
field is set toGESTURE_SWIPE
orGESTURE_PAN
. BothxDirection
andyDirection
can be valid for an individual gesture. The meaning of this field is dependent on the value of thedetail
field.If
detail
isGESTURE_SWIPE
then a positive value indicates a swipe to the right and a negative value indicates a swipe to the left. Ifdetail
isGESTURE_PAN
then a positive value indicates a pan to the right by this field's count of pixels and a negative value indicates a pan to the left by this field's count of pixels. -
yDirection
public int yDirectionThis field is valid when thedetail
field is set toGESTURE_SWIPE
orGESTURE_PAN
. BothxDirection
andyDirection
can be valid for an individual gesture. The meaning of this field is dependent on the value of thedetail
field. Ifdetail
isGESTURE_SWIPE
then a positive value indicates a downward swipe and a negative value indicates an upward swipe. Ifdetail
isGESTURE_PAN
then a positive value indicates a downward pan by this field's count of pixels and a negative value indicates an upward pan by this field's count of pixels. -
magnification
public double magnificationThis field is valid when thedetail
field is set toGESTURE_MAGNIFY
. This is the scale factor to be applied. This value will be 1.0 in the first received event withGESTURE_MAGNIFY
, and will then fluctuate in subsequent events as the user moves their fingers. -
doit
public boolean doitThis flag indicates whether the operation should be allowed. Setting it tofalse
will cancel the operation.
-
-
Constructor Details
-
GestureEvent
Constructs a new instance of this class based on the information in the given untyped event.- Parameters:
e
- the untyped event containing the information
-
-
Method Details
-
toString
Returns a string containing a concise, human-readable description of the receiver.- Overrides:
toString
in classTypedEvent
- Returns:
- a string representation of the event
-