mxCompositeLayout

Allows to compose multiple layouts into a single layout.  The master layout is the layout that handles move operations if another layout than the first element in layouts should be used.  The <master> layout is not executed as the code assumes that it is part of layouts.

Example

var first = new mxFastOrganicLayout(graph);
var second = new mxParallelEdgeLayout(graph);
var layout = new mxCompositeLayout(graph, [first, second], first);
layout.execute(graph.getDefaultParent());
Summary
mxCompositeLayoutAllows to compose multiple layouts into a single layout.
Functions
mxCompositeLayoutConstructs a new layout using the given layouts.
Variables
layoutsHolds the array of mxGraphLayouts that this layout contains.
layoutsReference to the mxGraphLayouts that handles moves.
Functions
moveCellImplements mxGraphLayout.moveCell by calling move on <master> or the first layout in layouts.
executeImplements mxGraphLayout.execute by executing all layouts in a single transaction.

Functions

mxCompositeLayout

function mxCompositeLayout(graph,
layouts,
master)

Constructs a new layout using the given layouts.  The graph instance is required for creating the transaction that contains all layouts.

Arguments

graphReference to the enclosing mxGraph.
layoutsArray of mxGraphLayouts.
masterOptional layout that handles moves.  If no layout is given then the first layout of the above array is used to handle moves.

Variables

layouts

mxCompositeLayout.prototype.layouts

Holds the array of mxGraphLayouts that this layout contains.

layouts

Reference to the mxGraphLayouts that handles moves.  If this is null then the first layout in layouts is used.

Functions

moveCell

mxCompositeLayout.prototype.moveCell = function(cell,
x,
y)

Implements mxGraphLayout.moveCell by calling move on <master> or the first layout in layouts.

execute

mxCompositeLayout.prototype.execute = function(parent)

Implements mxGraphLayout.execute by executing all layouts in a single transaction.

function mxCompositeLayout(graph,
layouts,
master)
Constructs a new layout using the given layouts.
mxCompositeLayout.prototype.layouts
Holds the array of mxGraphLayouts that this layout contains.
Base class for all layout algorithms in mxGraph.
mxCompositeLayout.prototype.moveCell = function(cell,
x,
y)
Implements mxGraphLayout.moveCell by calling move on master or the first layout in layouts.
mxGraphLayout.prototype.moveCell = function(cell,
x,
y)
Notified when a cell is being moved in a parent that has automatic layout to update the cell state (eg.
mxCompositeLayout.prototype.execute = function(parent)
Implements mxGraphLayout.execute by executing all layouts in a single transaction.
mxGraphLayout.prototype.execute = function(parent)
Executes the layout algorithm for the children of the given parent.
Extends mxEventSource to implement a graph component for the browser.
Close