public class TLcdTouchDevice extends Object
JavaFX applications have native touch support and should not use this class.
Call getInstance()
to load the native driver and use getTouchDeviceStatus()
to find
out at runtime if touch events are supported.
This class contains some important touch related properties. For each of these properties a
getter and setter is available. PropertyChangeListener
s can be attached and removed.
The following system properties can be used to tweak the behavior of the native driver:
-Dcom.luciad.input.touch.windows.loadNativeDriver=false
: never load the native driver. true
.
-Dcom.luciad.input.touch.windows.requireMultiTouch=true
: do not load the native driver if the touch device
does not support multi-touch. false
.
Modifier and Type | Class and Description |
---|---|
static class |
TLcdTouchDevice.Status |
Modifier and Type | Method and Description |
---|---|
void |
addPropertyChangeListener(PropertyChangeListener aListener)
Add a
PropertyChangeListener to the listener list. |
int |
getDoubleTapDistanceThreshold()
Returns the maximum allowed distance in either the X or Y direction between two successive
TOUCH_DOWNs to be considered as a double-tap.
|
int |
getDoubleTapTimeOut()
Returns the maximum allowed time between two successive TOUCH_DOWNs to be considered as a double-tap.
|
static TLcdTouchDevice |
getInstance()
Initializes the touch support and returns the singleton instance of this class.
|
String |
getTouchDeviceNotReadyMessage()
Returns a human readable explanation of why the touch device is not ready.
|
TLcdTouchDevice.Status |
getTouchDeviceStatus()
Returns the status of the physical touch device.
|
void |
removePropertyChangeListener(PropertyChangeListener aListener)
Remove a
PropertyChangeListener from the listener list. |
void |
setDoubleTapDistanceThreshold(int aDoubleTapDistanceThreshold)
When the touch device is touched multiple times rapidly after each other at the same
location, the tap count of the
corresponding
TLcdTouchPoint will increase (similar to double-click with
a mouse). |
void |
setDoubleTapTimeOut(int aDoubleTapTimeOut)
When the touch device is touched multiple times rapidly after each other at the same
location, the tap
count of the corresponding
TLcdTouchPoint will increase (similar to
double-click with a mouse). |
public static TLcdTouchDevice getInstance()
public void addPropertyChangeListener(PropertyChangeListener aListener)
PropertyChangeListener
to the listener list. The listener is registered for
all properties. The same listener object may be added more than once, and will be called as
many times as it is added. If aListener
is null, no exception is thrown and no
action is taken.aListener
- The PropertyChangeListener
to be addedremovePropertyChangeListener(java.beans.PropertyChangeListener)
public void removePropertyChangeListener(PropertyChangeListener aListener)
PropertyChangeListener
from the listener list. This removes a
PropertyChangeListener
that was registered for all properties. If
aListener
was added more than once to the same event source, it will be notified
one less time after being removed. If aListener
is null, or was never added, no
exception is thrown and no action is taken.aListener
- The PropertyChangeListener to be removedaddPropertyChangeListener(java.beans.PropertyChangeListener)
public int getDoubleTapDistanceThreshold()
setDoubleTapDistanceThreshold(int)
,
getDoubleTapTimeOut()
public void setDoubleTapDistanceThreshold(int aDoubleTapDistanceThreshold)
When the touch device is touched multiple times rapidly after each other at the same
location, the tap count of the
corresponding TLcdTouchPoint
will increase (similar to double-click with
a mouse). This setter allows to specify the maximum difference in either the X or Y direction
between two successive TOUCH_DOWNs. If the difference in location between those two TOUCH_DOWNs in either the X or Y
direction is greater than aDoubleTapThreshold
, the tap count of the
corresponding TLcdTouchPoint
will not be increased.
aDoubleTapDistanceThreshold
- the threshold, expressed in pixelsgetDoubleTapDistanceThreshold()
,
getDoubleTapTimeOut()
public int getDoubleTapTimeOut()
setDoubleTapTimeOut(int)
,
getDoubleTapDistanceThreshold()
public void setDoubleTapTimeOut(int aDoubleTapTimeOut)
When the touch device is touched multiple times rapidly after each other at the same
location, the tap
count of the corresponding TLcdTouchPoint
will increase (similar to
double-click with a mouse). This setter allows to specify the maximum allowed delay between two
successive TOUCH_DOWNs. If the delay between two TOUCH_DOWNs is higher then
aDoubleTapDelay
, the tap count of the corresponding
TLcdTouchPoint
will not be increased.
Note that his delay is also used when determining whether the tap count should be increased from 2 to 3, from 3 to 4, ... .
aDoubleTapTimeOut
- the delay, expressed in millisecondsgetDoubleTapTimeOut()
,
getDoubleTapDistanceThreshold()
public TLcdTouchDevice.Status getTouchDeviceStatus()
for a human readable error message
public String getTouchDeviceNotReadyMessage()