var layoutMgr = new mxLayoutManager(graph); layoutMgr.getLayout = function(cell, eventName) { return layout; };
See getLayout for a description of the possible eventNames.
mxLayoutManager | |
Events | |
mxEvent. | Fires between begin- and endUpdate after all cells have been layouted in layoutCells. |
Functions | |
mxLayoutManager | Constructs a new automatic layout for the given graph. |
Variables | |
graph | Reference to the enclosing mxGraph. |
bubbling | Specifies if the layout should bubble along the cell hierarchy. |
enabled | Specifies if event handling is enabled. |
undoHandler | Holds the function that handles the endUpdate event. |
moveHandler | Holds the function that handles the move event. |
resizeHandler | Holds the function that handles the resize event. |
Functions | |
isEnabled | Returns true if events are handled. |
setEnabled | Enables or disables event handling. |
isBubbling | 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. |
setBubbling | Sets bubbling. |
getGraph | Returns the graph that this layout operates on. |
setGraph | Sets the graph that the layouts operate on. |
hasLayout | Returns true if the given cell has a layout. |
getLayout | Returns the layout for the given cell and eventName. |
beforeUndo | Called from undoHandler. |
cellsMoved | Called from moveHandler. |
cellsResized | Called from resizeHandler. |
getCellsForChanges | Returns the cells for which a layout should be executed. |
getCellsForChange | Executes all layouts which have been scheduled during the changes. |
addCellsWithLayout | Adds all ancestors of the given cell that have a layout. |
addAncestorsWithLayout | Adds all ancestors of the given cell that have a layout. |
addDescendantsWithLayout | Adds all descendants of the given cell that have a layout. |
executeLayoutForCells | Executes all layouts for the given cells in two phases: In the first phase layouts for child cells are executed before layouts for parent cells with mxEvent.BEGIN_UPDATE, in the second phase layouts for parent cells are executed before layouts for child cells with mxEvent.END_UPDATE. |
layoutCells | Executes all layouts which have been scheduled during the changes. |
executeLayout | Executes the given layout on the given parent. |
destroy | Removes all handlers from the graph and deletes the reference to it. |
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.
mxLayoutManager.prototype.graph
Reference to the enclosing mxGraph.
mxLayoutManager.prototype.isEnabled = function()
Returns true if events are handled. This implementation returns enabled.
mxLayoutManager.prototype.setEnabled = function( enabled )
Enables or disables event handling. This implementation updates enabled.
enabled | Boolean that specifies the new enabled state. |
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.
mxLayoutManager.prototype.setBubbling = function( value )
Sets bubbling.
mxLayoutManager.prototype.hasLayout = function( cell )
Returns true if the given cell has a layout. This implementation invokes getLayout with mxEvent.LAYOUT_CELLS as the eventName. Override this if creating layouts in getLayout is expensive and return true if getLayout will return a layout for the given cell for mxEvent.BEGIN_UPDATE or mxEvent.END_UPDATE.
mxLayoutManager.prototype.getLayout = function( cell, eventName )
Returns the layout for the given cell and eventName. Possible event names are mxEvent.MOVE_CELLS and mxEvent.RESIZE_CELLS when cells are moved or resized and mxEvent.BEGIN_UPDATE or mxEvent.END_UPDATE for the bottom up and top down phases after changes to the graph model. mxEvent.LAYOUT_CELLS is used to check if a layout exists for the given cell. This is called from hasLayout.
mxLayoutManager.prototype.beforeUndo = function( undoableEdit )
Called from undoHandler.
cell | Array of mxCells that have been moved. |
evt | Mouse event that represents the mousedown. |
mxLayoutManager.prototype.cellsMoved = function( cells, evt )
Called from moveHandler.
cell | Array of mxCells that have been moved. |
evt | Mouse event that represents the mousedown. |
mxLayoutManager.prototype.cellsResized = function( cells, bounds, prev )
Called from resizeHandler.
cell | Array of mxCells that have been resized. |
bounds | mxRectangle taht represents the new bounds. |
mxLayoutManager.prototype.executeLayoutForCells = function( cells )
Executes all layouts for the given cells in two phases: In the first phase layouts for child cells are executed before layouts for parent cells with mxEvent.BEGIN_UPDATE, in the second phase layouts for parent cells are executed before layouts for child cells with mxEvent.END_UPDATE.
mxLayoutManager.prototype.destroy = function()
Removes all handlers from the graph and deletes the reference to it.
Executes all layouts which have been scheduled during the changes.
mxLayoutManager.prototype.layoutCells = function( cells, bubble )
Constructs a new automatic layout for the given graph.
function mxLayoutManager( graph )
Reference to the enclosing mxGraph.
mxLayoutManager.prototype.graph
Specifies if the layout should bubble along the cell hierarchy.
mxLayoutManager.prototype.bubbling
Specifies if event handling is enabled.
mxLayoutManager.prototype.enabled
Holds the function that handles the endUpdate event.
mxLayoutManager.prototype.undoHandler
Holds the function that handles the move event.
mxLayoutManager.prototype.moveHandler
Holds the function that handles the resize event.
mxLayoutManager.prototype.resizeHandler
Returns true if events are handled.
mxLayoutManager.prototype.isEnabled = function()
Enables or disables event handling.
mxLayoutManager.prototype.setEnabled = function( enabled )
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.isBubbling = function()
Sets bubbling.
mxLayoutManager.prototype.setBubbling = function( value )
Returns the graph that this layout operates on.
mxLayoutManager.prototype.getGraph = function()
Sets the graph that the layouts operate on.
mxLayoutManager.prototype.setGraph = function( graph )
Returns true if the given cell has a layout.
mxLayoutManager.prototype.hasLayout = function( cell )
Returns the layout for the given cell and eventName.
mxLayoutManager.prototype.getLayout = function( cell, eventName )
Called from undoHandler.
mxLayoutManager.prototype.beforeUndo = function( undoableEdit )
Called from moveHandler.
mxLayoutManager.prototype.cellsMoved = function( cells, evt )
Called from resizeHandler.
mxLayoutManager.prototype.cellsResized = function( cells, bounds, prev )
Returns the cells for which a layout should be executed.
mxLayoutManager.prototype.getCellsForChanges = function( changes )
Executes all layouts which have been scheduled during the changes.
mxLayoutManager.prototype.getCellsForChange = function( change )
Adds all ancestors of the given cell that have a layout.
mxLayoutManager.prototype.addCellsWithLayout = function( cell, result )
Adds all ancestors of the given cell that have a layout.
mxLayoutManager.prototype.addAncestorsWithLayout = function( cell, result )
Adds all descendants of the given cell that have a layout.
mxLayoutManager.prototype.addDescendantsWithLayout = function( cell, result )
Executes all layouts for the given cells in two phases: In the first phase layouts for child cells are executed before layouts for parent cells with mxEvent.BEGIN_UPDATE, in the second phase layouts for parent cells are executed before layouts for child cells with mxEvent.END_UPDATE.
mxLayoutManager.prototype.executeLayoutForCells = function( cells )
Specifies the event name for beginUpdate.
BEGIN_UPDATE: 'beginUpdate'
Specifies the event name for endUpdate.
END_UPDATE: 'endUpdate'
Executes the given layout on the given parent.
mxLayoutManager.prototype.executeLayout = function( cell, bubble )
Removes all handlers from the graph and deletes the reference to it.
mxLayoutManager.prototype.destroy = function()
Specifies the event name for moveCells.
MOVE_CELLS: 'moveCells'
Specifies the event name for resizeCells.
RESIZE_CELLS: 'resizeCells'