documentation

Documentation generator: JsDoc Toolkit 2.4.0
Template: Wink 1.0
Generated on:

Class wink.ux.GestureRecognizer

Implements a 2D Gesture recognition engine. Gesture recognition engine based on the $1 gesture recognition algorithm (Wobbrock, J.O., Wilson, A.D. and Li, Y. (2007). Gestures without libraries, toolkits or training: A $1 recognizer for user interface prototypes. Proceedings of the ACM Symposium on User Interface Software and Technology (UIST '07). Newport, Rhode Island (October 7-10, 2007). New York: ACM Press, pp. 159-168.). The user can define its own recognition templates (a template generator has been included in the test directory that will allow you to generate the templates from a mobile device)

Class Summary
Constructor Attributes Constructor Name and Description
 
Compatibility
Compatibility list Supported platforms / browsers
iOS2, iOS3, iOS4, iOS5, iOS6, Android 1.5, Android 2.1, Android 2.2, Android 2.3, Android 3.0, Android 3.1, Android 4.0, BlackBerry 6, BlackBerry 7, Bada 1.0, Windows Phone 8

Method Summary

Class Detail

wink.ux.GestureRecognizer(properties)
var t0 = {'name': '0', 'points': new Array({x: 127, y: 141}, ...)};
var t1 = {'name': '1', 'points': new Array({x: -125.03325130002096, y: 4.547473508864641e-12}, ...)};
var t2 = {'name': '1', 'points': new Array({x: -125.48142255953155, y: 5.4569682106375694e-12}, ...)};
var t3 = {'name': '2', 'points': new Array({x: -40.80771885140598, y: -2.842170943040401e-14}, ...)};
var t4 = {'name': '2', 'points': new Array({x: -61.758600043770485, y: 0}, ...)};
var t5 = {'name': '2', 'points': new Array({x: -130.42334210005822, y: 0}, ...)};
var t6 = {'name': '3', 'points': new Array({x: -137.37766990687157, y: -5.684341886080802e-14}, ...)};
var t7 = {'name': '3', 'points': new Array({x: -136.45115105405623, y: 0}, ...)};

var properties = 
{
	'node': document,
	'templates': [t0, t1, t2, t3, t4, t5, t6, t7],
	'gestureStartCallback': 
	{
		'method': 'start',
		'context': null
	},
	'gestureCallback': 
	{
		'method': 'move',
		'context': null
	},
	'gestureEndCallback': 
	{
		'method': 'end',
		'context': null
	}
};

recognizer = new wink.ux.GestureRecognizer(properties);
Parameters:
{object} properties
The properties object
{HTMLElement} properties.node
The dom node on which you want to listen for the recognition
{array} properties.templates
An array of objects. Each object contains the 'name' of the template and an array of 'points' describing the template
{object|function} properties.gestureStartCallback
A callback object containing a 'method' name and the 'context' of this method. This callback will be called when the user start touching the 'node' specified earlier
{object|function} properties.gestureCallback
A callback object containing a 'method' name and the 'context' of this method. This callback will be called when the user touches the 'node' specified earlier
{object|function} properties.gestureEndCallback
A callback object containing a 'method' name and the 'context' of this method. This callback will be called when the user stop touching the 'node' specified earlier
See:
Test page

Field Detail

{integer} uId
Unique identifier
{object} utils
Set of mathematic functions used by the Gesture recognition algorithm

Method Detail

  • {HTMLElement} getDomNode()
    the DOM node where to listen to for the gesture recognition
    Returns:
    {HTMLElement} The dom node

Event Detail

/gesturerecognizer/events/result
This event is fired when the recognition is done
Parameters:
{object} param
The parameters object
{string} param.result
the name of the template which has been recognized
{float} param.score
The recognition score rate (from 0 to 1)