yfiles.client.tiles.NavigationInputMode
Class NavigationInputMode

This input mode adds navigation support to a graph canvas. It enables panning and zooming through mouse and touch interaction.

The MoveViewportInputMode and PinchInputMode are used as child modes in order to provide panning and zooming functionality.

 
All Parent Classes:
InputMode
 
Field Summary
 Object moveViewportMode
          The input mode used as a child mode to enable touch-based panning.
 Object pinchMode
          The input mode used as a child mode to enable zoom-to-point functionality through pinch gestures.
 
Constructor Summary
NavigationInputMode(/*GraphCanvas*/ canvas)
           This input mode adds navigation support to a graph canvas. It enables panning and zooming through mouse and touch interaction.
 
Method Summary
  _onPinchEnd(/*Object*/ worldCoords1, /*Object*/ worldCoords2, /*Touch[]*/ pinchTouches)
          Called when a pinch gesture has ended.
  _onPinchStart(/*Object*/ worldCoords1, /*Object*/ worldCoords2, /*Touch[]*/ pinchTouches)
          Called when a pinch gesture has started.
  _onTouchEnd(/*Touch*/ touch, /*Object*/ worldCoords)
          Called when a touch gesture has ended.
  _onTouchLongPress(/*Touch*/ touch, /*Object*/ worldCoords)
          Called when a long press gesture occurred.
  _onTouchStart(/*Touch*/ touch, /*Object*/ worldCoords)
          Called when a touch gesture has started.
  activate()
          Activates this input mode.
 MoveViewportInputMode createMoveViewportInputMode()
          Creates the MoveViewportInputMode that is used as a child input mode to enable viewport movement.
 PinchInputMode createPinchInputMode()
          Creates the PinchInputMode that is used as a child input mode to enable zoom functionality.
  deactivate()
          Deactivates this input mode.
 
Field Detail

moveViewportMode

/*Object*/ moveViewportMode
The input mode used as a child mode to enable touch-based panning.

pinchMode

/*Object*/ pinchMode
The input mode used as a child mode to enable zoom-to-point functionality through pinch gestures.
 
Constructor Detail

NavigationInputMode

NavigationInputMode(/*GraphCanvas*/ canvas)
This input mode adds navigation support to a graph canvas. It enables panning and zooming through mouse and touch interaction.
The MoveViewportInputMode and PinchInputMode are used as child modes in order to provide panning and zooming functionality.
Parameters:
canvas -
Method Detail

_onPinchEnd

_onPinchEnd(/*Object*/ worldCoords1, /*Object*/ worldCoords2, /*Touch[]*/ pinchTouches)
Called when a pinch gesture has ended.
If this input mode has a parent input mode, it is deactivated, and _onPinchEnd 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.

_onPinchStart

_onPinchStart(/*Object*/ worldCoords1, /*Object*/ worldCoords2, /*Touch[]*/ pinchTouches)
Called when a pinch gesture has started.
This method has to be called by an active child input mode when a pinch gesture starts in order to activate the pinch 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 touch gesture has ended.
Deactivates this input mode, and delegates to the parent input mode, if available.
Parameters:
touch - The touch that ended
worldCoords - An object with x and y properties specifying the world coordinates of the touch.

_onTouchLongPress

_onTouchLongPress(/*Touch*/ touch, /*Object*/ worldCoords)
Called when a long press gesture occurred.
If this input mode has a parent input mode, it is deactivated, and onTouchLongPress is called on the parent input mode.
Parameters:
touch - The touch that was "long pressed"
worldCoords - An object with x and y properties specifying the world coordinates of the touch.

_onTouchStart

_onTouchStart(/*Touch*/ touch, /*Object*/ worldCoords)
Called when a touch gesture has started.
Delegates to the child MoveViewportInputMode.
Parameters:
touch - The touch that started
worldCoords - An object with x and y properties specifying the world coordinates of the touch.

activate

activate()
Activates this input mode.
This implementation just delegates to the super implementation.

createMoveViewportInputMode

MoveViewportInputMode createMoveViewportInputMode()
Creates the MoveViewportInputMode that is used as a child input mode to enable viewport movement.

createPinchInputMode

PinchInputMode createPinchInputMode()
Creates the PinchInputMode that is used as a child input mode to enable zoom functionality.

deactivate

deactivate()
Deactivates this input mode.
This implementation just delegates to the super implementation.

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