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
ConstructorDescriptionALcdGXYConfinedTouchChainableController
(int aNumberOfInputPoints) Create a newALcdGXYConfinedTouchChainableController
for touch input containingaNumberOfInputPoints
touch points.ALcdGXYConfinedTouchChainableController
(int aMinimumNumberOfTouchPoints, int aMaximumNumberOfTouchPoints) Create a newALcdGXYConfinedTouchChainableController
for touch input containing a number of touch points contained in[aMinimumNumberOfTouchPoints, aMaximumNumberOfTouchPoints]
. -
Method Summary
Modifier and TypeMethodDescriptionint
Returns the maximal 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.gxy.controller.touch.ALcdGXYTouchChainableController
getCurrentLocations, getMoveThreshold, getOriginalLocations, getPreviousLocations, getTouchPointIDs, handleAWTEvent, handleEventImpl, paintImpl, setMoveThreshold, touchPointMoved
Methods inherited from class com.luciad.view.gxy.controller.ALcdGXYChainableController
addStatusListener, appendGXYController, getNextGXYController, paint, removeStatusListener, setNextGXYController, startInteraction, startInteractionImpl, terminateInteraction, terminateInteractionImpl
Methods 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, viewRepaint
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.luciad.view.gxy.ILcdGXYController
getCursor, getIcon, getLayered, getName, getShortDescription, viewRepaint
-
Constructor Details
-
ALcdGXYConfinedTouchChainableController
public ALcdGXYConfinedTouchChainableController(int aNumberOfInputPoints) Create a newALcdGXYConfinedTouchChainableController
for touch input containingaNumberOfInputPoints
touch points.- Parameters:
aNumberOfInputPoints
- the number of touch points this controller should handle
-
ALcdGXYConfinedTouchChainableController
public ALcdGXYConfinedTouchChainableController(int aMinimumNumberOfTouchPoints, int aMaximumNumberOfTouchPoints) Create a newALcdGXYConfinedTouchChainableController
for 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:ALcdGXYTouchChainableController
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 classALcdGXYTouchChainableController
- Parameters:
aTouchPoints
- AList
containing all availableTLcdTouchPoint
instances. This list will includeaTouchDown
. Note that some of theseTLcdTouchPoint
s can already be tracked by this controller (seeALcdGXYTouchChainableController.getTouchPointIDs()
). 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:ALcdGXYTouchChainableController
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 allTLcdTouchPoint
s 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
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 classALcdGXYTouchChainableController
- 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 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:
-