yfiles.client.tiles.MoveViewportInputMode
Class MoveViewportInputMode

An input mode that can be used to grab and drag the viewport of a GraphCanvas using touch or mouse gestures.

The minimum time span between consecutive view point changes in Bitmap Mode can be set using the delay property.

 
All Parent Classes:
InputMode
 
Field Summary
 Number delay
          If the GraphCanvas is in Bitmap Mode, this property determines the minimum time span between consecutive view point changes caused by touch- or mouse move events (in milliseconds). While this influences the perceived smoothness of the move viewport gesture, it reduces the amount of server requests for updated image tiles. The default value is 30.
 
Constructor Summary
MoveViewportInputMode(/*yfiles.client.tiles.canvas.GraphCanvas*/ canvas)
           An input mode that can be used to grab and drag the viewport of a GraphCanvas using touch or mouse gestures.
 
Method Summary
  _finishDrag(/*Event*/ evtOrTouch)
          Stops the view point drag gesture.
  _handleMouseMove(/*Event*/ evt)
          Called when an onmousemove Event is dispatched by the root document containing the graph canvas.
  _handleMove(/*Object*/ evtOrTouch)
          Handles a mouse- or touch move event.
  _handleMoveCore(/*Event*/ evtOrTouch)
          Applies a touch- or mouse move gesture to the canvas viewport.
  _onMouseDown(/*Event*/ evt)
          Called when an onMouseDown event has been dispatched by the graph canvas.
  _onMouseUp(/*Event*/ evt)
          Called when an onmouseup event has been dispatched by the root document containing the graph canvas.
  _onPinchStart(/*Object*/ worldCoords1, /*Object*/ worldCoords2, /*Touch[]*/ pinchTouches)
          Called when a onPinchStart event was dispatched by the graph canvas.
  _onTouchEnd(/*Touch*/ touch, /*Object*/ worldCoords)
          Called when a onTouchEnd event was dispatched by the canvas.
  _onTouchLongPress(/*Touch*/ touch, /*Object*/ worldCoords)
          Called when a _onTouchLongPress event was dispatched by the graph canvas.
  _onTouchStart(/*Touch*/ touch, /*Object*/ worldCoords)
          Called when a onTouchStart event was dispatched by the canvas.
  _startDrag(/*Event*/ evtOrTouch)
          Starts a view point drag gesture initiated by a mouse- or touch event.
  activate()
          Calls the super implementation.
  deactivate()
          Cancels dragging and call the super implementation.
 Boolean isDragging()
          Returns whether mouse/touch move events will currently trigger view point movements.
 
Field Detail

delay

/*Number*/ delay
If the GraphCanvas is in Bitmap Mode, this property determines the minimum time span between consecutive view point changes caused by touch- or mouse move events (in milliseconds). While this influences the perceived smoothness of the move viewport gesture, it reduces the amount of server requests for updated image tiles. The default value is 30.
 
Constructor Detail

MoveViewportInputMode

MoveViewportInputMode(/*yfiles.client.tiles.canvas.GraphCanvas*/ canvas)
An input mode that can be used to grab and drag the viewport of a GraphCanvas using touch or mouse gestures.
The minimum time span between consecutive view point changes in Bitmap Mode can be set using the delay property.
Parameters:
canvas - The canvas whose view point should be moved by this input mode.
Method Detail

_finishDrag

_finishDrag(/*Event*/ evtOrTouch)
Stops the view point drag gesture.
The drag gesture is started only if the canvas has not been fixed using the GraphCanvas.fixed property.
Parameters:
evtOrTouch - The touch instance or mouse event that ended the drag gesture.

_handleMouseMove

_handleMouseMove(/*Event*/ evt)
Called when an onmousemove Event is dispatched by the root document containing the graph canvas.
On some iOS 5 devices, this mouse event is always generated in addition to the touch event. Therefore, as a workaround, this implementation only calls _handleMove, if the user agent does not report an iPhone, iPod, or iPad device.
Parameters:
evt - The mouse event

_handleMove

_handleMove(/*Object*/ evtOrTouch)
Handles a mouse- or touch move event.
Delegates to _handleMoveCore, after taking the delay property into account.
Parameters:
evtOrTouch - The touch instance or mouse event that specifies the coordinates of the move event.

_handleMoveCore

_handleMoveCore(/*Event*/ evtOrTouch)
Applies a touch- or mouse move gesture to the canvas viewport.
Before the new view point is applied, the canvas' viewportLimiter is used to limit the resulting viewport.
Parameters:
evtOrTouch - The touch instance or mouse event that specifies the coordinates of the move event.

_onMouseDown

_onMouseDown(/*Event*/ evt)
Called when an onMouseDown event has been dispatched by the graph canvas.
Initiates a viewport drag gesture.
Parameters:
evt - The mouse event

_onMouseUp

_onMouseUp(/*Event*/ evt)
Called when an onmouseup event has been dispatched by the root document containing the graph canvas.
Initiates a viewport drag gesture.
Parameters:
evt - The mouse event.

_onPinchStart

_onPinchStart(/*Object*/ worldCoords1, /*Object*/ worldCoords2, /*Touch[]*/ pinchTouches)
Called when a onPinchStart event was dispatched by the graph canvas.
Cancels the current viewport drag. If this input mode is a child of another input mode, this input mode is deactivated, and _onPinchStart is called on the parent input mode.
Parameters:
worldCoords1 - An object with x and y properties specifying the world coordinates of the first touch of the pinch gesture.
worldCoords2 - An object with x and y properties specifying the world coordinates of the second touch of the pinch gesture.
pinchTouches - An array containing the two touches of the pinch gesture.

_onTouchEnd

_onTouchEnd(/*Touch*/ touch, /*Object*/ worldCoords)
Called when a onTouchEnd event was dispatched by the canvas.
If this input mode is a child of another input mode, this input mode is deactivated, and _onTouchEnd is called on the parent input mode.
Parameters:
touch - The touch instance of the touch event that has just ended.
worldCoords - The world coordinates of the touch event.

_onTouchLongPress

_onTouchLongPress(/*Touch*/ touch, /*Object*/ worldCoords)
Called when a _onTouchLongPress event was dispatched by the graph canvas.
If this input mode is a child of another input mode, this input mode is deactivated, and _onTouchLongPress is called on the parent input mode.
Parameters:
touch - The touch instance of the touch event that has just started
worldCoords - The world coordinates of the touch event.

_onTouchStart

_onTouchStart(/*Touch*/ touch, /*Object*/ worldCoords)
Called when a onTouchStart event was dispatched by the canvas.
Parameters:
touch - The touch instance of the touch event that has just started
worldCoords - The world coordinates of the touch event.

_startDrag

_startDrag(/*Event*/ evtOrTouch)
Starts a view point drag gesture initiated by a mouse- or touch event.
The drag gesture is started only if the canvas has not been fixed using the GraphCanvas.fixed property.
Parameters:
evtOrTouch - The touch instance or mouse event that started the drag gesture.

activate

activate()
Calls the super implementation.

deactivate

deactivate()
Cancels dragging and call the super implementation.

isDragging

Boolean isDragging()
Returns whether mouse/touch move events will currently trigger view point movements.

Copyright © 2006-2011 yWorks GmbH. All rights reserved.