<!-- saved from url=(0026)http://www.naturaldocs.org -->
<divid=Content><divclass="CClass"><divclass=CTopicid=MainTopic><h1class=CTitle><aname="mxCompositeLayout"></a>mxCompositeLayout</h1><divclass=CBody><p>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 <ahref="#mxCompositeLayout.layouts"class=LVariableid=link11onMouseOver="ShowTip(event, 'tt2', 'link11')"onMouseOut="HideTip('tt2')">layouts</a> should be used. The <master> layout is not executed as the code assumes that it is part of <ahref="#mxCompositeLayout.layouts"class=LVariableid=link12onMouseOver="ShowTip(event, 'tt2', 'link12')"onMouseOut="HideTip('tt2')">layouts</a>.</p><h4class=CHeading>Example</h4><blockquote><preclass="prettyprint">var first = new mxFastOrganicLayout(graph);
var second = new mxParallelEdgeLayout(graph);
var layout = new mxCompositeLayout(graph, [first, second], first);
layout.execute(graph.getDefaultParent());</pre></blockquote><!--START_ND_SUMMARY--><divclass=Summary><divclass=STitle>Summary</div><divclass=SBorder><tableborder=0cellspacing=0cellpadding=0class=STable><trclass="SMain"><tdclass=SEntry><ahref="#mxCompositeLayout">mxCompositeLayout</a></td><tdclass=SDescription>Allows to compose multiple layouts into a single layout. </td></tr><trclass="SGroup SIndent1"><tdclass=SEntry><ahref="#mxCompositeLayout.Functions">Functions</a></td><tdclass=SDescription></td></tr><trclass="SFunction SIndent2 SMarked"><tdclass=SEntry><ahref="#mxCompositeLayout.mxCompositeLayout"id=link1onMouseOver="ShowTip(event, 'tt1', 'link1')"onMouseOut="HideTip('tt1')">mxCompositeLayout</a></td><tdclass=SDescription>Constructs a new layout using the given layouts. </td></tr><trclass="SGroup SIndent1"><tdclass=SEntry><ahref="#mxCompositeLayout.Variables">Variables</a></td><tdclass=SDescription></td></tr><trclass="SVariable SIndent2 SMarked"><tdclass=SEntry><ahref="#mxCompositeLayout.layouts"id=link2onMouseOver="ShowTip(event, 'tt2', 'link2')"onMouseOut="HideTip('tt2')">layouts</a></td><tdclass=SDescription>Holds the array of <ahref="mxGraphLayout-js.html#mxGraphLayout"class=LClassid=link3onMouseOver="ShowTip(event, 'tt3', 'link3')"onMouseOut="HideTip('tt3')">mxGraphLayouts</a> that this layout contains.</td></tr><trclass="SVariable SIndent2"><tdclass=SEntry><ahref="#mxCompositeLayout.layouts">layouts</a></td><tdclass=SDescription>Reference to the <ahref="mxGraphLayout-js.html#mxGraphLayout"class=LClassid=link4onMouseOver="ShowTip(event, 'tt3', 'link4')"onMouseOut="HideTip('tt3')">mxGraphLayouts</a> that handles moves. </td></tr><trclass="SGroup SIndent1"><tdclass=SEntry><ahref="#mxCompositeLayout.Functions">Functions</a></td><tdclass=SDescription></td></tr><trclass="SFunction SIndent2 SMarked"><tdclass=SEntry><ahref="#mxCompositeLayout.moveCell"id=link5onMouseOver="ShowTip(event, 'tt4', 'link5')"onMouseOut="HideTip('tt4')">moveCell</a></td><tdclass=SDescription>Implements <ahref="mxGraphLayout-js.html#mxGraphLayout.moveCell"class=LFunctionid=link6onMouseOver="ShowTip(event, 'tt5', 'link6')"onMouseOut="HideTip('tt5')">mxGraphLayout.moveCell</a> by calling move on <master> or the first layout in <ahref="#mxCompositeLayout.layouts"class=LVariableid=link7onMouseOver="ShowTip(event, 'tt2', 'link7')"onMouseOut="HideTip('tt2')">layouts</a>.</td></tr><trclass="SFunction SIndent2"><tdclass=SEntry><ahref="#mxCompositeLayout.execute"id=link8onMouseOver="ShowTip(event, 'tt6', 'link8')"onMouseOut="HideTip('tt6')">execute</a></td><tdclass=SDescription>Implements <ahref="mxGraphLayout-js.html#mxGraphLayout.execute"class=LFunctionid=link9onMouseOver="ShowTip(event, 'tt7', 'link9')"onMouseOut="HideTip('tt7')">mxGraphLayout.execute</a> by executing all <ahref="#mxCompositeLayout.layouts"class=LVariableid=link10onMouseOver="ShowTip(event, 'tt2', 'link10')"onMouseOut="HideTip('tt2')">layouts</a> in a single transaction.</td></tr></table></div></div><!--END_ND_SUMMARY--></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxCompositeLayout.mxCompositeLayout"></a>mxCompositeLayout</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass="PBeforeParameters prettyprint "nowrap>function mxCompositeLayout(</td><tdclass="PParameter prettyprint "nowrap>graph,</td></tr><tr><td></td><tdclass="PParameter prettyprint "nowrap>layouts,</td></tr><tr><td></td><tdclass="PParameter prettyprint "nowrap>master</td><tdclass="PAfterParameters prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><p>Constructs a new layout using the given layouts. The graph instance is required for creating the transaction that contains all layouts.</p><h4class=CHeading>Arguments</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>graph</td><tdclass=CDLDescription>Reference to the enclosing <ahref="../view/mxGraph-js.html#mxGraph"class=LClassid=link13onMouseOver="ShowTip(event, 'tt8', 'link13')"onMouseOut="HideTip('tt8')">mxGraph</a>.</td></tr><tr><tdclass=CDLEntry>layouts</td><tdclass=CDLDescription>Array of <ahref="mxGraphLayout-js.html#mxGraphLayout"class=LClassid=link14onMouseOver="ShowTip(event, 'tt3', 'link14')"onMouseOut="HideTip('tt3')">mxGraphLayouts</a>.</td></tr><tr><tdclass=CDLEntry>master</td><tdclass=CDLDescription>Optional layout that handles moves. If no layout is given then the first layout of the above array is used to handle moves.</td></tr></table></div></div></div>
<divclass="CVariable"><divclass=CTopic><h3class=CTitle><aname="mxCompositeLayout.layouts"></a>layouts</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype"><tr><tdclass="prettyprint">mxCompositeLayout.prototype.layouts</td></tr></table></blockquote><p>Holds the array of <ahref="mxGraphLayout-js.html#mxGraphLayout"class=LClassid=link15onMouseOver="ShowTip(event, 'tt3', 'link15')"onMouseOut="HideTip('tt3')">mxGraphLayouts</a> that this layout contains.</p></div></div></div>
<divclass="CVariable"><divclass=CTopic><h3class=CTitle><aname="mxCompositeLayout.layouts"></a>layouts</h3><divclass=CBody><p>Reference to the <ahref="mxGraphLayout-js.html#mxGraphLayout"class=LClassid=link16onMouseOver="ShowTip(event, 'tt3', 'link16')"onMouseOut="HideTip('tt3')">mxGraphLayouts</a> that handles moves. If this is null then the first layout in <ahref="#mxCompositeLayout.layouts"class=LVariableid=link17onMouseOver="ShowTip(event, 'tt2', 'link17')"onMouseOut="HideTip('tt2')">layouts</a> is used.</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxCompositeLayout.moveCell"></a>moveCell</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass="PBeforeParameters prettyprint "nowrap>mxCompositeLayout.prototype.moveCell = function(</td><tdclass="PParameter prettyprint "nowrap>cell,</td></tr><tr><td></td><tdclass="PParameter prettyprint "nowrap>x,</td></tr><tr><td></td><tdclass="PParameter prettyprint "nowrap>y</td><tdclass="PAfterParameters prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><p>Implements <ahref="mxGraphLayout-js.html#mxGraphLayout.moveCell"class=LFunctionid=link18onMouseOver="ShowTip(event, 'tt5', 'link18')"onMouseOut="HideTip('tt5')">mxGraphLayout.moveCell</a> by calling move on <master> or the first layout in <ahref="#mxCompositeLayout.layouts"class=LVariableid=link19onMouseOver="ShowTip(event, 'tt2', 'link19')"onMouseOut="HideTip('tt2')">layouts</a>.</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxCompositeLayout.execute"></a>execute</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass="PBeforeParameters prettyprint "nowrap>mxCompositeLayout.prototype.execute = function(</td><tdclass="PParameter prettyprint "nowrap>parent</td><tdclass="PAfterParameters prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><p>Implements <ahref="mxGraphLayout-js.html#mxGraphLayout.execute"class=LFunctionid=link20onMouseOver="ShowTip(event, 'tt7', 'link20')"onMouseOut="HideTip('tt7')">mxGraphLayout.execute</a> by executing all <ahref="#mxCompositeLayout.layouts"class=LVariableid=link21onMouseOver="ShowTip(event, 'tt2', 'link21')"onMouseOut="HideTip('tt2')">layouts</a> in a single transaction.</p></div></div></div>
<divclass=CToolTipid="tt1"><divclass=CFunction><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass="PBeforeParameters prettyprint "nowrap>function mxCompositeLayout(</td><tdclass="PParameter prettyprint "nowrap>graph,</td></tr><tr><td></td><tdclass="PParameter prettyprint "nowrap>layouts,</td></tr><tr><td></td><tdclass="PParameter prettyprint "nowrap>master</td><tdclass="PAfterParameters prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>Constructs a new layout using the given layouts. </div></div><divclass=CToolTipid="tt2"><divclass=CVariable><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype"><tr><tdclass="prettyprint">mxCompositeLayout.prototype.layouts</td></tr></table></blockquote>Holds the array of mxGraphLayouts that this layout contains.</div></div><divclass=CToolTipid="tt3"><divclass=CClass>Base class for all layout algorithms in mxGraph. </div></div><divclass=CToolTipid="tt4"><divclass=CFunction><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass="PBeforeParameters prettyprint "nowrap>mxCompositeLayout.prototype.moveCell = function(</td><tdclass="PParameter prettyprint "nowrap>cell,</td></tr><tr><td></td><tdclass="PParameter prettyprint "nowrap>x,</td></tr><tr><td></td><tdclass="PParameter prettyprint "nowrap>y</td><tdclass="PAfterParameters prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>Implements mxGraphLayout.moveCell by calling move on master or the first layout in layouts.</div></div><divclass=CToolTipid="tt5"><divclass=CFunction><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass="PBeforeParameters prettyprint "nowrap>mxGraphLayout.prototype.moveCell = function(</td><tdclass="PParameter prettyprint "nowrap>cell,</td></tr><tr><td></td><tdclass="PParameter prettyprint "nowrap>x,</td></tr><tr><td></td><tdclass="PParameter prettyprint "nowrap>y</td><tdclass="PAfterParameters prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>Notified when a cell is being moved in a parent that has automatic layout to update the cell state (eg. </div></div><divclass=CToolTipid="tt6"><divclass=CFunction><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass="PBeforeParameters prettyprint "nowrap>mxCompositeLayout.prototype.execute = function(</td><tdclass="PParameter prettyprint "nowrap>parent</td><tdclass="PAfterParameters prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>Implements mxGraphLayout.execute by executing all layouts in a single transaction.</div></div><divclass=CToolTipid="tt7"><divclass=CFunction><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass="PBeforeParameters prettyprint "nowrap>mxGraphLayout.prototype.execute = function(</td><tdclass="PParameter prettyprint "nowrap>parent</td><tdclass="PAfterParameters prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>Executes the layout algorithm for the children of the given parent.</div></div><divclass=CToolTipid="tt8"><divclass=CClass>Extends mxEventSource to implement a graph component for the browser. </div></div><!--END_ND_TOOLTIPS-->