mxLayoutManager (JGraph X 2.1.0.7 API Specification)
Date: 2013-07-31

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| JGraph X 2.1.0.7
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.mxgraph.view
Class mxLayoutManager

    java.lang.Object
      com.mxgraph.util.mxEventSource
          com.mxgraph.view.mxLayoutManager

    public class mxLayoutManager

extends mxEventSource

Implements a layout manager that updates the layout for a given transaction. The following example installs an automatic tree layout in a graph: `new mxLayoutManager(graph) { mxCompactTreeLayout layout = new mxCompactTreeLayout(graph); public mxIGraphLayout getLayout(Object parent) { if (graph.getModel().getChildCount(parent) > 0) { return layout; } return null; } };` This class fires the following event: mxEvent.LAYOUT_CELLS fires between begin- and endUpdate after all cells have been layouted in layoutCells. The `cells` property contains all cells that have been passed to layoutCells.

Nested Class Summary

Nested classes/interfaces inherited from class com.mxgraph.util.mxEventSource
`mxEventSource.mxIEventListener`

Field Summary
`protected boolean` | `bubbling` Optional string that specifies the attributename to be passed to mxCell.is to check if the rule applies to a cell.
`protected boolean` | `enabled` Optional string that specifies the value of the attribute to be passed to mxCell.is to check if the rule applies to a cell.
`protected mxGraph` | `graph` Defines the type of the source or target terminal.
`protected mxEventSource.mxIEventListener` | `moveHandler`
`protected mxEventSource.mxIEventListener` | `undoHandler`

Fields inherited from class com.mxgraph.util.mxEventSource
`eventListeners, eventsEnabled, eventSource`

Constructor Summary
`mxLayoutManager(mxGraph graph)`

Method Summary
`protected void` | `beforeUndo(mxUndoableEdit edit)`
`protected void` | `cellsMoved(Object[] cells, Point location)`
`void` | `destroy()`
`protected void` | `executeLayout(mxIGraphLayout layout, Object parent)`
`protected Collection<Object>` | `getCellsForChange(mxUndoableEdit.mxUndoableChange change)`
`protected Collection<Object>` | `getCellsForChanges(List<mxUndoableEdit.mxUndoableChange> changes)`
`mxGraph` | `getGraph()`
`protected mxIGraphLayout` | `getLayout(Object parent)`
`boolean` | `isBubbling()`
`boolean` | `isEnabled()`
`protected void` | `layoutCells(Object[] cells)`
`void` | `setBubbling(boolean value)`
`void` | `setEnabled(boolean value)`
`void` | `setGraph(mxGraph value)`

Methods inherited from class com.mxgraph.util.mxEventSource
`addListener, fireEvent, fireEvent, getEventSource, isEventsEnabled, removeListener, removeListener, setEventsEnabled, setEventSource`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### graph

    protected mxGraph graph

  Defines the type of the source or target terminal. The type is a string passed to mxCell.is to check if the rule applies to a cell.

### enabled

    protected boolean enabled

  Optional string that specifies the value of the attribute to be passed to mxCell.is to check if the rule applies to a cell. Default is true.

### bubbling

    protected boolean bubbling

  Optional string that specifies the attributename to be passed to mxCell.is to check if the rule applies to a cell. Default is true.

### undoHandler

    protected mxEventSource.mxIEventListener undoHandler

### moveHandler

    protected mxEventSource.mxIEventListener moveHandler

Constructor Detail

### mxLayoutManager

    public mxLayoutManager(mxGraph graph)

Method Detail

### isEnabled

    public boolean isEnabled()

  Returns:
    the enabled

### setEnabled

    public void setEnabled(boolean value)

  Parameters:
    `value` - the enabled to set

### isBubbling

    public boolean isBubbling()

  Returns:
    the bubbling

### setBubbling

    public void setBubbling(boolean value)

  Parameters:
    `value` - the bubbling to set

### getGraph

    public mxGraph getGraph()

  Returns:
    the graph

### setGraph

    public void setGraph(mxGraph value)

  Parameters:
    `value` - the graph to set

### getLayout

    protected mxIGraphLayout getLayout(Object parent)

### cellsMoved

    protected void cellsMoved(Object[] cells,
                              Point location)

### beforeUndo

    protected void beforeUndo(mxUndoableEdit edit)

### getCellsForChanges

    protected Collection<Object> getCellsForChanges(List<mxUndoableEdit.mxUndoableChange> changes)

### getCellsForChange

    protected Collection<Object> getCellsForChange(mxUndoableEdit.mxUndoableChange change)

### layoutCells

    protected void layoutCells(Object[] cells)

### executeLayout

    protected void executeLayout(mxIGraphLayout layout,
                                 Object parent)

### destroy

    public void destroy()

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| JGraph X 2.1.0.7
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright (c) 2010 Gaudenz Alder. All rights reserved.