public abstract class ALspConfinedTouchController extends ALspTouchController
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:
Constructor and Description |
---|
ALspConfinedTouchController(int aNumberOfInputPoints)
Creates a new
ALspConfinedTouchController for touch input containing
aNumberOfInputPoints touch points. |
ALspConfinedTouchController(int aMinimumNumberOfTouchPoints,
int aMaximumNumberOfTouchPoints)
Creates a new
ALspConfinedTouchController for touch input containing a
number of touch points contained in [aMinimumNumberOfTouchPoints,
aMaximumNumberOTouchPoints] . |
Modifier and Type | Method and Description |
---|---|
int |
getMaximumNumberOfPoints()
Returns the maximum 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, handleAWTEventImpl, handleEventImpl, handleFXEvent, isDrawTouchPoints, paintImpl, setDrawTouchPoints, setMoveThreshold, touchPointMoved
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
public ALspConfinedTouchController(int aNumberOfInputPoints)
ALspConfinedTouchController
for touch input containing
aNumberOfInputPoints
touch points.aNumberOfInputPoints
- the number of touch points this controller should handlepublic ALspConfinedTouchController(int aMinimumNumberOfTouchPoints, int aMaximumNumberOfTouchPoints)
ALspConfinedTouchController
for touch input containing a
number of touch points contained in [aMinimumNumberOfTouchPoints,
aMaximumNumberOTouchPoints]
.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 to aMinimumNumberOfTouchPoints
protected List<TLcdTouchPoint> touchPointAvailable(List<TLcdTouchPoint> aTouchPoints, TLcdTouchPoint aTouchDown)
ALspTouchController
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 ALspTouchController
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 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)
ALspTouchController
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 available TLcdTouchPoint
s (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 ALspTouchController
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 aTrackedTouchPoints
. May be an
empty List
, but not null
.ALspTouchController.handleAWTEvent(java.awt.AWTEvent)
public int getMaximumNumberOfPoints()
Returns the maximum 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()