Class ALspConfinedTouchController
- All Implemented Interfaces:
ILcdAWTEventListener
,ILspController
- Direct Known Subclasses:
TLspTouchAndHoldActionController
,TLspTouchNavigateController
Extension of ALspTouchController
confining the number of handled touch
points
based on a minimum and maximum. This is achieved by implementing the touchPointAvailable
and touchPointWithdrawn
methods.
The default behaviour of those methods:
- will start tracking when a touch point becomes available as soon as the minimal number of touch points can be reached.
- will track any new available touch point as long as the maximal number of touch points is not yet reached.
- will keep on tracking when a point is withdrawn as long as at least the minimal number of touch points is tracked.
- Since:
- 2012.0
-
Constructor Summary
ConstructorDescriptionALspConfinedTouchController
(int aNumberOfInputPoints) Creates a newALspConfinedTouchController
for touch input containingaNumberOfInputPoints
touch points.ALspConfinedTouchController
(int aMinimumNumberOfTouchPoints, int aMaximumNumberOfTouchPoints) Creates a newALspConfinedTouchController
for touch input containing a number of touch points contained in[aMinimumNumberOfTouchPoints, aMaximumNumberOTouchPoints]
. -
Method Summary
Modifier and TypeMethodDescriptionint
Returns the maximum number of touch points this controller should handle, as specified in the constructor.int
Returns the minimum number of touch points this controller should handle, as specified in the constructor.protected List
<TLcdTouchPoint> touchPointAvailable
(List<TLcdTouchPoint> aTouchPoints, TLcdTouchPoint aTouchDown) This method is called every time a new touch point is created or becomes available and allows to react accordingly.protected List
<TLcdTouchPoint> touchPointWithdrawn
(List<TLcdTouchPoint> aTouchPoints, TLcdTouchPoint aTouchUp) This methods is called every time a tracked touch point is removed or consumed and allows to react accordingly.Methods inherited from class com.luciad.view.lightspeed.controller.touch.ALspTouchController
getCurrentLocations, getMoveThreshold, getOriginalLocations, getPreviousLocations, getTouchPointIDs, handleAWTEvent, handleAWTEventImpl, handleEventImpl, handleFXEvent, isDrawTouchPoints, paintImpl, setDrawTouchPoints, setMoveThreshold, touchPointMoved
Methods inherited from class com.luciad.view.lightspeed.controller.ALspController
addPropertyChangeListener, addStatusListener, appendController, firePropertyChange, fireStatusEvent, getAWTFilter, getCursor, getFXCursor, getFXFilter, getIcon, getLayered, getName, getNextController, getShortDescription, getView, handleFXEventImpl, paint, registerViewPropertyNameForReset, removePropertyChangeListener, removeStatusListener, setAWTFilter, setCursor, setFXCursor, setFXFilter, setIcon, setName, setShortDescription, startInteraction, startInteractionImpl, terminateInteraction, terminateInteractionImpl
-
Constructor Details
-
ALspConfinedTouchController
public ALspConfinedTouchController(int aNumberOfInputPoints) Creates a newALspConfinedTouchController
for touch input containingaNumberOfInputPoints
touch points.- Parameters:
aNumberOfInputPoints
- the number of touch points this controller should handle
-
ALspConfinedTouchController
public ALspConfinedTouchController(int aMinimumNumberOfTouchPoints, int aMaximumNumberOfTouchPoints) Creates a newALspConfinedTouchController
for touch input containing a number of touch points contained in[aMinimumNumberOfTouchPoints, aMaximumNumberOTouchPoints]
.- Parameters:
aMinimumNumberOfTouchPoints
- the minimum number of touch points this controller should handle.aMaximumNumberOfTouchPoints
- the maximum number of touch points this controller should handle. Must be greater than or equal toaMinimumNumberOfTouchPoints
-
-
Method Details
-
touchPointAvailable
protected List<TLcdTouchPoint> touchPointAvailable(List<TLcdTouchPoint> aTouchPoints, TLcdTouchPoint aTouchDown) Description copied from class:ALspTouchController
This method is called every time a new touch point is created or becomes available and allows to react accordingly.
aTouchDown
is theTLcdTouchPoint
which has been created, whileaTouchPoints
contains all availableTLcdTouchPoint
s (includingaTouchDown
). All of these points are non-consumed.This method allows to indicate which points should be tracked by this controller by returning them in a
List
. If aTLcdTouchPoint
which is currently tracked is omitted from theList
, that touch point will be made available to the rest of the chain as explained in the class javadoc.- Specified by:
touchPointAvailable
in classALspTouchController
- Parameters:
aTouchPoints
- AList
containing all availableTLcdTouchPoint
instances. This list will includeaTouchDown
. Note that some of theseTLcdTouchPoint
s can already be tracked by this controller (seegetTouchPointIDs
). It is possible to modify thisList
and return it instead of creating a newList
.aTouchDown
- The descriptor of the touch point which has been created or removed. The state of the descriptor will always be DOWN. Note that this descriptor is included inaTouchPoints
.- Returns:
- a
List
containing allTLcdTouchPoint
instances which should be tracked by this controller. AllTLcdTouchPoint
instances contained in thisList
must be contained inaTouchPoints
. May be an emptyList
, but notnull
.
-
touchPointWithdrawn
protected List<TLcdTouchPoint> touchPointWithdrawn(List<TLcdTouchPoint> aTouchPoints, TLcdTouchPoint aTouchUp) Description copied from class:ALspTouchController
This methods is called every time a tracked touch point is removed or consumed and allows to react accordingly.
aTouchUp
is theTLcdTouchPoint
which has been removed, whileaTouchPoints
contains all availableTLcdTouchPoint
s (includingaTouchUp
). All of these points are non-consumed.This method allows to indicate that certain touch points should no longer be tracked by this controller. It does so by returning a
List
containing allTLcdTouchPoint
instances which should be tracked by this controller. If aTLcdTouchPoint
which is currently tracked is omitted from theList
, that touch point will be made available to the rest of the chain as explained in the class javadoc.- Specified by:
touchPointWithdrawn
in classALspTouchController
- Parameters:
aTouchPoints
- AList
containing all availableTLcdTouchPoint
instances, includingaTouchUp
. It is possible to modify thisList
and return it instead of creating a newList
.aTouchUp
- The touch point which has been removed. The state of the descriptor will always be UP. Note that this descriptor is included inaTouchPoints
.- Returns:
- a
List
containing allTLcdTouchPoint
s this controller should keep tracking. AllTLcdTouchPoint
instances contained in thisList
must be contained inaTrackedTouchPoints
. May be an emptyList
, but notnull
. - See Also:
-
getMaximumNumberOfPoints
public int getMaximumNumberOfPoints()Returns the maximum number of touch points this controller should handle, as specified in the constructor.
- Returns:
- the maximum number of touch points this controller should handle.
- See Also:
-
getMinimumNumberOfPoints
public int getMinimumNumberOfPoints()Returns the minimum number of touch points this controller should handle, as specified in the constructor.
- Returns:
- the minimum number of touch points this controller should handle.
- See Also:
-