com.mxgraph.analysis
Class mxTraversal
java.lang.Object
com.mxgraph.analysis.mxTraversal
public class mxTraversal
- extends Object
Implements a collection of utility methods for traversing the
graph structure. This does not include tree traversal methods.
Method Summary |
static void |
bfs(mxGraph graph,
Object cell,
mxGraph.mxICellVisitor visitor,
Map<String,Object> properties)
|
static void |
dfs(mxGraph graph,
Object cell,
Object edge,
Set<Object> seen,
mxGraph.mxICellVisitor visitor,
Map<String,Object> properties)
Implements a recursive depth first search starting from the specified
cell. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
mxTraversal
public mxTraversal()
dfs
public static void dfs(mxGraph graph,
Object cell,
Object edge,
Set<Object> seen,
mxGraph.mxICellVisitor visitor,
Map<String,Object> properties)
- Implements a recursive depth first search starting from the specified
cell. Process on the cell is performing by the visitor class passed in.
The visitor has access to the current cell and the edge traversed to
find this cell. Every cell is processed once only.
mxTraversal.bfs(graph, startVertex, new mxICellVisitor()
{
public boolean visit(Object vertex, Object edge)
{
// perform your processing on each cell here
return false;
}
});
- Parameters:
graph
- the graphcell
- edge
- seen
- visitor
-
bfs
public static void bfs(mxGraph graph,
Object cell,
mxGraph.mxICellVisitor visitor,
Map<String,Object> properties)
- Parameters:
graph
- cell
- visitor
-
Copyright (c) 2010 Gaudenz Alder, David Benson. All rights reserved.