public final class TouchSource
extends java.lang.Object
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:
Touch,
Sample code and further information| Modifier and Type | Field and Description |
|---|---|
(package private) Rectangle |
bounds |
(package private) boolean |
direct |
(package private) int |
handle |
| Constructor and Description |
|---|
TouchSource(int handle,
boolean direct,
Rectangle bounds)
Constructs a new touch source from the given inputs.
|
| Modifier and Type | Method and Description |
|---|---|
Rectangle |
getBounds()
Returns the bounding rectangle of the device.
|
boolean |
isDirect()
Returns the type of touch input this source generates,
true for direct or false for indirect. |
java.lang.String |
toString()
Returns a string containing a concise, human-readable
description of the receiver.
|
int handle
boolean direct
Rectangle bounds
TouchSource(int handle,
boolean direct,
Rectangle bounds)
direct - Is the touch source direct or indirect?height - height of the source in pixels.width - width of the source in pixels.public boolean isDirect()
true for direct or false for indirect.true if the input source is direct, or false otherwisepublic Rectangle getBounds()
Note that the x and y values may not necessarily be 0 if the TouchSource is a direct source.
public java.lang.String toString()
toString in class java.lang.Object