Class ALcdGXYConfinedTouchChainableController
- All Implemented Interfaces:
ILcdAWTEventListener,ILcdStatusSource,ILcdGXYChainableController,ILcdGXYController,Serializable
Extension of ALcdGXYTouchChainableController
confining the range of handled touch points based on a minimum and maximum.
This is achieved by implementing the touchPointAvailable(java.util.List, com.luciad.input.touch.TLcdTouchPoint) and touchPointWithdrawn(java.util.List, com.luciad.input.touch.TLcdTouchPoint) 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:
- 10.0
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionALcdGXYConfinedTouchChainableController(int aNumberOfInputPoints) Create a newALcdGXYConfinedTouchChainableControllerfor touch input containingaNumberOfInputPointstouch points.ALcdGXYConfinedTouchChainableController(int aMinimumNumberOfTouchPoints, int aMaximumNumberOfTouchPoints) Create a newALcdGXYConfinedTouchChainableControllerfor touch input containing a number of touch points contained in[aMinimumNumberOfTouchPoints, aMaximumNumberOfTouchPoints]. -
Method Summary
Modifier and TypeMethodDescriptionintReturns the maximal 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.gxy.controller.touch.ALcdGXYTouchChainableController
getCurrentLocations, getMoveThreshold, getOriginalLocations, getPreviousLocations, getTouchPointIDs, handleAWTEvent, handleEventImpl, paintImpl, setMoveThreshold, touchPointMovedMethods inherited from class com.luciad.view.gxy.controller.ALcdGXYChainableController
addStatusListener, appendGXYController, getNextGXYController, paint, removeStatusListener, setNextGXYController, startInteraction, startInteractionImpl, terminateInteraction, terminateInteractionImplMethods inherited from class com.luciad.view.gxy.controller.ALcdGXYController
asGXYController, fireStatusEvent, getCursor, getGXYView, getIcon, getName, getShortDescription, isTraceOn, registerInstance, retrieveGXYViewXYWorldTransformation, setClassTraceOn, setCursor, setGXYView, setIcon, setName, setShortDescription, setTraceOn, viewRepaintMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.luciad.view.gxy.ILcdGXYController
getCursor, getIcon, getLayered, getName, getShortDescription, viewRepaint
-
Constructor Details
-
ALcdGXYConfinedTouchChainableController
public ALcdGXYConfinedTouchChainableController(int aNumberOfInputPoints) Create a newALcdGXYConfinedTouchChainableControllerfor touch input containingaNumberOfInputPointstouch points.- Parameters:
aNumberOfInputPoints- the number of touch points this controller should handle
-
ALcdGXYConfinedTouchChainableController
public ALcdGXYConfinedTouchChainableController(int aMinimumNumberOfTouchPoints, int aMaximumNumberOfTouchPoints) Create a newALcdGXYConfinedTouchChainableControllerfor touch input containing a number of touch points contained in[aMinimumNumberOfTouchPoints, aMaximumNumberOfTouchPoints].- Parameters:
aMinimumNumberOfTouchPoints- the minimum number of touch points this controller should handleaMaximumNumberOfTouchPoints- 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:ALcdGXYTouchChainableControllerThis 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 classALcdGXYTouchChainableController- Parameters:
aTouchPoints- AListcontaining all availableTLcdTouchPointinstances. This list will includeaTouchDown. Note that some of theseTLcdTouchPoints can already be tracked by this controller (seeALcdGXYTouchChainableController.getTouchPointIDs()). 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:ALcdGXYTouchChainableControllerThis methods is called every time a tracked touch point is removed or consumed and allows to react accordingly.
aTouchUpis theTLcdTouchPointwhich has been removed, whileaTouchPointscontains allTLcdTouchPoints this controller is currently tracking (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 classALcdGXYTouchChainableController- 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 inaTouchPoints. May be an emptyList, but notnull. - See Also:
-
getMaximumNumberOfPoints
public int getMaximumNumberOfPoints()Returns the maximal 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:
-