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. PropertyChangeListeners 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
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionvoidaddPropertyChangeListener(PropertyChangeListener aListener) Add aPropertyChangeListenerto the listener list.intReturns the maximum allowed distance in either the X or Y direction between two successive TOUCH_DOWNs to be considered as a double-tap.intReturns the maximum allowed time between two successive TOUCH_DOWNs to be considered as a double-tap.static TLcdTouchDeviceInitializes 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.voidRemove aPropertyChangeListenerfrom the listener list.voidsetDoubleTapDistanceThreshold(int aDoubleTapDistanceThreshold) When the touch device is touched multiple times rapidly after each other at the same location, the tap count of the correspondingTLcdTouchPointwill increase (similar to double-click with a mouse).voidsetDoubleTapTimeOut(int aDoubleTapTimeOut) When the touch device is touched multiple times rapidly after each other at the same location, the tap count of the correspondingTLcdTouchPointwill 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 aPropertyChangeListenerto 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. IfaListeneris null, no exception is thrown and no action is taken.- Parameters:
aListener- ThePropertyChangeListenerto be added- See Also:
-
removePropertyChangeListener
Remove aPropertyChangeListenerfrom the listener list. This removes aPropertyChangeListenerthat was registered for all properties. IfaListenerwas added more than once to the same event source, it will be notified one less time after being removed. IfaListeneris 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
TLcdTouchPointwill 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 correspondingTLcdTouchPointwill 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
TLcdTouchPointwill 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 correspondingTLcdTouchPointwill 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
-