com.mindfusion.diagramming
Class RoutingOptions

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

public class RoutingOptions
extends java.lang.Object
implements RoutingOptions

An instance of this class accessible via the Diagram.getRoutingOptions() method lets you customize the behavior of the link routing algorithm.


Method Summary
 int getAnchoring()
          Gets a value indicating whether the routing algorithm should align links to the anchor points of nodes.
 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.
 int 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.
 RouteHeuristics getRouteHeuristics()
          Gets the heuristic function used by the routing algorithm to choose next points in the route.
 boolean getSmartPolylineEnds()
          Gets a value indicating whether the end segments of polyline links should be oriented orthogonally to the node bounds.
 int getStartOrientation()
          Gets a value indicating whether routes should start in horizontal or vertical direction.
 int 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(int value)
          Sets a value indicating whether the routing algorithm should align links to the anchor points of nodes.
 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(int 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 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 setSmartPolylineEnds(boolean value)
          Sets a value indicating whether the end segments of polyline links should be oriented orthogonally to the node bounds.
 void setStartOrientation(int value)
          Sets a value indicating whether routes should start in horizontal or vertical direction.
 void setTriggerRerouting(int 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

setDefaultMode

public void setDefaultMode()
Sets the routing cost parameters to their default values.


setQuickMode

public void setQuickMode()
Sets the routing costs to values that quickly find routes, however with a lower route quality.


setMinSegmentsMode

public void setMinSegmentsMode()
Sets the routing costs to values that find routes having low number of segments.


getGridSize

public float getGridSize()
Gets the size of the routing grid.

Specified by:
getGridSize in interface RoutingOptions
Returns:
A float value specifying the size of the routing grid pieces.

setGridSize

public void setGridSize(float value)
Sets the size of the routing grid.

Specified by:
setGridSize in interface RoutingOptions
Parameters:
value - A float value specifying the size of the routing grid pieces.

getNodeVicinitySize

public 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.

Returns:
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.

setNodeVicinitySize

public 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.

Parameters:
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.

getCrossingCost

public short getCrossingCost()
Gets the value added to the total route cost if a link crosses another link.

Returns:
An integer value added to the cost of a route when a link crosses another link.

setCrossingCost

public void setCrossingCost(short value)
Sets the value added to the total route cost if a link crosses another link.

Parameters:
value - An integer value added to the cost of a route when a link crosses another link.

getLengthCost

public short getLengthCost()
Gets the value added to the total route cost for each grid square occupied by the link.

Specified by:
getLengthCost in interface RoutingOptions
Returns:
An integer value added to the cost of a route for each routing grid square through which the link passes.

setLengthCost

public void setLengthCost(short value)
Sets the value added to the total route cost for each grid square occupied by the link.

Parameters:
value - An integer value added to the cost of a route for each routing grid square through which the link passes.

getNodeVicinityCost

public short getNodeVicinityCost()
Gets the value added to the total route cost when a link passes through the buffer area around a node.

Specified by:
getNodeVicinityCost in interface RoutingOptions
Returns:
An integer value added to the cost of a route when the link passes near a node.

setNodeVicinityCost

public void setNodeVicinityCost(short value)
Sets the value added to the total route cost when a link passes through the buffer area around a node.

Parameters:
value - An integer value added to the cost of a route when the link passes near a node.

getTurnCost

public short getTurnCost()
Gets the value added to the total route cost when a link makes a turn.

Specified by:
getTurnCost in interface RoutingOptions
Returns:
An integer value added to the cost of a route when the link makes a turn.

setTurnCost

public void setTurnCost(short value)
Sets the value added to the total route cost when a link makes a turn.

Parameters:
value - An integer value added to the cost of a route when the link makes a turn.

getDontOptimizeLongRoutes

public boolean getDontOptimizeLongRoutes()
Gets a value indicating whether the algorithm should spend time to optimize long routes.

Returns:
true if the shape of long routes should not be optimized, otherwise false.

setDontOptimizeLongRoutes

public void setDontOptimizeLongRoutes(boolean value)
Sets a value indicating whether the algorithm should spend time to optimize long routes.

Parameters:
value - true if the shape of long routes should not be optimized, otherwise false.

getTriggerRerouting

public int getTriggerRerouting()
Gets a value indicating when JDiagram should look for new link routes.

Returns:
A bitwise combination of the RerouteLinks constants.

setTriggerRerouting

public void setTriggerRerouting(int value)
Sets a value indicating when JDiagram should look for new link routes.

Parameters:
value - A bitwise combination of the RerouteLinks constants.

getStartOrientation

public int getStartOrientation()
Gets a value indicating whether routes should start in horizontal or vertical direction.

Returns:
One of the Orientation constants.

setStartOrientation

public void setStartOrientation(int value)
Sets a value indicating whether routes should start in horizontal or vertical direction.

Parameters:
value - One of the Orientation constants.

getEndOrientation

public int getEndOrientation()
Gets a value indicating whether routes should end in horizontal or vertical direction.

Returns:
One of the Orientation constants.

setEndOrientation

public void setEndOrientation(int value)
Sets a value indicating whether routes should end in horizontal or vertical direction.

Parameters:
value - One of the Orientation constants.

getAnchoring

public int getAnchoring()
Gets a value indicating whether the routing algorithm should align links to the anchor points of nodes.

Returns:
One of the Anchoring constants.

setAnchoring

public void setAnchoring(int value)
Sets a value indicating whether the routing algorithm should align links to the anchor points of nodes.

Parameters:
value - One of the Anchoring constants.

getIgnoreAnchoring

public boolean getIgnoreAnchoring()
For internal use.

Specified by:
getIgnoreAnchoring in interface RoutingOptions

getSmartPolylineEnds

public boolean getSmartPolylineEnds()
Gets a value indicating whether the end segments of polyline links should be oriented orthogonally to the node bounds.


setSmartPolylineEnds

public void setSmartPolylineEnds(boolean value)
Sets a value indicating whether the end segments of polyline links should be oriented orthogonally to the node bounds.

Parameters:
value -

getRouteHeuristics

public RouteHeuristics getRouteHeuristics()
Gets the heuristic function used by the routing algorithm to choose next points in the route.

Returns:
A RouteHeuristics object used to predict the route cost.

setRouteHeuristics

public void setRouteHeuristics(RouteHeuristics value)
Sets the heuristic function used by the routing algorithm to choose next points in the route.

Parameters:
value - A RouteHeuristics object used to predict the route cost.

getMaxAbs

public 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.

Returns:
A predefined RouteHeuristics object.

getDistSquare

public 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.

Returns:
A predefined RouteHeuristics object.

getDistance

public static RouteHeuristics getDistance()
Return a heuristic function that returns the real distance sqrt(dx^2 + dy^2) between two pieces of the routing grid.

Returns:
A predefined RouteHeuristics object.