public class QuickRouter extends java.lang.Object implements LinkRouter
Constructor and Description |
---|
QuickRouter(Diagram diagram)
Initializes a new instance of the QuickRouter class.
|
Modifier and Type | Method and Description |
---|---|
Diagram |
getDiagram() |
Granularity |
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 |
routeAllLinks()
Routes all links in the diagram.
|
boolean |
routeLink(DiagramLink link,
ConnectionPoint originConnection,
ConnectionPoint destinationConnection,
boolean nowCreating)
Implements LinkRouter.routeLink.
|
DiagramLinkList |
routeLinks(DiagramLinkList links)
Implements LinkRouter.routeLinks.
|
void |
setDiagram(Diagram value)
Sets the diagram this router is associated with.
|
void |
setGranularity(Granularity 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) |
public QuickRouter(Diagram diagram)
diagram
- The Diagram whose links will be routed.public boolean routeLink(DiagramLink link, ConnectionPoint originConnection, ConnectionPoint destinationConnection, boolean nowCreating)
routeLink
in interface LinkRouter
link
- The DiagramLink to route.originConnection
- Represents connection to Origin node, potentially
different from link's stored connection when modifying first control point.destinationConnection
- Represents connection to Destination node, potentially
different from link's stored connection when modifying last control point.nowCreating
- Indicates whether link is currently being created.public void routeAllLinks()
public DiagramLinkList routeLinks(DiagramLinkList links)
routeLinks
in interface LinkRouter
links
- A list of DiagramLink objects that should be routed.public Granularity getGranularity()
public void setGranularity(Granularity value)
public float getTurnCost()
public void setTurnCost(float value)
public float getUBendMaxLen()
public void setUBendMaxLen(float uBendMaxLen)
public Diagram getDiagram()
public void setDiagram(Diagram value)
LinkRouter
setDiagram
in interface LinkRouter
value
- A Diagram instance.