com.mindfusion.diagramming
Class QuickRouter

java.lang.Object
  extended by com.mindfusion.diagramming.QuickRouter
All Implemented Interfaces:
LinkRouter

public class QuickRouter
extends java.lang.Object
implements LinkRouter

Implements a very fast link routing algorithm that uses a tree to represent the free and occupied regions in the diagram.


Constructor Summary
QuickRouter(Diagram diagram)
          Initializes a new instance of the QuickRouter class.
 
Method Summary
 int getGranularity()
          Gets the granularity of the obstacles map generated by QuickRouter.
 float getTurnCost()
          Gets a value added to the total cost of a route if it makes a turn.
 float getUBendMaxLen()
           
 void Resume(boolean routeDeferredLinks)
          Implements LinkRouter.Resume(boolean).
 void RouteAllLinks()
          Routes all links in the diagram.
 boolean RouteLink(DiagramLink link)
          Implements LinkRouter.RouteLink(DiagramLink).
 void RouteLinks(DiagramLinkList links)
          Implements LinkRouter.RouteLinks(DiagramLinkList).
 void setGranularity(int value)
          Sets the granularity of the obstacles map generated by QuickRouter.
 void setTurnCost(float value)
          Sets a value added to the total cost of a route if it makes a turn.
 void setUBendMaxLen(float uBendMaxLen)
           
 void Suspend()
          Implements LinkRouter.Suspend().
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QuickRouter

public QuickRouter(Diagram diagram)
Initializes a new instance of the QuickRouter class.

Parameters:
diagram -
Method Detail

RouteLink

public boolean RouteLink(DiagramLink link)
Implements LinkRouter.RouteLink(DiagramLink).

Specified by:
RouteLink in interface LinkRouter
Parameters:
link - The DiagramLink to route.
Returns:
true if a path has been found successfully, otherwise false.

RouteAllLinks

public void RouteAllLinks()
Routes all links in the diagram.


RouteLinks

public void RouteLinks(DiagramLinkList links)
Implements LinkRouter.RouteLinks(DiagramLinkList).

Specified by:
RouteLinks in interface LinkRouter
Parameters:
links - A list of DiagramLink objects that should be routed.

Suspend

public void Suspend()
Implements LinkRouter.Suspend().

Specified by:
Suspend in interface LinkRouter

Resume

public void Resume(boolean routeDeferredLinks)
Implements LinkRouter.Resume(boolean).

Specified by:
Resume in interface LinkRouter
Parameters:
routeDeferredLinks - true if the links should be routed, otherwise false.

getGranularity

public int getGranularity()
Gets the granularity of the obstacles map generated by QuickRouter.


setGranularity

public void setGranularity(int value)
Sets the granularity of the obstacles map generated by QuickRouter.


getTurnCost

public float getTurnCost()
Gets a value added to the total cost of a route if it makes a turn.


setTurnCost

public void setTurnCost(float value)
Sets a value added to the total cost of a route if it makes a turn.


getUBendMaxLen

public float getUBendMaxLen()

setUBendMaxLen

public void setUBendMaxLen(float uBendMaxLen)