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 SummaryFieldsModifier and TypeFieldDescriptionintThe gesture type.booleanThis flag indicates whether the operation should be allowed.doubleThis field is valid when thedetailfield is set toGESTURE_MAGNIFY.doubleThis field is valid when thedetailfield is set toGESTURE_ROTATE.intThe state of the keyboard modifier keys and mouse masks at the time the event was generated.intThe meaning of this field is dependent on the value of thedetailfield and the platform.intThis field is valid when thedetailfield is set toGESTURE_SWIPEorGESTURE_PAN.intThe meaning of this field is dependent on the value of thedetailfield and the platform.intThis field is valid when thedetailfield is set toGESTURE_SWIPEorGESTURE_PAN.Fields inherited from class org.eclipse.swt.events.TypedEventdata, display, time, widget
- 
Constructor SummaryConstructorsConstructorDescriptionConstructs a new instance of this class based on the information in the given untyped event.
- 
Method Summary
- 
Field Details- 
stateMaskpublic int stateMaskThe state of the keyboard modifier keys and mouse masks at the time the event was generated.- See Also:
 
- 
detailpublic int detailThe gesture type.- SWT.GESTURE_BEGIN
- SWT.GESTURE_END
- SWT.GESTURE_MAGNIFY
- SWT.GESTURE_PAN
- SWT.GESTURE_ROTATE
- SWT.GESTURE_SWIPE
 GestureEventfields that contain valid data.
- 
xpublic int xThe meaning of this field is dependent on the value of thedetailfield 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.
- 
ypublic int yThe meaning of this field is dependent on the value of thedetailfield 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.
- 
rotationpublic double rotationThis field is valid when thedetailfield 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.
- 
xDirectionpublic int xDirectionThis field is valid when thedetailfield is set toGESTURE_SWIPEorGESTURE_PAN. BothxDirectionandyDirectioncan be valid for an individual gesture. The meaning of this field is dependent on the value of thedetailfield.If detailisGESTURE_SWIPEthen a positive value indicates a swipe to the right and a negative value indicates a swipe to the left. IfdetailisGESTURE_PANthen 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.
- 
yDirectionpublic int yDirectionThis field is valid when thedetailfield is set toGESTURE_SWIPEorGESTURE_PAN. BothxDirectionandyDirectioncan be valid for an individual gesture. The meaning of this field is dependent on the value of thedetailfield. IfdetailisGESTURE_SWIPEthen a positive value indicates a downward swipe and a negative value indicates an upward swipe. IfdetailisGESTURE_PANthen 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.
- 
magnificationpublic double magnificationThis field is valid when thedetailfield 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.
- 
doitpublic boolean doitThis flag indicates whether the operation should be allowed. Setting it tofalsewill cancel the operation.
 
- 
- 
Constructor Details- 
GestureEventConstructs 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- 
toStringReturns a string containing a concise, human-readable description of the receiver.- Overrides:
- toStringin class- TypedEvent
- Returns:
- a string representation of the event
 
 
-