y.layout.planar
Class SimpleEdgeRouter

java.lang.Object
  |
  +--y.layout.planar.SimpleEdgeRouter

public class SimpleEdgeRouter
extends Object

Instances of this class route edges through a planar graph using it's dual graph


Field Summary
static short DUAL
           
static short REAL
           
 
Constructor Summary
SimpleEdgeRouter(PlanarInformation _planar)
           
 
Method Summary
 void dijkstra(Graph graph, Node s, Node t, boolean directed, int[] cost, int[] dist, Edge[] pred)
           
 void insertEdge(Edge currentEdge)
          Inserts a single edge into the graph by routing through the dual graph.
 void insertEdges(EdgeList edges)
          Inserts a list of edges into the graph by routing through the dual graph.
 void rerouteEdges(EdgeList edges)
          this method tries to find better paths for all edges that caused crossings.
 void rerouteEdges(int iter, EdgeList edges)
          this method tries to find better paths for all edges that caused crossings.
protected  EdgeList routeEdge(Edge e, short _pathStyle, DualPlanarInformation dualPlanar, Edge[] zeroEdges)
          this method tries to find the best route through a graph.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DUAL

public static final short DUAL
See Also:
Constant Field Values

REAL

public static final short REAL
See Also:
Constant Field Values
Constructor Detail

SimpleEdgeRouter

public SimpleEdgeRouter(PlanarInformation _planar)
Method Detail

insertEdges

public void insertEdges(EdgeList edges)
Inserts a list of edges into the graph by routing through the dual graph.

Parameters:
edges - the edges to be routed routed.

insertEdge

public void insertEdge(Edge currentEdge)
Inserts a single edge into the graph by routing through the dual graph.

Parameters:
currentEdge - the edge to be routed.

routeEdge

protected EdgeList routeEdge(Edge e,
                             short _pathStyle,
                             DualPlanarInformation dualPlanar,
                             Edge[] zeroEdges)
this method tries to find the best route through a graph. Best means that the route causes as less crossings as possible.

Precondition: a valid dual graph, dsp must be initialized

Parameters:
e - the edge to be routed
Returns:
the path through the dual graph that yielded the best result

rerouteEdges

public void rerouteEdges(int iter,
                         EdgeList edges)
this method tries to find better paths for all edges that caused crossings.

Precondition is a valid dual graph

Parameters:
iter - number of iterations to perform, a value less or equal to zero causes the the method to run until the best possible result is found

rerouteEdges

public void rerouteEdges(EdgeList edges)
this method tries to find better paths for all edges that caused crossings.


dijkstra

public void dijkstra(Graph graph,
                     Node s,
                     Node t,
                     boolean directed,
                     int[] cost,
                     int[] dist,
                     Edge[] pred)

© Copyright 2000-2003,
yWorks GmbH.
All rights reserved.

2003