Home Reference Source Test
import Gesture from 'zingtouch/src/gestures/Gesture.js'
public class | source

Gesture

Direct Subclass:

Distance, Pan, Rotate, Swipe, Tap

Indirect Subclass:

Expand, Pinch

The Gesture class that all gestures inherit from.

Test:

Constructor Summary

Public Constructor
public

Constructor function for the Gesture class.

Member Summary

Public Members
public

The unique identifier for each gesture determined at bind time by the state object.

public

The generic string type of gesture ('expand'|'pan'|'pinch'|'rotate'|'swipe'|'tap').

Method Summary

Public Methods
public

end(inputs: Array): null | Object

end() - Event hook for the move of a gesture

public

Return the id of the event.

public

getType() - Returns the generic type of the gesture

public

move(inputs: Array, state: Object): null | Object

move() - Event hook for the move of a gesture

public

setId(id: String)

Set the id of the gesture to be called during an event

public

setType(type: String)

Set the type of the gesture to be called during an event

public

start(inputs: Array): null | Object

start() - Event hook for the start of a gesture

public

update(object: *)

Updates internal properties with new ones, only if the properties exist.

Public Constructors

public constructor source

Constructor function for the Gesture class.

Public Members

public id: String | null source

The unique identifier for each gesture determined at bind time by the state object. This allows for distinctions across instance variables of Gestures that are created on the fly (e.g. Tap-1, Tap-2, etc).

public type: String source

The generic string type of gesture ('expand'|'pan'|'pinch'|'rotate'|'swipe'|'tap').

Public Methods

public end(inputs: Array): null | Object source

end() - Event hook for the move of a gesture

Params:

NameTypeAttributeDescription
inputs Array

The array of Inputs on the screen

Return:

null | Object

Default of null

public getId(): String source

Return the id of the event. If the id does not exist, return the type.

Return:

String

public getType(): String source

getType() - Returns the generic type of the gesture

Return:

String

The type of gesture

Test:

public move(inputs: Array, state: Object): null | Object source

move() - Event hook for the move of a gesture

Params:

NameTypeAttributeDescription
inputs Array

The array of Inputs on the screen

state Object

The state object of the current region.

Return:

null | Object

Default of null

public setId(id: String) source

Set the id of the gesture to be called during an event

Params:

NameTypeAttributeDescription
id String

The unique identifier of the gesture being created.

public setType(type: String) source

Set the type of the gesture to be called during an event

Params:

NameTypeAttributeDescription
type String

The unique identifier of the gesture being created.

public start(inputs: Array): null | Object source

start() - Event hook for the start of a gesture

Params:

NameTypeAttributeDescription
inputs Array

The array of Inputs on the screen

Return:

null | Object

Default of null

public update(object: *) source

Updates internal properties with new ones, only if the properties exist.

Params:

NameTypeAttributeDescription
object *