Class ALspConfinedTouchController

All Implemented Interfaces:
ILcdAWTEventListener, ILspController
Direct Known Subclasses:
TLspTouchAndHoldActionController, TLspTouchNavigateController

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:

  • 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 Details

    • ALspConfinedTouchController

      public ALspConfinedTouchController(int aNumberOfInputPoints)
      Creates a new ALspConfinedTouchController for touch input containing aNumberOfInputPoints touch points.
      Parameters:
      aNumberOfInputPoints - the number of touch points this controller should handle
    • ALspConfinedTouchController

      public ALspConfinedTouchController(int aMinimumNumberOfTouchPoints, int aMaximumNumberOfTouchPoints)
      Creates a new ALspConfinedTouchController for 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 to aMinimumNumberOfTouchPoints
  • Method Details

    • touchPointAvailable

      protected List<TLcdTouchPoint> touchPointAvailable(List<TLcdTouchPoint> aTouchPoints, TLcdTouchPoint aTouchDown)
      Description copied from class: 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 TLcdTouchPoints (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.

      Specified by:
      touchPointAvailable in class ALspTouchController
      Parameters:
      aTouchPoints - A List containing all available TLcdTouchPoint instances. This list will include aTouchDown. Note that some of these TLcdTouchPoints 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.
      Returns:
      a 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.
    • touchPointWithdrawn

      protected List<TLcdTouchPoint> touchPointWithdrawn(List<TLcdTouchPoint> aTouchPoints, TLcdTouchPoint aTouchUp)
      Description copied from class: 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 TLcdTouchPoints (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.

      Specified by:
      touchPointWithdrawn in class ALspTouchController
      Parameters:
      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.
      Returns:
      a List containing all TLcdTouchPoints 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.
      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: