org.metalev.multitouch.controller
Class MultiTouchController<T>

java.lang.Object
  extended by org.metalev.multitouch.controller.MultiTouchController<T>

public class MultiTouchController<T>
extends Object

A class that simplifies the implementation of multitouch in applications. Subclass this and read the fields here as needed in subclasses.

Author:
Luke Hutchison

Nested Class Summary
static interface MultiTouchController.MultiTouchObjectCanvas<T>
           
static class MultiTouchController.PointInfo
          A class that packages up all MotionEvent information with all derived multitouch information (if available)
static class MultiTouchController.PositionAndScale
          A class that is used to store scroll offsets and scale information for objects that are managed by the multitouch controller
 
Field Summary
static boolean DEBUG
          Generate tons of log entries for debugging
static int MAX_TOUCH_POINTS
          The max number of touch points that can be present on the screen at once
static boolean multiTouchSupported
           
 
Constructor Summary
MultiTouchController(MultiTouchController.MultiTouchObjectCanvas<T> objectCanvas)
          Constructor that sets handleSingleTouchEvents to true
MultiTouchController(MultiTouchController.MultiTouchObjectCanvas<T> objectCanvas, boolean handleSingleTouchEvents)
          Full constructor
 
Method Summary
protected  boolean getHandleSingleTouchEvents()
          Whether to handle single-touch events/drags before multi-touch is initiated or not; if not, they are handled by subclasses.
 boolean isPinching()
          Indicate if we are in the middle of a pinch action or not.
 boolean onTouchEvent(android.view.MotionEvent event)
          Process incoming touch events
protected  void setHandleSingleTouchEvents(boolean handleSingleTouchEvents)
          Whether to handle single-touch events/drags before multi-touch is initiated or not; if not, they are handled by subclasses.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MAX_TOUCH_POINTS

public static final int MAX_TOUCH_POINTS
The max number of touch points that can be present on the screen at once

See Also:
Constant Field Values

DEBUG

public static final boolean DEBUG
Generate tons of log entries for debugging

See Also:
Constant Field Values

multiTouchSupported

public static final boolean multiTouchSupported
Constructor Detail

MultiTouchController

public MultiTouchController(MultiTouchController.MultiTouchObjectCanvas<T> objectCanvas)
Constructor that sets handleSingleTouchEvents to true


MultiTouchController

public MultiTouchController(MultiTouchController.MultiTouchObjectCanvas<T> objectCanvas,
                            boolean handleSingleTouchEvents)
Full constructor

Method Detail

setHandleSingleTouchEvents

protected void setHandleSingleTouchEvents(boolean handleSingleTouchEvents)
Whether to handle single-touch events/drags before multi-touch is initiated or not; if not, they are handled by subclasses. Default: true


getHandleSingleTouchEvents

protected boolean getHandleSingleTouchEvents()
Whether to handle single-touch events/drags before multi-touch is initiated or not; if not, they are handled by subclasses. Default: true


onTouchEvent

public boolean onTouchEvent(android.view.MotionEvent event)
Process incoming touch events


isPinching

public boolean isPinching()
Indicate if we are in the middle of a pinch action or not.



Copyright © 2012. All Rights Reserved.