public class RoutingOptions extends java.lang.Object implements RoutingOptions
Diagram.getRoutingOptions()
method lets you customize the behavior of the link routing algorithm.Modifier and Type | Method and Description |
---|---|
Anchoring |
getAnchoring()
Gets a value indicating whether the routing algorithm should align
links to the anchor points of nodes.
|
boolean |
getAvoidOverlaps()
Gets whether link segments should be pulled apart when they overlap in initially found routes.
|
short |
getCrossingCost()
Gets the value added to the total route cost if a link crosses
another link.
|
static RouteHeuristics |
getDistance()
Return a heuristic function that returns the real distance
sqrt(dx^2 + dy^2) between two pieces of the routing grid.
|
static RouteHeuristics |
getDistSquare()
Returns a heuristic function that returns the square distance
dx^2 + dy^2 as a cost evaluation of the distance between two
pieces of the routing grid.
|
boolean |
getDontOptimizeLongRoutes()
Gets a value indicating whether the algorithm should spend time
to optimize long routes.
|
Orientation |
getEndOrientation()
Gets a value indicating whether routes should end in horizontal or
vertical direction.
|
float |
getGridSize()
Gets the size of the routing grid.
|
boolean |
getIgnoreAnchoring()
For internal use.
|
short |
getLengthCost()
Gets the value added to the total route cost for each grid square
occupied by the link.
|
static RouteHeuristics |
getMaxAbs()
Returns a heuristic function that returns max(dx, dy) as a cost
evaluation of the distance between two pieces of the routing grid.
|
short |
getNodeVicinityCost()
Gets the value added to the total route cost when a link passes
through the buffer area around a node.
|
float |
getNodeVicinitySize()
Gets the size of the buffer area around a node for which link routes
are assigned higher costs if they pass through that area.
|
PolylineRouting |
getPolylineRouting()
Gets a value indicating whether the end segments of polyline
links should be oriented orthogonally to node's borders and each other.
|
RouteHeuristics |
getRouteHeuristics()
Gets the heuristic function used by the routing algorithm to choose
next points in the route.
|
Orientation |
getStartOrientation()
Gets a value indicating whether routes should start in horizontal or
vertical direction.
|
java.util.EnumSet<RerouteLinks> |
getTriggerRerouting()
Gets a value indicating when JDiagram should look for new link routes.
|
short |
getTurnCost()
Gets the value added to the total route cost when a link makes a turn.
|
void |
setAnchoring(Anchoring value)
Sets a value indicating whether the routing algorithm should align
links to the anchor points of nodes.
|
void |
setAvoidOverlaps(boolean value)
Sets whether link segments should be pulled apart when they overlap in initially found routes.
|
void |
setCrossingCost(short value)
Sets the value added to the total route cost if a link crosses
another link.
|
void |
setDefaultMode()
Sets the routing cost parameters to their default values.
|
void |
setDontOptimizeLongRoutes(boolean value)
Sets a value indicating whether the algorithm should spend time
to optimize long routes.
|
void |
setEndOrientation(Orientation value)
Sets a value indicating whether routes should end in horizontal or
vertical direction.
|
void |
setGridSize(float value)
Sets the size of the routing grid.
|
void |
setLengthCost(short value)
Sets the value added to the total route cost for each grid square
occupied by the link.
|
void |
setMinSegmentsMode()
Sets the routing costs to values that find routes having
low number of segments.
|
void |
setNodeVicinityCost(short value)
Sets the value added to the total route cost when a link passes
through the buffer area around a node.
|
void |
setNodeVicinitySize(float value)
Sets the size of the buffer area around a node for which link routes
are assigned higher costs if they pass through that area.
|
void |
setPolylineRouting(PolylineRouting value)
Sets a value indicating whether the end segments of polyline
links should should be oriented orthogonally to node's borders and each other.
|
void |
setQuickMode()
Sets the routing costs to values that quickly find routes,
however with a lower route quality.
|
void |
setRouteHeuristics(RouteHeuristics value)
Sets the heuristic function used by the routing algorithm to choose
next points in the route.
|
void |
setStartOrientation(Orientation value)
Sets a value indicating whether routes should start in horizontal or
vertical direction.
|
void |
setTriggerRerouting(java.util.EnumSet<RerouteLinks> value)
Sets a value indicating when JDiagram should look for new link routes.
|
void |
setTurnCost(short value)
Sets the value added to the total route cost when a link makes a turn.
|
public void setDefaultMode()
public void setQuickMode()
public void setMinSegmentsMode()
public float getGridSize()
getGridSize
in interface RoutingOptions
public void setGridSize(float value)
setGridSize
in interface RoutingOptions
value
- A float value specifying the size of the routing grid pieces.public float getNodeVicinitySize()
public void setNodeVicinitySize(float value)
value
- A float value specifying the size of the buffer zone around a
node where a penalty cost is added to the cost of a passing link.public short getCrossingCost()
public void setCrossingCost(short value)
value
- An integer value added to the cost of a route
when a link crosses another link.public short getLengthCost()
getLengthCost
in interface RoutingOptions
public void setLengthCost(short value)
value
- An integer value added to the cost of a route for each routing
grid square through which the link passes.public short getNodeVicinityCost()
getNodeVicinityCost
in interface RoutingOptions
public void setNodeVicinityCost(short value)
value
- An integer value added to the cost of a route when the link
passes near a node.public short getTurnCost()
getTurnCost
in interface RoutingOptions
public void setTurnCost(short value)
value
- An integer value added to the cost of a route when
the link makes a turn.public boolean getDontOptimizeLongRoutes()
true
if the shape of long routes should not be
optimized, otherwise false
.public void setDontOptimizeLongRoutes(boolean value)
value
- true
if the shape of long routes should not be
optimized, otherwise false
.public boolean getAvoidOverlaps()
public void setAvoidOverlaps(boolean value)
value
- true to pull apart overlapping segments, or false otherwise.public java.util.EnumSet<RerouteLinks> getTriggerRerouting()
RerouteLinks
members.public void setTriggerRerouting(java.util.EnumSet<RerouteLinks> value)
value
- A combination of RerouteLinks
members.public Orientation getStartOrientation()
Orientation
enumeration.public void setStartOrientation(Orientation value)
value
- A member of the Orientation
enumeration.public Orientation getEndOrientation()
Orientation
enumeration.public void setEndOrientation(Orientation value)
value
- A member of the Orientation
enumeration.public Anchoring getAnchoring()
Anchoring
enumeration.public void setAnchoring(Anchoring value)
value
- A member of the Anchoring
enumeration.public boolean getIgnoreAnchoring()
getIgnoreAnchoring
in interface RoutingOptions
public PolylineRouting getPolylineRouting()
public void setPolylineRouting(PolylineRouting value)
value
- A member of the PolylineRouting enumeration.public RouteHeuristics getRouteHeuristics()
RouteHeuristics
object used to predict the route cost.public void setRouteHeuristics(RouteHeuristics value)
value
- A RouteHeuristics
object used to predict the route cost.public static RouteHeuristics getMaxAbs()
RouteHeuristics
object.public static RouteHeuristics getDistSquare()
RouteHeuristics
object.public static RouteHeuristics getDistance()
RouteHeuristics
object.