Top Description Fields Constructors Methods
org.eclipse.swt.widgets

public final Class Touch

extends Object
Class Inheritance

Instances of this class are created in response to a touch-based input device being touched. They are found in the touches field of an Event or TouchEvent.
Since
3.7
See Also
org.eclipse.swt.events.TouchEvent, Sample code and further information

Field Summary

Modifier and TypeField and Description
public long
id

The unique identity of the touch.

public boolean
primary

A flag indicating that the touch is the first touch from a previous state of no touch points.

public TouchSource
source

The object representing the input source that generated the touch.

public int
state

The state of this touch at the time it was generated.

public int
x

The x location of the touch in TouchSource coordinates.

public int
y

The y location of the touch in TouchSource coordinates.

Constructor Summary

AccessConstructor and Description
pack-priv
Touch(long
Identity of the touch
identity
,
TouchSource
Object representing the device that generated the touch
source
,
int
One of the state constants representing the state of this touch
state
,
boolean
Whether or not the touch is the primary touch
primary
,
int
X location of the touch in screen coordinates
x
,
int
Y location of the touch in screen coordinates
y
)

Constructs a new touch state from the given inputs.

Method Summary

Modifier and TypeMethod and Description
public String

Returns:

a string representation of the event
toString
()

Overrides java.lang.Object.toString.

Returns a string containing a concise, human-readable description of the receiver.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

idback to summary
public long id

The unique identity of the touch. Use this value to track changes to a touch during the touch's life. Two touches may have the same identity even if they come from different sources.

primaryback to summary
public boolean primary

A flag indicating that the touch is the first touch from a previous state of no touch points. Once designated as such, the touch remains the primary touch until all fingers are removed from the device.

sourceback to summary
public TouchSource source

The object representing the input source that generated the touch.

stateback to summary
public int state

The state of this touch at the time it was generated. If this field is 0 then the finger is still touching the device but has not moved since the last TouchEvent was generated.

See Also
org.eclipse.swt.SWT#TOUCHSTATE_DOWN, org.eclipse.swt.SWT#TOUCHSTATE_MOVE, org.eclipse.swt.SWT#TOUCHSTATE_UP
xback to summary
public int x

The x location of the touch in TouchSource coordinates.

yback to summary
public int y

The y location of the touch in TouchSource coordinates.

Constructor Detail

Touchback to summary
pack-priv Touch(long identity, TouchSource source, int state, boolean primary, int x, int y)

Constructs a new touch state from the given inputs.

Parameters
identity:long

Identity of the touch

source:TouchSource

Object representing the device that generated the touch

state:int

One of the state constants representing the state of this touch

primary:boolean

Whether or not the touch is the primary touch

x:int

X location of the touch in screen coordinates

y:int

Y location of the touch in screen coordinates

Method Detail

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Returns a string containing a concise, human-readable description of the receiver.

Returns:String

a string representation of the event

Annotations
@Override