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
ConstructorsConstructorDescriptionALspConfinedTouchController(int aNumberOfInputPoints) Creates a newALspConfinedTouchControllerfor touch input containingaNumberOfInputPointstouch points.ALspConfinedTouchController(int aMinimumNumberOfTouchPoints, int aMaximumNumberOfTouchPoints) Creates a newALspConfinedTouchControllerfor touch input containing a number of touch points contained in[aMinimumNumberOfTouchPoints, aMaximumNumberOTouchPoints]. -
Method Summary
Modifier and TypeMethodDescriptionintReturns the maximum number of touch points this controller should handle, as specified in the constructor.intReturns 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, touchPointMovedMethods 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 newALspConfinedTouchControllerfor touch input containingaNumberOfInputPointstouch points.- Parameters:
aNumberOfInputPoints- the number of touch points this controller should handle
-
ALspConfinedTouchController
public ALspConfinedTouchController(int aMinimumNumberOfTouchPoints, int aMaximumNumberOfTouchPoints) Creates a newALspConfinedTouchControllerfor 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:ALspTouchControllerThis method is called every time a new touch point is created or becomes available and allows to react accordingly.
aTouchDownis theTLcdTouchPointwhich has been created, whileaTouchPointscontains all availableTLcdTouchPoints (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 aTLcdTouchPointwhich 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:
touchPointAvailablein classALspTouchController- Parameters:
aTouchPoints- AListcontaining all availableTLcdTouchPointinstances. This list will includeaTouchDown. Note that some of theseTLcdTouchPoints can already be tracked by this controller (seegetTouchPointIDs). It is possible to modify thisListand 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
Listcontaining allTLcdTouchPointinstances which should be tracked by this controller. AllTLcdTouchPointinstances contained in thisListmust be contained inaTouchPoints. May be an emptyList, but notnull.
-
touchPointWithdrawn
protected List<TLcdTouchPoint> touchPointWithdrawn(List<TLcdTouchPoint> aTouchPoints, TLcdTouchPoint aTouchUp) Description copied from class:ALspTouchControllerThis methods is called every time a tracked touch point is removed or consumed and allows to react accordingly.
aTouchUpis theTLcdTouchPointwhich has been removed, whileaTouchPointscontains all availableTLcdTouchPoints (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
Listcontaining allTLcdTouchPointinstances which should be tracked by this controller. If aTLcdTouchPointwhich 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:
touchPointWithdrawnin classALspTouchController- Parameters:
aTouchPoints- AListcontaining all availableTLcdTouchPointinstances, includingaTouchUp. It is possible to modify thisListand 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
Listcontaining allTLcdTouchPoints this controller should keep tracking. AllTLcdTouchPointinstances contained in thisListmust 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:
-