yfiles.client.tiles.EditMode
Class EditMode

This class implements a main edit mode for interacting with a graph displayed in a GraphCanvas. The EditMode dispatches some of its tasks to instances of CreateEdgeMode, MoveSelectionMode, RectangularSelectionMode and EditLabelMode, respectively. If the EditMode is activated, it maintains a GraphSelection and connects selecting nodes and edges to highlighting these nodes and edges in the graph canvas. It handles user input by changing the graph possibly through activating one of the above mentioned input modes as child modes. A list of user input gestures and the actions they trigger is given in the comment for activate().

 
All Parent Classes:
InputMode
 
Constructor Summary
EditMode(/*GraphCanvas*/ canvas, /*Boolean?*/ selectNodes, /*Boolean?*/ selectEdges, /*Boolean?*/ routeEdges, /*HierarchyManager?*/ hierarchyManager)
           This class implements a main edit mode for interacting with a graph displayed in a GraphCanvas.
 
Method Summary
  activate()
          activates this input mode.
  clearSelection()
          clears the current selection.
  deactivate()
          deactivates this input mode.
  editLabel(/*String*/ id)
          starts editing a node label.
 Number getEdgeTestSensitivity()
          gets the edge test sensitivity in pixels (view units).
 GraphSelection getSelection()
          returns the current selection.
  setEdgeTestSensitivity(/*Number*/ sensitivity)
          sets the edge test sensitivity in pixels (view units).
 
Constructor Detail

EditMode

EditMode(/*GraphCanvas*/ canvas, /*Boolean?*/ selectNodes, /*Boolean?*/ selectEdges, /*Boolean?*/ routeEdges, /*HierarchyManager?*/ hierarchyManager)
This class implements a main edit mode for interacting with a graph displayed in a GraphCanvas. The EditMode dispatches some of its tasks to instances of CreateEdgeMode, MoveSelectionMode, RectangularSelectionMode and EditLabelMode, respectively. If the EditMode is activated, it maintains a GraphSelection and connects selecting nodes and edges to highlighting these nodes and edges in the graph canvas. It handles user input by changing the graph possibly through activating one of the above mentioned input modes as child modes. A list of user input gestures and the actions they trigger is given in the comment for activate().
Parameters:
canvas - the canvas instance this mode works on
selectNodes - if true, nodes are selectable (default true)
selectEdges - if true, edges are selectable (default true)
routeEdges - if true, newly created edges are roued (default false)
hierarchyManager - optional hierarchy manager for the graph of the canvas
Method Detail

activate

activate()
activates this input mode. The canvas is fix()ed. Certain user gestures trigger changes of the graph or the activation of one of the child input modes which might change the graph in turn. Moreover there is a visual indication, whether the mouse is considered to be over a node or an edge or over empty space.

clearSelection

clearSelection()
clears the current selection.

deactivate

deactivate()
deactivates this input mode. The selection is cleared. The canvas is release()d. The user input as described in activate() is no longer handled.

editLabel

editLabel(/*String*/ id)
starts editing a node label. This method can be used in event handlers for menu entries or buttons.
Parameters:
id - id of a node or a node label

getEdgeTestSensitivity

Number getEdgeTestSensitivity()
gets the edge test sensitivity in pixels (view units).

getSelection

GraphSelection getSelection()
returns the current selection.

setEdgeTestSensitivity

setEdgeTestSensitivity(/*Number*/ sensitivity)
sets the edge test sensitivity in pixels (view units).

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