Package | com.yworks.yfiles.layout.router |
Class | public class OrthogonalEdgeRouter |
Inheritance | OrthogonalEdgeRouter AbstractLayoutStage YObject Object |
Subclasses | ChannelEdgeRouter_OrthogonalShortestPathPathFinder |
Several LayoutStages can be used to enhance performance and/or functionality of this class, e.g. com.yworks.yfiles.layout.router.EdgeGroupRouterStage, com.yworks.yfiles.layout.router.GroupNodeRouterStage, com.yworks.yfiles.layout.router.ReducedSphereOfActionStage or com.yworks.yfiles.layout.router.PatchRouterStage.
This edge router will obey strong and weak port constraints. It expects the port constraints to be bound to the input graph by the data provider keys com.yworks.yfiles.layout.PortConstraintKeys.SOURCE_PORT_CONSTRAINT_KEY and com.yworks.yfiles.layout.PortConstraintKeys.TARGET_PORT_CONSTRAINT_KEY . Furthermore, this class supports the more advanced port constraint concept of com.yworks.yfiles.layout.PortCandidate s. It expects collections of port candidates to be bound to the input graph by the data provider keys com.yworks.yfiles.layout.PortCandidate.SOURCE_PCLIST_DPKEY and com.yworks.yfiles.layout.PortCandidate.TARGET_PCLIST_DPKEY.
The router often finds ideal routes in difficult situations like the one depicted below.
See also
Property | Defined By | ||
---|---|---|---|
badOrthogonal : Boolean
Getter:
Returns whether bad edges should be drawn in an orthogonal fashion. | OrthogonalEdgeRouter | ||
centerToSpaceRatio : Number
Getter:
Returns the currently set ratio between the two complementary weighting strategies center driven and space driven. | OrthogonalEdgeRouter | ||
considerNodeLabels : Boolean
Specifies whether or not node labels are taken into account when calculating edge paths (thereby preventing possible edge/node label overlaps). | OrthogonalEdgeRouter | ||
coreLayouter : Layouter
Specifies the core layouter. | AbstractLayoutStage | ||
coupledDistances : Boolean
Getter:
Returns whether the minimum distances are coupled. | OrthogonalEdgeRouter | ||
crossingCost : Number
Specifies the cost for each edge crossing of a routed path. | OrthogonalEdgeRouter | ||
customBorderCapacity : int
Getter:
Returns the currently set custom value for the capacity of the routing border around the graph's bounding box. | OrthogonalEdgeRouter | ||
enforceMonotonicPathRestrictions : Boolean
Getter:
Returns whether monotonic path restrictions (set with monotonicPathRestriction) should be enforced. | OrthogonalEdgeRouter | ||
gridOrigin : YPoint [read-only]
Returns a grid point coordinate used when grid routing is enabled. | OrthogonalEdgeRouter | ||
gridRouting : Boolean
Specifies whether or not to route edge segments on grid lines. | OrthogonalEdgeRouter | ||
gridSpacing : int
Specifies the grid spacing that is used when grid routing is enabled. | OrthogonalEdgeRouter | ||
innerPorts : Boolean
Specifies whether edge ports (that do not have a strong port constraint set) should lie inside the node's bounding box or on the node's border. | OrthogonalEdgeRouter | ||
localCrossingMinimization : Boolean
Getter:
Returns whether the local crossing minimization strategy is enabled. | OrthogonalEdgeRouter | ||
minimumDistance : int
Specifies the minimum distance between edge segments. | OrthogonalEdgeRouter | ||
minimumDistanceToNode : int
Specifies the minimum distance between edge segments and nodes. | OrthogonalEdgeRouter | ||
monotonicPathRestriction : int
Getter:
Returns the specified kind of monotonic path restrictions. | OrthogonalEdgeRouter | ||
rerouting : Boolean
Getter:
Returns whether rerouting bad edges is enabled. | OrthogonalEdgeRouter | ||
routingStyle : int
Getter:
Returns the currently set routing style. | OrthogonalEdgeRouter | ||
selectedEdgesDpKey : Object
Specifies the DataProvider key to mark edges as selected. | OrthogonalEdgeRouter | ||
selectedNodesDpKey : Object
Specifies the DataProvider key to mark nodes as selected. | OrthogonalEdgeRouter | ||
sphereOfAction : int
Getter:
Returns the currently set sphere of action specifier. | OrthogonalEdgeRouter | ||
useCustomBorderCapacity : Boolean
Getter:
Returns whether a custom value for the capacity of the routing border is used. | OrthogonalEdgeRouter |
Method | Defined By | ||
---|---|---|---|
OrthogonalEdgeRouter(init:Boolean = true)
Creates a new instance of the Orthogonal Edge Router. | OrthogonalEdgeRouter | ||
canLayout(graph:LayoutGraph):Boolean [override]
Returns true if the specified core layouter does, and also when there is no core layouter. | OrthogonalEdgeRouter | ||
doLayout(graph:LayoutGraph):void [override]
Main entrance to orthogonal edge routing. | OrthogonalEdgeRouter | ||
equals(o:Object):Boolean | YObject | ||
getClass():Class [override] | OrthogonalEdgeRouter | ||
hashCode():int | YObject | ||
[static]
Creates a new instance of the Orthogonal Edge Router. | OrthogonalEdgeRouter | ||
[static]
Convenience constructor to simultaneously set a core layout algorithm which will run before the orthogonal edge router. | OrthogonalEdgeRouter | ||
setGridOrigin(x:int, y:int):void
Sets a grid point coordinate used when grid routing is enabled. | OrthogonalEdgeRouter |
Method | Defined By | ||
---|---|---|---|
canLayoutCore(graph:LayoutGraph):Boolean
Queries the core layouter whether or not the given graph can be laid out. | AbstractLayoutStage | ||
checkGroupNodeSize(layout:GraphLayout, node:Object):void
This method throws an com.yworks.bridge.util.IllegalArgumentException if the width/height of the given group node object is zero. | OrthogonalEdgeRouter | ||
checkNodeSize(layout:GraphLayout, node:Object):void
This method throws an com.yworks.bridge.util.IllegalArgumentException if the width/height of the given node object is zero. | OrthogonalEdgeRouter | ||
doLayoutCore(graph:LayoutGraph):void
Invokes the layout routine of the core layouter. | AbstractLayoutStage | ||
initAbstractLayoutStage1():void | AbstractLayoutStage | ||
initAbstractLayoutStage2(core:Layouter):void | AbstractLayoutStage | ||
initOrthogonalEdgeRouter1():void
Initializes this object. | OrthogonalEdgeRouter | ||
initOrthogonalEdgeRouter2(core:Layouter):void
Initializes this object. | OrthogonalEdgeRouter |
Constant | Defined By | ||
---|---|---|---|
MONOTONIC_BOTH : int = 3 [static]
Constant that specifies monotonic path restrictions for edges. | OrthogonalEdgeRouter | ||
MONOTONIC_HORIZONTAL : int = 2 [static]
Constant that specifies monotonic path restrictions for edges. | OrthogonalEdgeRouter | ||
MONOTONIC_NONE : int = 0 [static]
Constant that specifies monotonic path restrictions for edges. | OrthogonalEdgeRouter | ||
MONOTONIC_VERTICAL : int = 1 [static]
Constant that specifies monotonic path restrictions for edges. | OrthogonalEdgeRouter | ||
ROUTE_ALL_EDGES : int = 0 [static]
Sphere of action specifier. | OrthogonalEdgeRouter | ||
ROUTE_EDGES_AT_SELECTED_NODES : int = 4 [static]
Sphere of action specifier. | OrthogonalEdgeRouter | ||
ROUTE_SELECTED_EDGES : int = 2 [static]
Sphere of action specifier. | OrthogonalEdgeRouter | ||
STYLE_ADHOC : int [static]
Routing style specifier. | OrthogonalEdgeRouter | ||
STYLE_BALANCED : int [static]
Routing style specifier. | OrthogonalEdgeRouter | ||
STYLE_PREFERMIDDLE : int [static]
Routing style specifier. | OrthogonalEdgeRouter | ||
STYLE_SHORTPATH : int [static]
Routing style specifier. | OrthogonalEdgeRouter |
badOrthogonal | property |
badOrthogonal:Boolean
Getter: Returns whether bad edges should be drawn in an orthogonal fashion.
Setter: Determines the way that edges which cannot be routed should be drawn. If set, edge paths are drawn in an orthogonal fashion. Otherwise the edge path is drawn as a straight line. Default setting is true
.
public function get badOrthogonal():Boolean
public function set badOrthogonal(value:Boolean):void
centerToSpaceRatio | property |
centerToSpaceRatio:Number
Getter: Returns the currently set ratio between the two complementary weighting strategies center driven and space driven.
Setter: Determines the ratio between two complementary weighting strategies, namely center driven and space driven weighting, when looking for an edge path. public function get centerToSpaceRatio():Number
public function set centerToSpaceRatio(value:Number):void
considerNodeLabels | property |
considerNodeLabels:Boolean
Specifies whether or not node labels are taken into account when calculating edge paths (thereby preventing possible edge/node label overlaps).
The default is false
.
public function get considerNodeLabels():Boolean
public function set considerNodeLabels(value:Boolean):void
coupledDistances | property |
coupledDistances:Boolean
Getter: Returns whether the minimum distances are coupled.
Setter: Specifies whether or not the minimum distances should be coupled. I.e., whether half the value set for the minimum distance between edge segments should automatically be used as the minimum distance between edge segments and nodes, or a custom value should be used instead.By default the minimum distances are coupled.
public function get coupledDistances():Boolean
public function set coupledDistances(value:Boolean):void
See also
crossingCost | property |
crossingCost:Number
Specifies the cost for each edge crossing of a routed path.
A cost of n
means that a path rather changes direction n
times than crossing the path of an edge. By default the cost is set to 0
and therefore no global crossing optimization is performed. Setting a higher value will activate global crossing minimization. A good trade-off between the number of direction changes and few crossings of a path is achieved by values between 1
and 3
.
public function get crossingCost():Number
public function set crossingCost(value:Number):void
customBorderCapacity | property |
customBorderCapacity:int
Getter: Returns the currently set custom value for the capacity of the routing border around the graph's bounding box.
Setter: Determines the custom value for the capacity of the routing border around the graph's bounding box. The routing border means the space left of the leftmost node, right of the rightmost node, above the topmost node, and below the bottommost node. By default this value is set to 5, i.e., the routing border accommodates up to 5 parallel edge paths left of the leftmost node, right of the rightmost node, etc. public function get customBorderCapacity():int
public function set customBorderCapacity(value:int):void
enforceMonotonicPathRestrictions | property |
enforceMonotonicPathRestrictions:Boolean
Getter: Returns whether monotonic path restrictions (set with monotonicPathRestriction) should be enforced.
Setter: Whether or not monotonic path restrictions (set with monotonicPathRestriction) should be enforced. Enabling this option guarantees monotonic edge paths even if this results in additional overlaps between edges and nodes. public function get enforceMonotonicPathRestrictions():Boolean
public function set enforceMonotonicPathRestrictions(value:Boolean):void
See also
gridOrigin | property |
gridOrigin:YPoint
[read-only] Returns a grid point coordinate used when grid routing is enabled.
public function get gridOrigin():YPoint
See also
gridRouting | property |
gridRouting:Boolean
Specifies whether or not to route edge segments on grid lines. By default this feature is disabled, i.e., "free" routing is enabled.
public function get gridRouting():Boolean
public function set gridRouting(value:Boolean):void
See also
gridSpacing | property |
gridSpacing:int
Specifies the grid spacing that is used when grid routing is enabled.
By default a spacing of 2
is set, which is also the minimum allowed spacing.
public function get gridSpacing():int
public function set gridSpacing(value:int):void
See also
innerPorts | property |
innerPorts:Boolean
Specifies whether edge ports (that do not have a strong port constraint set) should lie inside the node's bounding box or on the node's border. More specifically, "inside" means on the node's meridian for edges connecting to the left and right, and on the node's equator for edges connecting to the upper and lower side.
Default setting is false
.
public function get innerPorts():Boolean
public function set innerPorts(value:Boolean):void
localCrossingMinimization | property |
localCrossingMinimization:Boolean
Getter: Returns whether the local crossing minimization strategy is enabled.
Setter: Specifies whether or not a local crossing minimization strategy should be applied. By default this feature is enabled. public function get localCrossingMinimization():Boolean
public function set localCrossingMinimization(value:Boolean):void
minimumDistance | property |
minimumDistance:int
Specifies the minimum distance between edge segments.
By default a distance of 4
is set, which is also the minimum allowed distance.
public function get minimumDistance():int
public function set minimumDistance(value:int):void
See also
minimumDistanceToNode | property |
minimumDistanceToNode:int
Specifies the minimum distance between edge segments and nodes.
public function get minimumDistanceToNode():int
public function set minimumDistanceToNode(value:int):void
See also
monotonicPathRestriction | property |
monotonicPathRestriction:int
Getter: Returns the specified kind of monotonic path restrictions.
Setter: Specifies which kind of monotonic path restrictions should be applied. Possible values are MONOTONIC_NONE, MONOTONIC_VERTICAL, MONOTONIC_HORIZONTAL and MONOTONIC_BOTH. public function get monotonicPathRestriction():int
public function set monotonicPathRestriction(value:int):void
See also
rerouting | property |
rerouting:Boolean
Getter: Returns whether rerouting bad edges is enabled.
Setter: Specifies whether or not to enable a further crossing minimization optimization based on rerouting edges that cross many edges. By default this feature is not enabled. Activating this feature only makes sense if the global crossing cost is set to a value greater an0
.
public function get rerouting():Boolean
public function set rerouting(value:Boolean):void
See also
routingStyle | property |
routingStyle:int
Getter: Returns the currently set routing style.
Setter: Sets the preferred routing style for the edges to be routed. The default setting is STYLE_BALANCED. public function get routingStyle():int
public function set routingStyle(value:int):void
See also
selectedEdgesDpKey | property |
selectedEdgesDpKey:Object
Specifies the DataProvider
key to mark edges as selected.
By default, com.yworks.yfiles.layout.LayouterKeys.SELECTED_EDGES is used.
public function get selectedEdgesDpKey():Object
public function set selectedEdgesDpKey(value:Object):void
IllegalArgumentException — if the specified key is null .
|
See also
selectedNodesDpKey | property |
selectedNodesDpKey:Object
Specifies the DataProvider
key to mark nodes as selected.
By default, com.yworks.yfiles.layout.LayouterKeys.SELECTED_NODES is used.
public function get selectedNodesDpKey():Object
public function set selectedNodesDpKey(value:Object):void
IllegalArgumentException — if the specified key is null .
|
See also
sphereOfAction | property |
sphereOfAction:int
Getter: Returns the currently set sphere of action specifier.
Setter: Sets the edge (sub-)set to be routed. Default setting is ROUTE_ALL_EDGES. public function get sphereOfAction():int
public function set sphereOfAction(value:int):void
See also
useCustomBorderCapacity | property |
useCustomBorderCapacity:Boolean
Getter: Returns whether a custom value for the capacity of the routing border is used.
Setter: Specifies whether or not a custom value for the capacity of the routing border around the graph's bounding box should be applied. Default setting is false
.
public function get useCustomBorderCapacity():Boolean
public function set useCustomBorderCapacity(value:Boolean):void
See also
OrthogonalEdgeRouter | () | Constructor |
public function OrthogonalEdgeRouter(init:Boolean = true)
Creates a new instance of the Orthogonal Edge Router. The initial settings (the default values) make up an instance that:
init:Boolean (default = true ) — An internally used switch to help handle proper instance initialization in inheritance chains where classes can have multiple constructor-like factory methods.
This parameter can safely be ignored/omitted when calling the constructor.
|
See also
canLayout | () | method |
override public function canLayout(graph:LayoutGraph):Boolean
Returns true
if the specified core layouter does, and also when there is no core layouter.
Parameters
graph:LayoutGraph |
Boolean |
checkGroupNodeSize | () | method |
protected function checkGroupNodeSize(layout:GraphLayout, node:Object):void
This method throws an com.yworks.bridge.util.IllegalArgumentException if the width/height of the given group node object is zero. It is called by the doLayout() method for each group node object in the input graph.
Parameters
layout:GraphLayout — a graph layout object.
| |
node:Object — the group node object to test.
|
IllegalArgumentException — thrown if the width/height of the group node object is zero.
|
See also
checkNodeSize | () | method |
protected function checkNodeSize(layout:GraphLayout, node:Object):void
This method throws an com.yworks.bridge.util.IllegalArgumentException if the width/height of the given node object is zero. It is called by the doLayout() method for each node object in the input graph.
Parameters
layout:GraphLayout — a graph layout object.
| |
node:Object — the node object to test.
|
IllegalArgumentException — thrown if the width/height of the node object is zero.
|
See also
doLayout | () | method |
override public function doLayout(graph:LayoutGraph):void
Main entrance to orthogonal edge routing. Routes the edges of the given graph.
Parameters
graph:LayoutGraph |
getClass | () | method |
override public function getClass():Class
ReturnsClass |
initOrthogonalEdgeRouter1 | () | method |
protected final function initOrthogonalEdgeRouter1():void
Initializes this object. See the documentation of the corresponding factory method newOrthogonalEdgeRouter1()
for details.
See also
initOrthogonalEdgeRouter2 | () | method |
protected final function initOrthogonalEdgeRouter2(core:Layouter):void
Initializes this object. See the documentation of the corresponding factory method newOrthogonalEdgeRouter2()
for details.
Parameters
core:Layouter |
See also
newOrthogonalEdgeRouter1 | () | method |
public static function newOrthogonalEdgeRouter1():OrthogonalEdgeRouter
Creates a new instance of the Orthogonal Edge Router. The initial settings (the default values) make up an instance that:
OrthogonalEdgeRouter |
See also
newOrthogonalEdgeRouter2 | () | method |
public static function newOrthogonalEdgeRouter2(core:Layouter):OrthogonalEdgeRouter
Convenience constructor to simultaneously set a core layout algorithm which will run before the orthogonal edge router.
Parameters
core:Layouter |
OrthogonalEdgeRouter |
See also
setGridOrigin | () | method |
public function setGridOrigin(x:int, y:int):void
Sets a grid point coordinate used when grid routing is enabled.
By default (0, 0)
is set.
Parameters
x:int | |
y:int |
See also
MONOTONIC_BOTH | Constant |
public static const MONOTONIC_BOTH:int = 3
Constant that specifies monotonic path restrictions for edges. This constant specifies restrictions for the horizontal and vertical direction, i.e., each horizontal as well as each vertical edge segment is directed from the source to the target.
See also
MONOTONIC_HORIZONTAL | Constant |
public static const MONOTONIC_HORIZONTAL:int = 2
Constant that specifies monotonic path restrictions for edges. This constant specifies restrictions for the horizontal direction, i.e., each horizontal edge segment is directed from the source to the target. Furthermore, each edge path starts and ends with a horizontal segment.
See also
MONOTONIC_NONE | Constant |
public static const MONOTONIC_NONE:int = 0
Constant that specifies monotonic path restrictions for edges. This constant specifies that there are no restrictions.
See also
MONOTONIC_VERTICAL | Constant |
public static const MONOTONIC_VERTICAL:int = 1
Constant that specifies monotonic path restrictions for edges. This constant specifies restrictions for the vertical direction, i.e., each vertical edge segment is directed from the source to the target. Furthermore, each edge path starts and ends with a vertical segment.
See also
ROUTE_ALL_EDGES | Constant |
public static const ROUTE_ALL_EDGES:int = 0
Sphere of action specifier. Route all edges of the input graph.
See also
ROUTE_EDGES_AT_SELECTED_NODES | Constant |
public static const ROUTE_EDGES_AT_SELECTED_NODES:int = 4
Sphere of action specifier. Route only edges connected to selected nodes. The selection state of a node is determined by a boolean value returned by the data provider associated with the data provider key selectedNodesDpKey.
See also
ROUTE_SELECTED_EDGES | Constant |
public static const ROUTE_SELECTED_EDGES:int = 2
Sphere of action specifier. Route only selected edges of the input graph. The selection state of an edge is determined by a boolean value returned by the data provider associated with the data provider key selectedEdgesDpKey.
See also
STYLE_ADHOC | Constant |
public static const STYLE_ADHOC:int
Routing style specifier. Edge segments are drawn ad hoc, i.e., rather crude.
See also
STYLE_BALANCED | Constant |
public static const STYLE_BALANCED:int
Routing style specifier. Similar to STYLE_PREFERMIDDLE for the two end segments and segments between bends of different directions. Segments between bends of the same direction (u-shaped turns) are drawn the short way. This style achieves a well-balanced routing and is used by default.
See also
STYLE_PREFERMIDDLE | Constant |
public static const STYLE_PREFERMIDDLE:int
Routing style specifier. Edge segments are drawn with the most distance to already known obstacles such as nodes or other edge segments.
See also
STYLE_SHORTPATH | Constant |
public static const STYLE_SHORTPATH:int
Routing style specifier. Edge segments are drawn the short way, i.e., with the global way of the edge in mind.
See also