Class mindmaps.DefaultCanvasView
Extends
mindmaps.CanvasView.
Defined in: CanvasView.js.
Constructor Attributes | Constructor Name and Description |
---|---|
Creates a new DefaultCanvasView.
|
Method Attributes | Method Name and Description |
---|---|
clear()
Clears the drawing area.
|
|
closeNode(node)
Hides all children of a node.
|
|
createFoldButton(node)
Creates the fold button for a node that shows/hides its children.
|
|
createNode(node, $parent, depth)
Inserts a new node including all of its children into the DOM.
|
|
deleteNode(node)
Removes a node from the view and with it all its children and the branch
leading to the parent.
|
|
<inner> |
drawLineCanvas($canvas, depth, offsetX, offsetY, $node, $parent, color)
Draws the line connection (the branch) between two nodes onto the canvas
object.
|
drawMap(map)
Draws the complete map onto the drawing area.
|
|
<inner> |
drawNodeCanvas(node)
Redraws a node's branch to its parent.
|
editNodeCaption(node)
Goes into edit mode for a node.
|
|
Get a reference to the creator tool.
|
|
getLineWidth(depth)
Calculates the width of a branch for a node for the given depth
|
|
highlightNode(node)
Highlights a node to show that it is selected.
|
|
Returns whether a node is currently being dragged.
|
|
<inner> |
Enables dragging of the map with the mouse.
|
openNode(node)
Shows all children of a node.
|
|
positionNode(node)
Moves the node a new position.
|
|
redrawNodeConnectors(node)
Redraws all branches that a node is connected to.
|
|
removeFoldButton(node)
Removes the fold button.
|
|
scaleMap()
Redraws the complete map to adapt to a new zoom factor.
|
|
setNodeText(node, value)
Updates the text caption for a node.
|
|
Stops the current edit mode.
|
|
unhighlightNode(node)
Removes the hightlight of a node.
|
|
updateNode(node)
Does a complete visual update of a node to reflect all of its attributes.
|
- Methods borrowed from class mindmaps.CanvasView:
- $getContainer, $getDrawingArea, applyViewZoom, center, scroll, setDimensions, setZoomFactor
Class Detail
mindmaps.DefaultCanvasView()
Creates a new DefaultCanvasView. This is the reference implementation for
drawing mind maps.
Method Detail
clear()
Clears the drawing area.
closeNode(node)
Hides all children of a node.
- Parameters:
- {mindmaps.Node} node
createFoldButton(node)
Creates the fold button for a node that shows/hides its children.
- Parameters:
- {mindmaps.Node} node
createNode(node, $parent, depth)
Inserts a new node including all of its children into the DOM.
- Parameters:
- {mindmaps.Node} node
- - The model of the node.
- {jQuery} $parent Optional
- - optional jquery parent object the new node is appended to. Usually the parent node. If argument is omitted, the getParent() method of the node is called to resolve the parent.
- {Integer} depth Optional
- - Optional. The depth of the tree relative to the root. If argument is omitted the getDepth() method of the node is called to resolve the depth.
deleteNode(node)
Removes a node from the view and with it all its children and the branch
leading to the parent.
- Parameters:
- {mindmaps.Node} node
<inner>
drawLineCanvas($canvas, depth, offsetX, offsetY, $node, $parent, color)
Draws the line connection (the branch) between two nodes onto the canvas
object.
- Parameters:
- {jQuery} $canvas
- {Integer} depth
- {Number} offsetX
- {Number} offsetY
- {jQuery} $node
- {jQuery} $parent
- {String} color
drawMap(map)
Draws the complete map onto the drawing area. This should only be called
once for a mind map.
- Parameters:
- map
<inner>
drawNodeCanvas(node)
Redraws a node's branch to its parent.
- Parameters:
- {mindmaps.Node} node
editNodeCaption(node)
Goes into edit mode for a node.
- Parameters:
- {mindmaps.Node} node
{Creator}
getCreator()
Get a reference to the creator tool.
- Returns:
- {Creator}
{Number}
getLineWidth(depth)
Calculates the width of a branch for a node for the given depth
- Parameters:
- {Integer} depth
- the depth of the node
- Returns:
- {Number}
highlightNode(node)
Highlights a node to show that it is selected.
- Parameters:
- {mindmaps.Node} node
{Boolean}
isNodeDragging()
Returns whether a node is currently being dragged.
- Returns:
- {Boolean}
<inner>
makeDraggable()
Enables dragging of the map with the mouse.
openNode(node)
Shows all children of a node.
- Parameters:
- {mindmaps.Node} node
positionNode(node)
Moves the node a new position.
- Parameters:
- {mindmaps.Node} node
redrawNodeConnectors(node)
Redraws all branches that a node is connected to.
- Parameters:
- {mindmaps.Node} node
removeFoldButton(node)
Removes the fold button.
- Parameters:
- {mindmaps.Node} node
scaleMap()
Redraws the complete map to adapt to a new zoom factor.
setNodeText(node, value)
Updates the text caption for a node.
- Parameters:
- {mindmaps.Node} node
- {String} value
stopEditNodeCaption()
Stops the current edit mode.
unhighlightNode(node)
Removes the hightlight of a node.
- Parameters:
- {mindmaps.Node} node
updateNode(node)
Does a complete visual update of a node to reflect all of its attributes.
- Parameters:
- {mindmaps.Node} node