Package com.mxgraph.view
Class mxLayoutManager
java.lang.Object
com.mxgraph.util.mxEventSource
com.mxgraph.view.mxLayoutManager
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
FieldsModifier and TypeFieldDescriptionprotected booleanOptional string that specifies the attributename to be passed to mxCell.is to check if the rule applies to a cell.protected booleanOptional string that specifies the value of the attribute to be passed to mxCell.is to check if the rule applies to a cell.protected mxGraphDefines the type of the source or target terminal.protected mxEventSource.mxIEventListenerprotected mxEventSource.mxIEventListenerFields inherited from class com.mxgraph.util.mxEventSource
eventListeners, eventsEnabled, eventSource -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidbeforeUndo(mxUndoableEdit edit) protected voidcellsMoved(Object[] cells, Point location) voiddestroy()protected voidexecuteLayout(mxIGraphLayout layout, Object parent) protected Collection<Object>protected Collection<Object>getGraph()protected mxIGraphLayoutbooleanbooleanprotected voidlayoutCells(Object[] cells) voidsetBubbling(boolean value) voidsetEnabled(boolean value) voidMethods inherited from class com.mxgraph.util.mxEventSource
addListener, fireEvent, fireEvent, getEventSource, isEventsEnabled, removeListener, removeListener, setEventsEnabled, setEventSource
-
Field Details
-
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 enabledOptional 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 bubblingOptional string that specifies the attributename to be passed to mxCell.is to check if the rule applies to a cell. Default is true. -
undoHandler
-
moveHandler
-
-
Constructor Details
-
mxLayoutManager
-
-
Method Details
-
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
- Returns:
- the graph
-
setGraph
- Parameters:
value- the graph to set
-
getLayout
-
cellsMoved
-
beforeUndo
-
getCellsForChanges
-
getCellsForChange
-
layoutCells
-
executeLayout
-
destroy
public void destroy()
-