Class TLcdTouchDevice
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.
This can be useful if you create your own touch events. The default istrue
. -
-Dcom.luciad.input.touch.windows.requireMultiTouch=true
: do not load the native driver if the touch device does not support multi-touch.
The default isfalse
.
- Since:
- 10.0
-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addPropertyChangeListener
(PropertyChangeListener aListener) Add aPropertyChangeListener
to the listener list.int
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
Returns the maximum allowed time between two successive TOUCH_DOWNs to be considered as a double-tap.static TLcdTouchDevice
Initializes the touch support and returns the singleton instance of this class.Returns a human readable explanation of why the touch device is not ready.Returns the status of the physical touch device.void
Remove aPropertyChangeListener
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 correspondingTLcdTouchPoint
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 correspondingTLcdTouchPoint
will increase (similar to double-click with a mouse).
-
Method Details
-
getInstance
Initializes the touch support and returns the singleton instance of this class.- Returns:
- the singleton instance of this class.
-
addPropertyChangeListener
Add aPropertyChangeListener
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. IfaListener
is null, no exception is thrown and no action is taken.- Parameters:
aListener
- ThePropertyChangeListener
to be added- See Also:
-
removePropertyChangeListener
Remove aPropertyChangeListener
from the listener list. This removes aPropertyChangeListener
that was registered for all properties. IfaListener
was added more than once to the same event source, it will be notified one less time after being removed. IfaListener
is null, or was never added, no exception is thrown and no action is taken.- Parameters:
aListener
- The PropertyChangeListener to be removed- See Also:
-
getDoubleTapDistanceThreshold
public 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.- Returns:
- the maximum allowed distance in either the X or Y direction between two successive TOUCH_DOWNs to be considered as a double-tap, expressed in pixels.
- See Also:
-
setDoubleTapDistanceThreshold
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 thanaDoubleTapThreshold
, the tap count of the correspondingTLcdTouchPoint
will not be increased.- Parameters:
aDoubleTapDistanceThreshold
- the threshold, expressed in pixels- See Also:
-
getDoubleTapTimeOut
public int getDoubleTapTimeOut()Returns the maximum allowed time between two successive TOUCH_DOWNs to be considered as a double-tap.- Returns:
- the maximum allowed time between two successive TOUCH_DOWNs to be considered as a double-tap, expressed in milliseconds.
- See Also:
-
setDoubleTapTimeOut
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 thenaDoubleTapDelay
, the tap count of the correspondingTLcdTouchPoint
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, ... .
- Parameters:
aDoubleTapTimeOut
- the delay, expressed in milliseconds- See Also:
-
getTouchDeviceStatus
Returns the status of the physical touch device. Seefor a human readable error message
- Returns:
- the status of the physical touch device
-
getTouchDeviceNotReadyMessage
Returns a human readable explanation of why the touch device is not ready.- Returns:
- an error message if the touch device is not ready, or null if the touch device is ready
- Since:
- 2017.0
-