# Class TwoPointGesture

java.lang.Object
org.jmol.multitouch.sparshui.TwoPointGesture

All Implemented Interfaces:
  `Gesture`

public class TwoPointGesture extends Object implements Gesture
TWO_POINT_GESTURE This gesture requires two points of contact, but its type is not initially defined. Instead, its type is determined on-the-fly to be one of ZOOM, ROTATE, or 2-point DRAG based on the direction of motion and relative positions of the starting points. Two traces are obtained, assuming nothing about the ID of the incoming points from the input device but instead operating from position on the screen. v00 from pt(1,0) to pt(2,0) ZOOM IN: invalid input: '<'---- x -----> (at any angle) ZOOM OUT: ----> x invalid input: '<'----- (at any angle) ROTATE CW: ^ | | x | (at any angle, not implemented) | V ROTATE CCW: | ^ | x | (at any angle, not implemented) V | 2-point drag: ---------> x (any direction) ---------> Bob Hanson 12/13/2009

## Field Summary

Fields
Modifier and Type
Field
Description
`protected Location`
`_offset`
`protected Location`
`_offsetCentroid`

## Constructor Summary

Constructors
Constructor
Description
`TwoPointGesture()`

## Method Summary

Modifier and Type
Method
Description
`int`
`getGestureType()`
Get the integer value of this gesture type.
`String`
`getName()`
Get the name of this gesture.
`protected List<Event>`
`processBirth(TouchPoint touchPoint)`
`List<Event>`
`processChange(List<TouchPoint> touchPoints, TouchPoint changedPoint)`
Process a touch point change in the gesture.
`protected List<Event>`
`processDeath(TouchPoint touchPoint)`
`protected List<Event>`
`processMove(TouchPoint touchPoint)`

### Methods inherited from class Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### _offset

protected Location _offset

### _offsetCentroid

protected Location _offsetCentroid

## Constructor Details

### TwoPointGesture

public TwoPointGesture()

## Method Details

### getName

public String getName()
Description copied from interface: `Gesture`
Get the name of this gesture.

Specified by:
  `getName` in interface `Gesture`
Returns:
  The name of this gesture.

### getGestureType

public int getGestureType()
Description copied from interface: `Gesture`
Get the integer value of this gesture type. Gesture values are defined in GestureType.java.

Specified by:
  `getGestureType` in interface `Gesture`
Returns:
  The gesture type.

### processChange

public List<Event> processChange(List<TouchPoint> touchPoints, TouchPoint changedPoint)
Description copied from interface: `Gesture`
Process a touch point change in the gesture.

Specified by:
  `processChange` in interface `Gesture`
Parameters:
  `touchPoints` - The list of touch points that currently belong to this gesture.
  `changedPoint` - The touch point that has changed.
Returns:
  An ArrayList of events that will be delivered to the client.

### processBirth

protected List<Event> processBirth(TouchPoint touchPoint)

### processDeath

protected List<Event> processDeath(TouchPoint touchPoint)

### processMove

protected List<Event> processMove(TouchPoint touchPoint)