|
mxGraph 1.10.1.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.mxgraph.layout.hierarchical.model.mxGraphHierarchyModel
public class mxGraphHierarchyModel
Internal model of a hierarchical graph. This model stores nodes and edges equivalent to the real graph nodes and edges, but also stores the rank of the cells, the order within the ranks and the new candidate locations of cells. The internal model also reverses edge direction were appropriate , ignores self-loop and groups parallels together under one edge object.
Nested Class Summary | |
---|---|
static interface |
mxGraphHierarchyModel.CellVisitor
Defines the interface that visitors use to perform operations upon the graph information during depth first search (dfs) or other tree-traversal strategies implemented by subclassers. |
Field Summary | |
---|---|
protected boolean |
deterministic
Whether or not cells are ordered according to the order in the graph model. |
protected int |
dfsCount
Count of the number of times the ancestor dfs has been used |
protected Map<Object,mxGraphHierarchyEdge> |
edgeMapper
Map from graph edges to internal model edges |
int |
maxRank
Stores the largest rank number allocated |
Object |
parent
The parent cell whose children are being laid out |
Map<Integer,mxGraphHierarchyRank> |
ranks
Mapping from rank number to actual rank |
List<Object> |
roots
Store of roots of this hierarchy model, these are real graph cells, not internal cells |
protected boolean |
scanRanksFromSinks
Whether the rank assignment is done from the sinks or sources. |
protected Map<Object,mxGraphHierarchyNode> |
vertexMapper
Map from graph vertices to internal model nodes |
Constructor Summary | |
---|---|
mxGraphHierarchyModel(mxHierarchicalLayout layout,
Object[] vertices,
List<Object> roots,
Object parent,
boolean deterministic,
boolean scanRanksFromSinks)
Creates an internal ordered graph model using the vertices passed in. |
Method Summary | |
---|---|
protected void |
createInternalCells(mxHierarchicalLayout layout,
Object[] vertices,
mxGraphHierarchyNode[] internalVertices)
Creates all edges in the internal model |
void |
dfs(mxGraphHierarchyNode parent,
mxGraphHierarchyNode root,
mxGraphHierarchyEdge connectingEdge,
mxGraphHierarchyModel.CellVisitor visitor,
Set<mxGraphHierarchyNode> seen,
int layer)
Performs a depth first search on the internal hierarchy model |
void |
dfs(mxGraphHierarchyNode parent,
mxGraphHierarchyNode root,
mxGraphHierarchyEdge connectingEdge,
mxGraphHierarchyModel.CellVisitor visitor,
Set<mxGraphHierarchyNode> seen,
int[] ancestors,
int childHash,
int layer)
Performs a depth first search on the internal hierarchy model. |
void |
fixRanks()
Fixes the layer assignments to the values stored in the nodes. |
int |
getDfsCount()
|
Map<Object,mxGraphHierarchyEdge> |
getEdgeMapper()
|
Map<Object,mxGraphHierarchyNode> |
getVertexMapper()
|
void |
initialRank()
Basic determination of minimum layer ranking by working from from sources or sinks and working through each node in the relevant edge direction. |
boolean |
isDeterministic()
|
void |
setDeterministic(boolean deterministic)
|
void |
setDfsCount(int dfsCount)
|
void |
setEdgeMapper(Map<Object,mxGraphHierarchyEdge> edgeMapper)
|
void |
setVertexMapper(Map<Object,mxGraphHierarchyNode> vertexMapping)
|
void |
visit(mxGraphHierarchyModel.CellVisitor visitor,
mxGraphHierarchyNode[] dfsRoots,
boolean trackAncestors,
Set<mxGraphHierarchyNode> seenNodes)
A depth first search through the internal hierarchy model |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected boolean scanRanksFromSinks
public int maxRank
protected Map<Object,mxGraphHierarchyNode> vertexMapper
protected Map<Object,mxGraphHierarchyEdge> edgeMapper
public Map<Integer,mxGraphHierarchyRank> ranks
public List<Object> roots
public Object parent
protected int dfsCount
protected boolean deterministic
Constructor Detail |
---|
public mxGraphHierarchyModel(mxHierarchicalLayout layout, Object[] vertices, List<Object> roots, Object parent, boolean deterministic, boolean scanRanksFromSinks)
layout
- the enclosing layout objectvertices
- the vertices for this hierarchydeterministic
- whether or not this layout should be deterministic on eachscanRanksFromSinks
- Whether the rank assignment is done from the sinks or sources.
usageMethod Detail |
---|
protected void createInternalCells(mxHierarchicalLayout layout, Object[] vertices, mxGraphHierarchyNode[] internalVertices)
layout
- reference to the layout algorithmvertices
- the vertices whom are to have an internal representation
createdinternalVertices
- the blank internal vertices to have their information filled
in using the real verticespublic void initialRank()
public void fixRanks()
public void visit(mxGraphHierarchyModel.CellVisitor visitor, mxGraphHierarchyNode[] dfsRoots, boolean trackAncestors, Set<mxGraphHierarchyNode> seenNodes)
visitor
- the visitor pattern to be called for each nodetrackAncestors
- whether or not the search is to keep track all nodes directly
above this one in the search pathpublic void dfs(mxGraphHierarchyNode parent, mxGraphHierarchyNode root, mxGraphHierarchyEdge connectingEdge, mxGraphHierarchyModel.CellVisitor visitor, Set<mxGraphHierarchyNode> seen, int layer)
parent
- the parent internal node of the current internal noderoot
- the current internal nodeconnectingEdge
- the internal edge connecting the internal node and the parent
internal node, if anyvisitor
- the visitor pattern to be called for each nodeseen
- a set of all nodes seen by this dfs a set of all of the
ancestor node of the current nodelayer
- the layer on the dfs tree ( not the same as the model ranks )public void dfs(mxGraphHierarchyNode parent, mxGraphHierarchyNode root, mxGraphHierarchyEdge connectingEdge, mxGraphHierarchyModel.CellVisitor visitor, Set<mxGraphHierarchyNode> seen, int[] ancestors, int childHash, int layer)
parent
- the parent internal node of the current internal noderoot
- the current internal nodeconnectingEdge
- the internal edge connecting the internal node and the parent
internal node, if anyvisitor
- the visitor pattern to be called for each nodeseen
- a set of all nodes seen by this dfsancestors
- the parent hash codechildHash
- the new hash code for this nodelayer
- the layer on the dfs tree ( not the same as the model ranks )public Map<Object,mxGraphHierarchyNode> getVertexMapper()
public void setVertexMapper(Map<Object,mxGraphHierarchyNode> vertexMapping)
vertexMapping
- The vertexMapping to set.public Map<Object,mxGraphHierarchyEdge> getEdgeMapper()
public void setEdgeMapper(Map<Object,mxGraphHierarchyEdge> edgeMapper)
edgeMapper
- The edgeMapper to set.public int getDfsCount()
public void setDfsCount(int dfsCount)
dfsCount
- The dfsCount to set.public boolean isDeterministic()
public void setDeterministic(boolean deterministic)
deterministic
- The deterministic to set.
|
mxGraph 1.10.1.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |