Package com.mxgraph.view
Class mxSwimlaneManager
- java.lang.Object
-
- com.mxgraph.util.mxEventSource
-
- com.mxgraph.view.mxSwimlaneManager
-
public class mxSwimlaneManager extends mxEventSource
Manager for swimlanes and nested swimlanes that sets the size of newly added swimlanes to that of their siblings, and propagates changes to the size of a swimlane to its siblings, if siblings is true, and its ancestors, if bubbling is true.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.mxgraph.util.mxEventSource
mxEventSource.mxIEventListener
-
-
Field Summary
Fields Modifier and Type Field Description protected booleanaddEnabledSpecifies if newly added cells should be resized to match the size of their existing siblings.protected mxEventSource.mxIEventListeneraddHandlerprotected booleanenabledOptional string that specifies the value of the attribute to be passed to mxCell.is to check if the rule applies to a cell.protected mxGraphgraphDefines the type of the source or target terminal.protected booleanhorizontalOptional string that specifies the attributename to be passed to mxCell.is to check if the rule applies to a cell.protected booleanresizeEnabledSpecifies if resizing of swimlanes should be handled.protected mxEventSource.mxIEventListenerresizeHandler-
Fields inherited from class com.mxgraph.util.mxEventSource
eventListeners, eventsEnabled, eventSource
-
-
Constructor Summary
Constructors Constructor Description mxSwimlaneManager(mxGraph graph)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidcellsAdded(java.lang.Object[] cells)Called if any cells have been added.protected voidcellsResized(java.lang.Object[] cells)Called if any cells have been resizes.voiddestroy()mxGraphgetGraph()booleanisAddEnabled()protected booleanisCellHorizontal(java.lang.Object cell)Returns true if the given cell is horizontal.booleanisEnabled()booleanisHorizontal()booleanisResizeEnabled()protected booleanisSwimlaneIgnored(java.lang.Object swimlane)Returns true if the given swimlane should be ignored.protected voidresizeSwimlane(java.lang.Object swimlane, double w, double h, boolean parentHorizontal)Sets the width or height of the given swimlane to the given value depending on. voidsetAddEnabled(boolean value)voidsetEnabled(boolean value)voidsetGraph(mxGraph graph)voidsetHorizontal(boolean value)voidsetResizeEnabled(boolean value)protected voidswimlaneAdded(java.lang.Object swimlane)Called for each swimlane which has been added.-
Methods inherited from class com.mxgraph.util.mxEventSource
addListener, fireEvent, fireEvent, getEventSource, isEventsEnabled, removeListener, removeListener, setEventsEnabled, setEventSource
-
-
-
-
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.
-
horizontal
protected boolean horizontal
Optional string that specifies the attributename to be passed to mxCell.is to check if the rule applies to a cell.
-
addEnabled
protected boolean addEnabled
Specifies if newly added cells should be resized to match the size of their existing siblings. Default is true.
-
resizeEnabled
protected boolean resizeEnabled
Specifies if resizing of swimlanes should be handled. Default is true.
-
addHandler
protected mxEventSource.mxIEventListener addHandler
-
resizeHandler
protected mxEventSource.mxIEventListener resizeHandler
-
-
Constructor Detail
-
mxSwimlaneManager
public mxSwimlaneManager(mxGraph graph)
-
-
Method Detail
-
isEnabled
public boolean isEnabled()
- Returns:
- the enabled
-
setEnabled
public void setEnabled(boolean value)
- Parameters:
value- the enabled to set
-
isHorizontal
public boolean isHorizontal()
- Returns:
- the bubbling
-
setHorizontal
public void setHorizontal(boolean value)
- Parameters:
value- the bubbling to set
-
isAddEnabled
public boolean isAddEnabled()
- Returns:
- the addEnabled
-
setAddEnabled
public void setAddEnabled(boolean value)
- Parameters:
value- the addEnabled to set
-
isResizeEnabled
public boolean isResizeEnabled()
- Returns:
- the resizeEnabled
-
setResizeEnabled
public void setResizeEnabled(boolean value)
- Parameters:
value- the resizeEnabled to set
-
getGraph
public mxGraph getGraph()
- Returns:
- the graph
-
setGraph
public void setGraph(mxGraph graph)
- Parameters:
graph- the graph to set
-
isSwimlaneIgnored
protected boolean isSwimlaneIgnored(java.lang.Object swimlane)
Returns true if the given swimlane should be ignored.
-
isCellHorizontal
protected boolean isCellHorizontal(java.lang.Object cell)
Returns true if the given cell is horizontal. If the given cell is not a swimlane, then thevalue is returned.
-
cellsAdded
protected void cellsAdded(java.lang.Object[] cells)
Called if any cells have been added. Calls swimlaneAdded for all swimlanes where isSwimlaneIgnored returns false.
-
swimlaneAdded
protected void swimlaneAdded(java.lang.Object swimlane)
Called for each swimlane which has been added. This finds a reference sibling swimlane and applies its size to the newly added swimlane. If no sibling can be found then the parent swimlane is resized so that the new swimlane fits into the parent swimlane.
-
cellsResized
protected void cellsResized(java.lang.Object[] cells)
Called if any cells have been resizes. Calls swimlaneResized for all swimlanes where isSwimlaneIgnored returns false.
-
resizeSwimlane
protected void resizeSwimlane(java.lang.Object swimlane, double w, double h, boolean parentHorizontal)Sets the width or height of the given swimlane to the given value depending on. If is true, then the width is set, otherwise, the height is set.
-
destroy
public void destroy()
-
-