mxLayoutManager

Implements a layout manager that runs a given layout after any changes to the graph

Example

var layoutMgr = new mxLayoutManager(graph);
layoutMgr.getLayout = function(cell)
{
  return layout;
};
Summary
mxLayoutManager
Events
mxEvent.LAYOUT_CELLSFires between begin- and endUpdate after all cells have been layouted in layoutCells.
Functions
mxLayoutManagerConstructs a new automatic layout for the given graph.
Variables
graphReference to the enclosing mxGraph.
bubblingSpecifies if the layout should bubble along the cell hierarchy.
enabledSpecifies if event handling is enabled.
updateHandlerHolds the function that handles the endUpdate event.
moveHandlerHolds the function that handles the move event.
Functions
isEnabledReturns true if events are handled.
setEnabledEnables or disables event handling.
isBubblingReturns true if a layout should bubble, that is, if the parent layout should be executed whenever a cell layout (layout of the children of a cell) has been executed.
setBubblingSets bubbling.
getGraphReturns the graph that this layout operates on.
setGraphSets the graph that the layouts operate on.
getLayoutReturns the layout to be executed for the given graph and parent.
beforeUndoCalled from the undoHandler.
cellsMovedCalled from the moveHandler.
getCellsForEditReturns the cells to be layouted for the given sequence of changes.
getCellsForChangeExecutes all layouts which have been scheduled during the changes.
layoutCellsExecutes all layouts which have been scheduled during the changes.
executeLayoutExecutes the given layout on the given parent.
destroyRemoves all handlers from the graph and deletes the reference to it.

Events

mxEvent.LAYOUT_CELLS

Fires between begin- and endUpdate after all cells have been layouted in layoutCells.  The <code>cells</code> property contains all cells that have been passed to layoutCells.

Functions

mxLayoutManager

function mxLayoutManager(graph)

Constructs a new automatic layout for the given graph.

Arguments

graphReference to the enclosing graph.

Variables

graph

mxLayoutManager.prototype.graph

Reference to the enclosing mxGraph.

bubbling

mxLayoutManager.prototype.bubbling

Specifies if the layout should bubble along the cell hierarchy.  Default is true.

enabled

mxLayoutManager.prototype.enabled

Specifies if event handling is enabled.  Default is true.

updateHandler

mxLayoutManager.prototype.updateHandler

Holds the function that handles the endUpdate event.

moveHandler

mxLayoutManager.prototype.moveHandler

Holds the function that handles the move event.

Functions

isEnabled

mxLayoutManager.prototype.isEnabled = function()

Returns true if events are handled.  This implementation returns enabled.

setEnabled

mxLayoutManager.prototype.setEnabled = function(enabled)

Enables or disables event handling.  This implementation updates enabled.

Parameters

enabledBoolean that specifies the new enabled state.

isBubbling

mxLayoutManager.prototype.isBubbling = function()

Returns true if a layout should bubble, that is, if the parent layout should be executed whenever a cell layout (layout of the children of a cell) has been executed.  This implementation returns bubbling.

setBubbling

mxLayoutManager.prototype.setBubbling = function(value)

Sets bubbling.

getGraph

mxLayoutManager.prototype.getGraph = function()

Returns the graph that this layout operates on.

setGraph

mxLayoutManager.prototype.setGraph = function(graph)

Sets the graph that the layouts operate on.

getLayout

mxLayoutManager.prototype.getLayout = function(parent)

Returns the layout to be executed for the given graph and parent.

beforeUndo

mxLayoutManager.prototype.beforeUndo = function(undoableEdit)

Called from the undoHandler.

Parameters

cellArray of mxCells that have been moved.
evtMouse event that represents the mousedown.

cellsMoved

mxLayoutManager.prototype.cellsMoved = function(cells,
evt)

Called from the moveHandler.

Parameters

cellArray of mxCells that have been moved.
evtMouse event that represents the mousedown.

getCellsForEdit

Returns the cells to be layouted for the given sequence of changes.

getCellsForChange

mxLayoutManager.prototype.getCellsForChange = function(change)

Executes all layouts which have been scheduled during the changes.

layoutCells

mxLayoutManager.prototype.layoutCells = function(cells)

Executes all layouts which have been scheduled during the changes.

executeLayout

mxLayoutManager.prototype.executeLayout = function(layout,
parent)

Executes the given layout on the given parent.

destroy

mxLayoutManager.prototype.destroy = function()

Removes all handlers from the graph and deletes the reference to it.

mxLayoutManager.prototype.layoutCells = function(cells)
Executes all layouts which have been scheduled during the changes.
function mxLayoutManager(graph)
Constructs a new automatic layout for the given graph.
mxLayoutManager.prototype.graph
Reference to the enclosing mxGraph.
Extends mxEventSource to implement a graph component for the browser.
mxLayoutManager.prototype.bubbling
Specifies if the layout should bubble along the cell hierarchy.
mxLayoutManager.prototype.enabled
Specifies if event handling is enabled.
mxLayoutManager.prototype.updateHandler
Holds the function that handles the endUpdate event.
mxLayoutManager.prototype.moveHandler
Holds the function that handles the move event.
mxLayoutManager.prototype.isEnabled = function()
Returns true if events are handled.
mxLayoutManager.prototype.setEnabled = function(enabled)
Enables or disables event handling.
mxLayoutManager.prototype.isBubbling = function()
Returns true if a layout should bubble, that is, if the parent layout should be executed whenever a cell layout (layout of the children of a cell) has been executed.
mxLayoutManager.prototype.setBubbling = function(value)
Sets bubbling.
mxLayoutManager.prototype.getGraph = function()
Returns the graph that this layout operates on.
mxLayoutManager.prototype.setGraph = function(graph)
Sets the graph that the layouts operate on.
mxLayoutManager.prototype.getLayout = function(parent)
Returns the layout to be executed for the given graph and parent.
mxLayoutManager.prototype.beforeUndo = function(undoableEdit)
Called from the undoHandler.
mxLayoutManager.prototype.cellsMoved = function(cells,
evt)
Called from the moveHandler.
mxLayoutManager.prototype.getCellsForChange = function(change)
Executes all layouts which have been scheduled during the changes.
mxLayoutManager.prototype.executeLayout = function(layout,
parent)
Executes the given layout on the given parent.
mxLayoutManager.prototype.destroy = function()
Removes all handlers from the graph and deletes the reference to it.
Cells are the elements of the graph model.
Close