mxGraph 1.10.4.0


com.mxgraph.analysis
Class mxTraversal

java.lang.Object
  extended by 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.


Constructor Summary
mxTraversal()
           
 
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
 

Constructor Detail

mxTraversal

public mxTraversal()
Method Detail

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 graph
cell -
edge -
seen -
visitor -

bfs

public static void bfs(mxGraph graph,
                       Object cell,
                       mxGraph.mxICellVisitor visitor,
                       Map<String,Object> properties)
Parameters:
graph -
cell -
visitor -

mxGraph 1.10.4.0


Copyright (c) 2010 Gaudenz Alder, David Benson. All rights reserved.