public abstract class ALcdGXYConfinedTouchChainableController extends ALcdGXYTouchChainableController
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:
Constructor and Description |
---|
ALcdGXYConfinedTouchChainableController(int aNumberOfInputPoints)
Create a new
ALcdGXYConfinedTouchChainableController for touch input containing
aNumberOfInputPoints touch points. |
ALcdGXYConfinedTouchChainableController(int aMinimumNumberOfTouchPoints,
int aMaximumNumberOfTouchPoints)
Create a new
ALcdGXYConfinedTouchChainableController for touch input containing a
number of touch points contained in [aMinimumNumberOfTouchPoints,
aMaximumNumberOfTouchPoints] . |
Modifier and Type | Method and Description |
---|---|
int |
getMaximumNumberOfPoints()
Returns the maximal number of touch points this controller should handle, as specified in
the constructor.
|
int |
getMinimumNumberOfPoints()
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.
|
getCurrentLocations, getMoveThreshold, getOriginalLocations, getPreviousLocations, getTouchPointIDs, handleAWTEvent, handleEventImpl, paintImpl, setMoveThreshold, touchPointMoved
addStatusListener, appendGXYController, getNextGXYController, paint, removeStatusListener, setNextGXYController, startInteraction, startInteractionImpl, terminateInteraction, terminateInteractionImpl
asGXYController, fireStatusEvent, getCursor, getGXYView, getIcon, getName, getShortDescription, isTraceOn, registerInstance, retrieveGXYViewXYWorldTransformation, setClassTraceOn, setCursor, setGXYView, setIcon, setName, setShortDescription, setTraceOn, viewRepaint
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getCursor, getIcon, getLayered, getName, getShortDescription, viewRepaint
public ALcdGXYConfinedTouchChainableController(int aNumberOfInputPoints)
ALcdGXYConfinedTouchChainableController
for touch input containing
aNumberOfInputPoints
touch points.aNumberOfInputPoints
- the number of touch points this controller should handlepublic ALcdGXYConfinedTouchChainableController(int aMinimumNumberOfTouchPoints, int aMaximumNumberOfTouchPoints)
ALcdGXYConfinedTouchChainableController
for touch input containing a
number of touch points contained in [aMinimumNumberOfTouchPoints,
aMaximumNumberOfTouchPoints]
.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 to aMinimumNumberOfTouchPoints
protected List<TLcdTouchPoint> touchPointAvailable(List<TLcdTouchPoint> aTouchPoints, TLcdTouchPoint aTouchDown)
ALcdGXYTouchChainableController
This method is called every time a new touch point is created or becomes available and allows to react accordingly.
aTouchDown
is the TLcdTouchPoint
which has been created, while
aTouchPoints
contains all available TLcdTouchPoint
s (including
aTouchDown
). 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 a TLcdTouchPoint
which is currently
tracked is omitted from the List
, that touch point will be made available to the
rest of the chain as explained in the class javadoc.
touchPointAvailable
in class ALcdGXYTouchChainableController
aTouchPoints
- A List
containing all available TLcdTouchPoint
instances. This list will include aTouchDown
. Note that some
of these TLcdTouchPoint
s can already be tracked by this
controller (see ALcdGXYTouchChainableController.getTouchPointIDs()
). It is possible to modify this
List
and return it instead of creating a new
List
.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 in aTouchPoints
.List
containing all TLcdTouchPoint
instances which should
be tracked by this controller. All TLcdTouchPoint
instances contained in
this List
must be contained in aTouchPoints
. May be an
empty List
, but not null
.protected List<TLcdTouchPoint> touchPointWithdrawn(List<TLcdTouchPoint> aTouchPoints, TLcdTouchPoint aTouchUp)
ALcdGXYTouchChainableController
This methods is called every time a tracked touch point is removed or consumed and allows to react accordingly.
aTouchUp
is the TLcdTouchPoint
which has been removed, while
aTouchPoints
contains all TLcdTouchPoint
s this controller is
currently tracking (including aTouchUp
). 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 all
TLcdTouchPoint
instances which should be tracked by this controller. If a
TLcdTouchPoint
which is currently tracked is omitted from the List
,
that touch point will be made available to the rest of the chain as explained in the class
javadoc.
touchPointWithdrawn
in class ALcdGXYTouchChainableController
aTouchPoints
- A List
containing all available TLcdTouchPoint
instances, including aTouchUp
. It is possible to modify this
List
and return it instead of creating a new List
.aTouchUp
- The touch point which has been removed. The state of the descriptor
will always be UP. Note that this descriptor is included in aTouchPoints
.List
containing all TLcdTouchPoint
s this controller should
keep tracking. All TLcdTouchPoint
instances contained in this
List
must be contained in aTouchPoints
. May be an
empty List
, but not null
.ALcdGXYTouchChainableController.handleAWTEvent(java.awt.AWTEvent)
public int getMaximumNumberOfPoints()
Returns the maximal number of touch points this controller should handle, as specified in the constructor.
getMinimumNumberOfPoints()
public int getMinimumNumberOfPoints()
Returns the minimum number of touch points this controller should handle, as specified in the constructor.
getMaximumNumberOfPoints()