|
|||||
| SUMMARY: FIELD | CONSTR | METHOD| EVENT | DETAIL: FIELD | CONSTR | METHOD| EVENT | ||||
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, ResizeNodesMode, 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().
| Field Summary | |
|---|---|
Number |
hotSpotSize
the size (width and height) of the hot spots for activating the ResizeNodesMode in pixels, default 10 (read/write) |
String |
nodeType
the type of newly created nodes sent to the server side, default null (read/write) |
| 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. |
|
allowEdgeCreation(/*Boolean*/ flag)
specifies, whether creating edges is allowed (default true). |
|
allowElementRemoval(/*Boolean*/ flag)
specifies, whether deleting nodes and edges is allowed (default true). |
|
allowLabelEditing(/*Boolean*/ flag)
specifies, whether editing labels is allowed (default true). |
|
allowMoveSelection(/*Boolean*/ flag)
specifies, whether moving the selection is allowed (default true). |
|
allowNodeCreation(/*Boolean*/ flag)
specifies, whether creating nodes is allowed (default true). |
|
allowResizeNodes(/*Boolean*/ flag)
specifies, whether resizing the selected nodes is allowed (default true). |
|
clearSelection()
clears the current selection. |
CreateEdgeMode |
createCreateEdgeMode(/*GraphCanvas*/ canvas, /*Boolean*/ routeEdges)
returns an instance of CreateEdgeMode. |
EditLabelMode |
createEditLabelMode(/*GraphCanvas*/ canvas)
returns an instance of EditLabelMode. |
GroupNavigationMode |
createGroupNavigationMode(/*GraphCanvas*/ canvas, /*HierarchyManager*/ hierarchyManager)
returns an instance of GroupNavigationMode. |
MoveSelectionMode |
createMoveSelectionMode(/*GraphCanvas*/ canvas, /*GraphSelection*/ selection, /*HierarchyManager*/ hierarchyManager)
returns an instance of MoveSelectionMode. |
|
createNode(/*Graph*/ graph, /*Number*/ x, /*Number*/ y, /*String*/ nodeType)
creates a new node at the world coordinates (x,y). |
RectangularSelectionMode |
createRectangularSelectionMode(/*GraphCanvas*/ canvas, /*GraphSelection*/ selection, /*HierarchyManager*/ hierarchyManager)
returns an instance of RectangularSelectionMode. |
ResizeNodesMode |
createResizeNodesMode(/*GraphCanvas*/ canvas, /*GraphSelection*/ selection)
returns an instance of ResizeNodesMode. |
|
deactivate()
deactivates this input mode. |
Boolean |
doAllowEdgeCreation()
returns, whether creating edges is allowed. |
Boolean |
doAllowElementRemoval()
returns, whether deleting nodes and edges is allowed. |
Boolean |
doAllowLabelEditing()
returns, whether editing labels is allowed. |
Boolean |
doAllowMoveSelection()
returns, whether moving the selection is allowed. |
Boolean |
doAllowNodeCreation()
returns, whether creating nodes is allowed. |
Boolean |
doAllowResizeNodes()
returns, whether resizing nodes is allowed. |
|
editLabel(/*String*/ id)
starts editing a node label, if label editing is allowed and an edit label mode is set. |
CreateEdgeMode |
getCreateEdgeMode()
returns the create edge mode used by this edit mode. |
Number |
getEdgeTestSensitivity()
gets the edge test sensitivity in pixels (view units). |
EditLabelMode |
getEditLabelMode()
returns the label editing mode used by this edit mode. |
MoveSelectionMode |
getMoveSelectionMode()
returns the move selection mode used by this edit mode. |
ResizeNodesMode |
getResizeNodesMode()
returns the resize nodes mode used by this edit mode. |
GraphSelection |
getSelection()
returns the current selection. |
|
removeElements(/*Graph*/ graph, /*String[]*/ ids)
removes the elements with the given ids from the graph. |
|
setCreateEdgeMode(/*CreateEdgeMode*/ createEdgeMode)
sets the create edge mode used by this edit mode. createdEdgeMode: The new CreateEdgeMode. |
|
setEdgeTestSensitivity(/*Number*/ sensitivity)
sets the edge test sensitivity in pixels (view units). |
|
setEditLabelMode(/*EditLabelMode*/ editLabelMode)
sets the edit label mode used by this edit mode. |
|
setMoveSelectionMode(/*MoveSelectionMode*/ moveSelectionMode)
sets the move selection mode used by this edit mode. |
|
setResizeNodesMode(/*ResizeNodesMode*/ resizeNodesMode)
sets the resize nodes mode used by this edit mode. |
| Field Detail |
|---|
/*Number*/ hotSpotSize
/*String*/ nodeType
| Constructor Detail |
|---|
EditMode(/*GraphCanvas*/ canvas, /*Boolean*/ selectNodes, /*Boolean*/ selectEdges, /*Boolean*/ routeEdges, /*HierarchyManager*/ hierarchyManager)
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()
allowEdgeCreation(/*Boolean*/ flag)
flag - If true then edges can be created.
allowElementRemoval(/*Boolean*/ flag)
flag - If true then nodes and edges can be removed from the graph.
allowLabelEditing(/*Boolean*/ flag)
flag - If true then labels can be edited.
allowMoveSelection(/*Boolean*/ flag)
flag - If true then the selection can be moved.
allowNodeCreation(/*Boolean*/ flag)
flag - If true then nodes can be created.
allowResizeNodes(/*Boolean*/ flag)
flag - If true then nodes can be resized.
clearSelection()
CreateEdgeMode createCreateEdgeMode(/*GraphCanvas*/ canvas, /*Boolean*/ routeEdges)
canvas - The graph canvas.
routeEdges - If true, the newly created edges will be routed; otherwise they wont be.
EditLabelMode createEditLabelMode(/*GraphCanvas*/ canvas)
canvas - The graph canvas.
GroupNavigationMode createGroupNavigationMode(/*GraphCanvas*/ canvas, /*HierarchyManager*/ hierarchyManager)
canvas - The graph canvas.
hierarchyManager - The hierarchy manager associated with the graph.
MoveSelectionMode createMoveSelectionMode(/*GraphCanvas*/ canvas, /*GraphSelection*/ selection, /*HierarchyManager*/ hierarchyManager)
canvas - The graph canvas.
selection - The selection on the graph.
hierarchyManager - The hierarchy manager.
createNode(/*Graph*/ graph, /*Number*/ x, /*Number*/ y, /*String*/ nodeType)
graph - The graph instance.
x - The x coordinate of the new node.
y - The y coordinate of the new node.
nodeType - The type of the new node.
RectangularSelectionMode createRectangularSelectionMode(/*GraphCanvas*/ canvas, /*GraphSelection*/ selection, /*HierarchyManager*/ hierarchyManager)
canvas - The graph canvas.
selection - The selection on the graph.
hierarchyManager - The hierarchy manager.
ResizeNodesMode createResizeNodesMode(/*GraphCanvas*/ canvas, /*GraphSelection*/ selection)
canvas - The graph canvas.
selection - The selection on the graph.
deactivate()
Boolean doAllowEdgeCreation()
Boolean doAllowElementRemoval()
Boolean doAllowLabelEditing()
Boolean doAllowMoveSelection()
Boolean doAllowNodeCreation()
Boolean doAllowResizeNodes()
editLabel(/*String*/ id)
id - id of a node or a node label
CreateEdgeMode getCreateEdgeMode()
Number getEdgeTestSensitivity()
EditLabelMode getEditLabelMode()
MoveSelectionMode getMoveSelectionMode()
ResizeNodesMode getResizeNodesMode()
GraphSelection getSelection()
removeElements(/*Graph*/ graph, /*String[]*/ ids)
graph -
ids -
setCreateEdgeMode(/*CreateEdgeMode*/ createEdgeMode)
CreateEdgeMode.createEdgeMode -
setEdgeTestSensitivity(/*Number*/ sensitivity)
sensitivity -
setEditLabelMode(/*EditLabelMode*/ editLabelMode)
editLabelMode - Thew new EditLabelMode.
setMoveSelectionMode(/*MoveSelectionMode*/ moveSelectionMode)
moveSelectionMode - The new MoveSelectionMode.
setResizeNodesMode(/*ResizeNodesMode*/ resizeNodesMode)
resizeNodesMode - The new ResizeNodesMode.