documentation

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

Class wink.ux.MovementTracker

Implements a Movement Tracker. The Movement Tracker follows the touch movement performed on a node. It listens to touch events and elaborates a movement which consists of points statements sequence. Each point statement includes these informations : a position, a direction, a distance and a duration.

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.MovementTracker(properties)
var mvt = new wink.ux.MovementTracker({ target: wink.byId("nodeId") });
wink.subscribe('/movementtracker/events/mvtbegin', { context: window, method: 'handleMovementBegin' });
wink.subscribe('/movementtracker/events/mvtchanged', { context: window, method: 'handleMovementChanged' });
wink.subscribe('/movementtracker/events/mvtstored', { context: window, method: 'handleMovementStored' });
Parameters:
{object} properties
The properties object
{HTMLElement} properties.target
The target DOM node which must be tracked
{boolean} properties.captureFlow Optional, Default: true
Indicates whether the capture event flow is used
{boolean} properties.preventStart Optional, Default: true
Indicates whether the start event must be prevented
{boolean} properties.preventMove Optional, Default: false
Indicates whether the move event must be prevented
{integer} properties.trackThresholdX Optional, Default: 0
The minimum distance on x-axis before tracking the movement - in pixels
{integer} properties.trackThresholdY Optional, Default: 0
The minimum distance on y-axis before tracking the movement - in pixels
See:
Test page

Field Detail

{integer} uId
Unique identifier

Method Detail

  • destroy()
    Destroys the component
  • updateTrackThresholdX(threshold)
    Updates the tracking threshold on x-axis
    Parameters:
    {integer} threshold
    The threshold to set
  • updateTrackThresholdY(threshold)
    Updates the tracking threshold on y-axis
    Parameters:
    {integer} threshold
    The threshold to set

Event Detail

/movementtracker/events/mvtbegin
The movement begins
Parameters:
{object} param
The parameters object
{wink.ux.MovementTracker} param.publisher
Identifies the movement tracker itself in order, for the caller, to check whether the event relates to it
{object} param.movement
A Movement object
{array} param.movement.pointStatement
an array of "points" : a point is an object which is composed as { x, y, timestamp, duration, globalDuration, dx, dy, globalDx, globalDy, directionX, directionY }
{integer} param.movement.duration
duration is the duration of the movement
{integer} param.movement.dx
dx is the distance on x-axis
{integer} param.movement.dy
dy is the distance on x-axis
{wink.ux.Event} param.uxEvent
The Wink Event that is the cause of the event
{HTMLElement} param.target
The target DOM node tracked
/movementtracker/events/mvtchanged
The movement changes
Parameters:
{object} param
The parameters object
{wink.ux.MovementTracker} param.publisher
Identifies the movement tracker itself in order, for the caller, to check whether the event relates to it
{object} param.movement
A Movement object
{array} param.movement.pointStatement
an array of "points" : a point is an object which is composed as { x, y, timestamp, duration, globalDuration, dx, dy, globalDx, globalDy, directionX, directionY }
{integer} param.movement.duration
duration is the duration of the movement
{integer} param.movement.dx
dx is the distance on x-axis
{integer} param.movement.dy
dy is the distance on x-axis
{wink.ux.Event} param.uxEvent
The Wink Event that is the cause of the event
{HTMLElement} param.target
The target DOM node tracked
/movementtracker/events/mvtstored
The movement stops
Parameters:
{object} param
The parameters object
{wink.ux.MovementTracker} param.publisher
Identifies the movement tracker itself in order, for the caller, to check whether the event relates to it
{object} param.movement
A Movement object
{array} param.movement.pointStatement
an array of "points" : a point is an object which is composed as { x, y, timestamp, duration, globalDuration, dx, dy, globalDx, globalDy, directionX, directionY }
{integer} param.movement.duration
duration is the duration of the movement
{integer} param.movement.dx
dx is the distance on x-axis
{integer} param.movement.dy
dy is the distance on x-axis
{wink.ux.Event} param.uxEvent
The Wink Event that is the cause of the event
{HTMLElement} param.target
The target DOM node tracked
/movementtracker/events/notrack
The touch events of the movement are not currently tracked
Parameters:
{object} param
The parameters object
{wink.ux.MovementTracker} param.publisher
Identifies the movement tracker itself in order, for the caller, to check whether the event relates to it
{wink.ux.Event} param.uxEvent
The Wink Event that is the cause of the event
{HTMLElement} param.target
The target DOM node tracked