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

public final Class TouchSource

extends Object
Class Inheritance
Imports
org.eclipse.swt.graphics.*

Instances of this class represent sources of touch input that generate Touch objects. They also provide information about the input source, which is important for interpreting the information in the Touch object.

Instances of this class can be marked as direct or indirect:

Since
3.7
See Also
Touch, Sample code and further information

Field Summary

Modifier and TypeField and Description
pack-priv Rectangle
pack-priv boolean
pack-priv long

Constructor Summary

AccessConstructor and Description
pack-priv
TouchSource(long handle, boolean
Is the touch source direct or indirect?
direct
,
Rectangle bounds)

Constructs a new touch source from the given inputs.

Method Summary

Modifier and TypeMethod and Description
public Rectangle

Returns:

the bounding rectangle of the input source
getBounds
()

Returns the bounding rectangle of the device.

public boolean

Returns:

true if the input source is direct, or false otherwise
isDirect
()

Returns the type of touch input this source generates, true for direct or false for indirect.

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

boundsback to summary
pack-priv Rectangle bounds
directback to summary
pack-priv boolean direct
handleback to summary
pack-priv long handle

Constructor Detail

TouchSourceback to summary
pack-priv TouchSource(long handle, boolean direct, Rectangle bounds)

Constructs a new touch source from the given inputs.

Parameters
direct:boolean

Is the touch source direct or indirect?

Method Detail

getBoundsback to summary
public Rectangle getBounds()

Returns the bounding rectangle of the device. For a direct source, this corresponds to the bounds of the display device in pixels. For an indirect source, this contains the size of the device in points.

Note that the x and y values may not necessarily be 0 if the TouchSource is a direct source.

Returns:Rectangle

the bounding rectangle of the input source

isDirectback to summary
public boolean isDirect()

Returns the type of touch input this source generates, true for direct or false for indirect.

Returns:boolean

true if the input source is direct, or false otherwise

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