yfiles/client/tiles/InputMode
Class InputMode

This is a base class for chainable controllers handling user input to a GraphCanvas.

 
All Parent Classes:
dojo/Evented
 
Constructor Summary
InputMode(yfiles/client/tiles/widget/GraphCanvas canvas)
           

This is a base class for chainable controllers handling user input to a GraphCanvas.

 
Method Summary
  activate()           

activates this input mode.

  deactivate()           

deactivates this input mode and any descendant input mode.

 yfiles/client/tiles/Graph getGraph()           

returns the graph of the graph canvas for this input mode.

 undefined isActive()           

returns true, if this input mode or a descendant input mode is active.

  onActivated()           

callback that is invoked when this input mode is actived.

  onDeactivated()           

callback that is invoked when this input is deactivated.

  onReactivate(yfiles/client/tiles/InputMode child)           

is called after this mode was reactivated.

  restoreCursor()           

restores the cursor for the graph canvas (see setCursor()).

 Boolean setChild(yfiles/client/tiles/InputMode another)           

adds another InputMode as a child of this InputMode, if this InputMode is active.

  setCursor(String cursor, String oldCursor)           

sets the cursor for the graph canvas to the give style (e.g., "pointer").

  setEdgeTestSensitivity(Number sensitivity)           

sets the edge test sensitivity in world units for the hit test belonging to this input mode.

 
Constructor Detail

InputMode

InputMode(yfiles/client/tiles/widget/GraphCanvas canvas)

This is a base class for chainable controllers handling user input to a GraphCanvas.

Parameters:
canvas -
Method Detail

activate

 activate()

activates this input mode.

All descendant input modes are deactivated and unchained. This method calls _attachEventListeners(). If this function is rewritten in subclasses, the super function has to be called.


deactivate

 deactivate()

deactivates this input mode and any descendant input mode.

This function calls _detachEventListeners(). If this function is rewritten in subclasses, the super function has to be called.


getGraph

yfiles/client/tiles/Graph getGraph()

returns the graph of the graph canvas for this input mode.


isActive

undefined isActive()

returns true, if this input mode or a descendant input mode is active.


onActivated

 onActivated()

callback that is invoked when this input mode is actived.


onDeactivated

 onDeactivated()

callback that is invoked when this input is deactivated.


onReactivate

 onReactivate(yfiles/client/tiles/InputMode child)

is called after this mode was reactivated.

The child input mode was activated via setChild before. When it was deactivated, this input was reactivated and this callback is invoked. The default implementation does nothing. It can be overridden in subclasses or used as an event to connect to.

Parameters:
child -

The child input mode that was deactivated.


restoreCursor

 restoreCursor()

restores the cursor for the graph canvas (see setCursor()).


setChild

Boolean setChild(yfiles/client/tiles/InputMode another)

adds another InputMode as a child of this InputMode, if this InputMode is active.

This InputMode detaches its event handlers, and the child input mode gets activated. Once the child input mode is deactivated, this InputMode attaches its event handlers and becomes active again.

Parameters:
another -

Another input mode that should be set as a child of this input mode.


setCursor

 setCursor(String cursor, String oldCursor)

sets the cursor for the graph canvas to the give style (e.g., "pointer").

If oldCursor is given, it will be used in restoreCursor().

Parameters:
cursor -

The new cursor that should be used.

oldCursor -

The optional old cursor that should be used in restoreCursor.


setEdgeTestSensitivity

 setEdgeTestSensitivity(Number sensitivity)

sets the edge test sensitivity in world units for the hit test belonging to this input mode.

Parameters:
sensitivity -

The new edge test sensitivity in world coordinates.


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