Class ALcdGXYConfinedTouchChainableController

All Implemented Interfaces:
ILcdAWTEventListener, ILcdStatusSource, ILcdGXYChainableController, ILcdGXYController, Serializable

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:

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

    • ALcdGXYConfinedTouchChainableController

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

      public ALcdGXYConfinedTouchChainableController(int aMinimumNumberOfTouchPoints, int aMaximumNumberOfTouchPoints)
      Create a new ALcdGXYConfinedTouchChainableController for touch input containing a number of touch points contained in [aMinimumNumberOfTouchPoints, aMaximumNumberOfTouchPoints].
      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: 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 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 ALcdGXYTouchChainableController
      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 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.
      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: 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 TLcdTouchPoints 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.

      Specified by:
      touchPointWithdrawn in class ALcdGXYTouchChainableController
      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 aTouchPoints. May be an empty List, but not null.
      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: