Packagecom.yworks.yfiles.layout.router.polyline
Classpublic class EdgeRouter
InheritanceEdgeRouter Inheritance AbstractLayoutStage Inheritance YObject Inheritance Object

This class represents a polyline edge router which calculates an edge layout containing only straight segments. The router does not change the location or the size of the nodes in a diagram in any way.

Edges can be routed orthogonally, i.e. only horizontal and vertical segments, or with additional segments with other slopes. Polyline routing can be activated using polylineRouting.

In both routing styles, edges can be grouped so they share common segments in the beginning or end of their routes. Edges are marked as grouped by using the data provider keys com.yworks.yfiles.layout.PortConstraintKeys.SOURCE_GROUPID_KEY (for source grouped edges) or com.yworks.yfiles.layout.PortConstraintKeys.TARGET_GROUPID_KEY (for target grouped edges).

Many settings of the edge layout can be controlled individually for every edge using com.yworks.yfiles.layout.router.polyline.EdgeLayoutDescriptor instances. So, if at the time of the invocation a com.yworks.yfiles.base.DataProvider instance is bound to the graph using the EDGE_LAYOUT_DESCRIPTOR_DPKEY key, the EdgeLayoutDescriptors provided for the individual edges are used. Whenever no descriptor is provided for an edge, a default edge layout descriptor is used as fall-back value. This edge layout descriptor can be obtained with defaultEdgeLayoutDescriptor.

EdgeRouter supports two approaches to connect edges on a specific side or even an exact location to a node. com.yworks.yfiles.layout.PortConstraint s define a single constraint for the ports of an edge. To realize more complex port restrictions, several com.yworks.yfiles.layout.PortCandidate s or com.yworks.yfiles.layout.PortCandidateSet s can be assigned to edges or nodes. If an edge with registered PortCandidates connects to nodes with PortCandidateSets, the layouter will try to match both collections to find an appropriate port. In case there is no matching port candidate, a PortCandidate specified for the edge is preferred. Since their simultaneous existence at the same node may be ambiguous, it is not recommended to use a combination of PortConstraints and PortCandidates in the same layout.

com.yworks.yfiles.layout.router.polyline.EdgeRouter coordinates all settings and steps that are needed to achieve a polylinear or orthogonal edge routing. There are three steps that are executed in the following order:

  1. Dividing the graph's area into several rectangular cells (see: com.yworks.yfiles.layout.router.polyline.Partition, com.yworks.yfiles.layout.router.polyline.GraphPartition, com.yworks.yfiles.layout.router.polyline.PartitionCell).
  2. Finding the shortest/cheapest paths for all edges through the Partition (see: com.yworks.yfiles.layout.router.polyline.PathSearch, com.yworks.yfiles.layout.router.polyline.Path).
  3. Assigning coordinates to the edges' segments based on the paths that were calculated before (see: com.yworks.yfiles.layout.router.polyline.ChannelBasedPathRouting).
It is possible to customize the first two steps by adding extensions for Partition (registeredPartitionExtensions) or for PathSearch (registeredPathSearchExtensions), respectively. com.yworks.yfiles.layout.router.polyline.GraphPartitionExtension s add obstacles which the PathSearch will consider. They also can add some information to PartitionCells that, for example, specifies whether or not the PartitionCell belongs to a node. PathSearchExtension (com.yworks.yfiles.layout.router.polyline.PathSearchExtension) s influence the PathSearch by adding costs for traversing specified PartitionCells or narrowing their intervals to allow a less expensive traversal of a PartitionCell. For example, the PathSearch adds costs to a PartitionCell that was marked as an obstacle that belongs to a node, so the edge will avoid the node.

See also

polylineRouting
com.yworks.yfiles.layout.PortConstraintKeys.SOURCE_GROUPID_KEY
com.yworks.yfiles.layout.PortConstraintKeys.TARGET_GROUPID_KEY
com.yworks.yfiles.layout.router.polyline.EdgeLayoutDescriptor
com.yworks.yfiles.base.DataProvider
EDGE_LAYOUT_DESCRIPTOR_DPKEY
defaultEdgeLayoutDescriptor
com.yworks.yfiles.layout.PortConstraint
com.yworks.yfiles.layout.PortCandidate
com.yworks.yfiles.layout.PortCandidateSet
com.yworks.yfiles.layout.router.polyline.EdgeRouter
com.yworks.yfiles.layout.router.polyline.Partition
com.yworks.yfiles.layout.router.polyline.GraphPartition
com.yworks.yfiles.layout.router.polyline.PartitionCell
com.yworks.yfiles.layout.router.polyline.PathSearch
com.yworks.yfiles.layout.router.polyline.Path
com.yworks.yfiles.layout.router.polyline.ChannelBasedPathRouting
for Partition
for PathSearch
com.yworks.yfiles.layout.router.polyline.GraphPartitionExtension
PathSearchExtension


Public Properties
 PropertyDefined By
  considerEdgeLabelsEnabled : Boolean
Determines whether or not this edge router considers labels of edges that are not in the edge (sub-)set to be routed (see sphereOfAction.
EdgeRouter
  considerNodeLabelsEnabled : Boolean
Determines whether or not this edge router considers node labels as obstacles for edge routes.
EdgeRouter
 InheritedcoreLayouter : Layouter
Specifies the core layouter.
AbstractLayoutStage
  defaultEdgeLayoutDescriptor : EdgeLayoutDescriptor
[read-only] Returns the com.yworks.yfiles.layout.router.polyline.EdgeLayoutDescriptor instance used for all those edges, that do not have a specific layout descriptor assigned.
EdgeRouter
  edgeOrderComparator : Comparator
Specifies the custom java.util.Comparator used to sort the edges of the graph to determine the processing order of the edges.
EdgeRouter
  grid : Grid
Getter: Returns the com.yworks.yfiles.layout.router.polyline.Grid the edge router tries to place the orthogonal segments on.
EdgeRouter
  ignoreInnerNodeLabelsEnabled : Boolean
Determines whether or not this edge router ignores node labels that are inside the bounds of their owner as obstacles for edge routes.
EdgeRouter
  maximumDuration : LongImpl
Getter: Returns the time limit (in milliseconds) set for the layout algorithm.
EdgeRouter
  maximumPolylineSegmentRatio : Number
Specifies the maximum segment length ratio at each end of an orthogonal segment that may get converted into a (non-orthogonal) polyline segment.
EdgeRouter
  minimalNodeToEdgeDistance : Number
Determines the minimal distance between edges and node bounds.
EdgeRouter
  partition : GraphPartition
[read-only] Returns the com.yworks.yfiles.layout.router.polyline.GraphPartition used during the layout.
EdgeRouter
  polylineRouting : Boolean
Determines whether or not this edge router creates (non-orthogonal) polyline segments.
EdgeRouter
  preferredPolylineSegmentLength : Number
Specifies the preferred length of (non-orthogonal) polyline segments.
EdgeRouter
  registeredPartitionExtensions : List
[read-only] Returns a list containing all registered com.yworks.yfiles.layout.router.polyline.GraphPartitionExtension s.
EdgeRouter
  registeredPathSearchExtensions : List
[read-only] Returns a list containing all registered com.yworks.yfiles.layout.router.polyline.PathSearchExtension s.
EdgeRouter
  rerouting : Boolean
Determines whether or not the edge router uses an additional step to reroute those edges that are considered to have the worst paths.
EdgeRouter
  selectedEdgesDpKey : Object
Specifies the data provider key used to look up the selected state of the edges of the graph to be laid out.
EdgeRouter
  selectedNodesDpKey : Object
Specifies the data provider key used to look up the selected state of the nodes of the graph to be laid out.
EdgeRouter
  sphereOfAction : int
Getter: Returns the currently set sphere of action specifier.
EdgeRouter
Public Methods
 MethodDefined By
  
EdgeRouter(init:Boolean = true)
Creates a new EdgeRouter instance.
EdgeRouter
  
canLayout(graph:LayoutGraph):Boolean
[override]
EdgeRouter
  
doLayout(graph:LayoutGraph):void
[override]
EdgeRouter
 Inherited
equals(o:Object):Boolean
YObject
  
getClass():Class
[override]
EdgeRouter
 Inherited
hashCode():int
YObject
  
[static] Creates a new EdgeRouter instance.
EdgeRouter
  
[static] Creates a new EdgeRouter instance with the given core Layouter.
EdgeRouter
Protected Methods
 MethodDefined By
 Inherited
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.
EdgeRouter
  
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.
EdgeRouter
  
Cleans up the given com.yworks.yfiles.layout.router.polyline.GraphPartition.
EdgeRouter
  
Configures the given com.yworks.yfiles.layout.router.polyline.GraphPartition.
EdgeRouter
  
Configures the given com.yworks.yfiles.layout.router.polyline.PathSearch.
EdgeRouter
  
Creates the com.yworks.yfiles.layout.router.polyline.PathSearchConfiguration that is used during the path search.
EdgeRouter
  
Creates and returns the default java.util.Comparator used to determine the order the edges of the graph are laid out with.
EdgeRouter
  
Creates a com.yworks.yfiles.layout.router.polyline.GraphPartition that divides the area of the graph into several rectangles.
EdgeRouter
  
Creates a com.yworks.yfiles.layout.router.polyline.DynamicObstacleDecomposition that is used by the com.yworks.yfiles.layout.router.polyline.GraphPartition to divide the graph area in rectangles.
EdgeRouter
  
Creates a com.yworks.yfiles.layout.router.polyline.ChannelBasedPathRouting that routes the edges using pre-calculated com.yworks.yfiles.layout.router.polyline.Path objects.
EdgeRouter
  
Creates a com.yworks.yfiles.layout.router.polyline.PathSearch that finds the edges' paths through the com.yworks.yfiles.layout.router.polyline.GraphPartition.
EdgeRouter
  
Creates a com.yworks.yfiles.layout.router.polyline.PathSearchContext that provides context information for the path search algorithm.
EdgeRouter
 Inherited
Invokes the layout routine of the core layouter.
AbstractLayoutStage
  
Returns the com.yworks.yfiles.layout.router.polyline.EdgeLayoutDescriptor provided by the com.yworks.yfiles.base.DataProvider with the key EDGE_LAYOUT_DESCRIPTOR_DPKEY for the given edge.
EdgeRouter
 Inherited
AbstractLayoutStage
 Inherited
AbstractLayoutStage
  
Initializes this object.
EdgeRouter
  
Initializes this object.
EdgeRouter
  
isSelected(e:Edge, graph:Graph):Boolean
Utility method that returns the selection state of the given edge.
EdgeRouter
Public Constants
 ConstantDefined By
  EDGE_LAYOUT_DESCRIPTOR_DPKEY : String = y.layout.router.polyline.EdgeRouter.EDGE_LAYOUT_DESCRIPTOR_DPKEY
[static] com.yworks.yfiles.base.DataProvider key used to store the com.yworks.yfiles.layout.router.polyline.EdgeLayoutDescriptor for each edge.
EdgeRouter
  LABEL_CROSSING_COST_FACTOR_DPKEY : String = y.layout.router.polyline.EdgeRouter.LABEL_CROSSING_COST_FACTOR_DPKEY
[static] com.yworks.yfiles.base.DataProvider key used to store a cost factor for each label.
EdgeRouter
  ROUTE_ALL_EDGES : int = 0
[static] Sphere of action specifier.
EdgeRouter
  ROUTE_EDGES_AT_SELECTED_NODES : int = 4
[static] Sphere of action specifier.
EdgeRouter
  ROUTE_SELECTED_EDGES : int = 2
[static] Sphere of action specifier.
EdgeRouter
Property Detail
considerEdgeLabelsEnabledproperty
considerEdgeLabelsEnabled:Boolean

Determines whether or not this edge router considers labels of edges that are not in the edge (sub-)set to be routed (see sphereOfAction.

By default edge labels are not considered.


Implementation
    public function get considerEdgeLabelsEnabled():Boolean
    public function set considerEdgeLabelsEnabled(value:Boolean):void

See also

considerNodeLabelsEnabledproperty 
considerNodeLabelsEnabled:Boolean

Determines whether or not this edge router considers node labels as obstacles for edge routes.

By default node labels are not considered.


Implementation
    public function get considerNodeLabelsEnabled():Boolean
    public function set considerNodeLabelsEnabled(value:Boolean):void

See also

defaultEdgeLayoutDescriptorproperty 
defaultEdgeLayoutDescriptor:EdgeLayoutDescriptor  [read-only]

Returns the com.yworks.yfiles.layout.router.polyline.EdgeLayoutDescriptor instance used for all those edges, that do not have a specific layout descriptor assigned.


Implementation
    public function get defaultEdgeLayoutDescriptor():EdgeLayoutDescriptor

See also

edgeOrderComparatorproperty 
edgeOrderComparator:Comparator

Specifies the custom java.util.Comparator used to sort the edges of the graph to determine the processing order of the edges.

The processing order may influence the quality of the individual edge paths. When routing an edge, only the paths of already routed edges and fixed edges (that are not routed at all) can be considered. Therefore earlier edges have to consider less other edge paths then later edges which might have to use less optimal alternative paths.

The default is null and the comparator returned by createDefaultEdgeOrderComparator() is used.


Implementation
    public function get edgeOrderComparator():Comparator
    public function set edgeOrderComparator(value:Comparator):void

See also

gridproperty 
grid:Grid

Getter: Returns the com.yworks.yfiles.layout.router.polyline.Grid the edge router tries to place the orthogonal segments on.

By default no grid is specified, so null will be returned.

Setter: Specifies the com.yworks.yfiles.layout.router.polyline.Grid on which orthogonal segments are placed.


Implementation
    public function get grid():Grid
    public function set grid(value:Grid):void

See also

ignoreInnerNodeLabelsEnabledproperty 
ignoreInnerNodeLabelsEnabled:Boolean

Determines whether or not this edge router ignores node labels that are inside the bounds of their owner as obstacles for edge routes.

This setting has only an effect if node labels shall be considered (considerNodeLabelsEnabled) at all and is especially useful to ignore inner node labels of group nodes.

Per default, this option is disabled.


Implementation
    public function get ignoreInnerNodeLabelsEnabled():Boolean
    public function set ignoreInnerNodeLabelsEnabled(value:Boolean):void

See also

maximumDurationproperty 
maximumDuration:LongImpl

Getter: Returns the time limit (in milliseconds) set for the layout algorithm.

By default no time limit is set.

Setter: Sets a preferred time limit (>= 0 and in milliseconds) for the layout algorithm.

Note that restricting the maximum duration may result in a worse layout quality. Furthermore, the actual runtime may exceed the maximum duration since the layout algorithm still has to find a valid solution.

By default no time limit is set.


Implementation
    public function get maximumDuration():LongImpl
    public function set maximumDuration(value:LongImpl):void
maximumPolylineSegmentRatioproperty 
maximumPolylineSegmentRatio:Number

Specifies the maximum segment length ratio at each end of an orthogonal segment that may get converted into a (non-orthogonal) polyline segment.

By default the maximum ratio for polyline segments is 0.3.


Implementation
    public function get maximumPolylineSegmentRatio():Number
    public function set maximumPolylineSegmentRatio(value:Number):void
minimalNodeToEdgeDistanceproperty 
minimalNodeToEdgeDistance:Number

Determines the minimal distance between edges and node bounds.

By default the minimal node to edge distance is 10.


Implementation
    public function get minimalNodeToEdgeDistance():Number
    public function set minimalNodeToEdgeDistance(value:Number):void

See also

partitionproperty 
partition:GraphPartition  [read-only]

Returns the com.yworks.yfiles.layout.router.polyline.GraphPartition used during the layout.


Implementation
    public function get partition():GraphPartition

See also

polylineRoutingproperty 
polylineRouting:Boolean

Determines whether or not this edge router creates (non-orthogonal) polyline segments.

By default polyline edge routing is disabled.


Implementation
    public function get polylineRouting():Boolean
    public function set polylineRouting(value:Boolean):void

See also

preferredPolylineSegmentLengthproperty 
preferredPolylineSegmentLength:Number

Specifies the preferred length of (non-orthogonal) polyline segments.

Note that this restriction isn't used for orthogonal segments.

By default the preferred polyline segment length is 30.


Implementation
    public function get preferredPolylineSegmentLength():Number
    public function set preferredPolylineSegmentLength(value:Number):void

See also

registeredPartitionExtensionsproperty 
registeredPartitionExtensions:List  [read-only]

Returns a list containing all registered com.yworks.yfiles.layout.router.polyline.GraphPartitionExtension s.

GraphPartitionExtensions can be added and removed to change the composition of extensions used by the com.yworks.yfiles.layout.router.polyline.GraphPartition.


Implementation
    public function get registeredPartitionExtensions():List

See also

registeredPathSearchExtensionsproperty 
registeredPathSearchExtensions:List  [read-only]

Returns a list containing all registered com.yworks.yfiles.layout.router.polyline.PathSearchExtension s.

com.yworks.yfiles.layout.router.polyline.PathSearchExtension can be added and removed to change the composition of extensions used by the com.yworks.yfiles.layout.router.polyline.PathSearch.


Implementation
    public function get registeredPathSearchExtensions():List

See also

reroutingproperty 
rerouting:Boolean

Determines whether or not the edge router uses an additional step to reroute those edges that are considered to have the worst paths.

Rerouting is only used, if the maximumDuration isn't exceeded, yet.

By default rerouting is disabled.


Implementation
    public function get rerouting():Boolean
    public function set rerouting(value:Boolean):void

See also

selectedEdgesDpKeyproperty 
selectedEdgesDpKey:Object

Specifies the data provider key used to look up the selected state of the edges of the graph to be laid out. By default, com.yworks.yfiles.layout.LayouterKeys.SELECTED_EDGES is used.

If the sphere of action is set to ROUTE_SELECTED_EDGES, only the selected keys are routed while all other edges are considered to have fixed routes.


Implementation
    public function get selectedEdgesDpKey():Object
    public function set selectedEdgesDpKey(value:Object):void

Throws
IllegalArgumentException — if the specified key is null.

See also

selectedNodesDpKeyproperty 
selectedNodesDpKey:Object

Specifies the data provider key used to look up the selected state of the nodes of the graph to be laid out. By default, com.yworks.yfiles.layout.LayouterKeys.SELECTED_NODES is used.

If the sphere of action is set to ROUTE_EDGES_AT_SELECTED_NODES, only edges of selected nodes are routed while all other edges are considered to have fixed routes.


Implementation
    public function get selectedNodesDpKey():Object
    public function set selectedNodesDpKey(value:Object):void

Throws
IllegalArgumentException — if the specified key is null.

See also

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


Implementation
    public function get sphereOfAction():int
    public function set sphereOfAction(value:int):void

Throws
IllegalArgumentException — if the given argument is not one of the above constants.

See also

Constructor Detail
EdgeRouter()Constructor
public function EdgeRouter(init:Boolean = true)

Creates a new EdgeRouter instance.

Parameters
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.
Method Detail
canLayout()method
override public function canLayout(graph:LayoutGraph):Boolean

Parameters

graph:LayoutGraph

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


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


Throws
IllegalArgumentException — thrown if the width/height of the node object is zero.

See also

cleanupGraphPartition()method 
protected function cleanupGraphPartition(partition:GraphPartition):void

Cleans up the given com.yworks.yfiles.layout.router.polyline.GraphPartition.

This implementation gets all registered com.yworks.yfiles.layout.router.polyline.GraphPartitionExtension s and removes them from the given GraphPartition. It may be overridden to adjust the configuration of the GraphPartition.

Parameters

partition:GraphPartition — the partition that shall be configured

See also

configureGraphPartition()method 
protected function configureGraphPartition(partition:GraphPartition):void

Configures the given com.yworks.yfiles.layout.router.polyline.GraphPartition.

This implementation gets all registered com.yworks.yfiles.layout.router.polyline.GraphPartitionExtension s and adds them to the given GraphPartition. It may be overridden to adjust the configuration of the GraphPartition.

Parameters

partition:GraphPartition — the partition that shall be configured

See also

configurePathSearch()method 
protected function configurePathSearch(pathSearch:PathSearch):void

Configures the given com.yworks.yfiles.layout.router.polyline.PathSearch.

This implementation gets all registered com.yworks.yfiles.layout.router.polyline.PathSearchExtension s and adds them to the given PathSearch. It may be overridden to adjust the configuration of the PathSearch.

Parameters

pathSearch:PathSearch — the path search that shall be configured

See also

createConfiguration()method 
protected function createConfiguration(graph:LayoutGraph, grouping:GraphGrouping):PathSearchConfiguration

Creates the com.yworks.yfiles.layout.router.polyline.PathSearchConfiguration that is used during the path search.

This implementation creates a new PathSearchConfiguration. May be overridden to use a subclassed configuration.

Parameters

graph:LayoutGraph
 
grouping:GraphGrouping

Returns
PathSearchConfiguration — A new PathSearchConfiguration.

See also

createDefaultEdgeOrderComparator()method 
protected function createDefaultEdgeOrderComparator(graph:LayoutGraph, configuration:PathSearchConfiguration):Comparator

Creates and returns the default java.util.Comparator used to determine the order the edges of the graph are laid out with.

Parameters

graph:LayoutGraph — The graph that contains the edges to compare.
 
configuration:PathSearchConfiguration — The configuration to use for the following path searches.

Returns
Comparator — A comparator ordering edges to determine the order the edges of the graph are laid out with.

See also

java.util.Comparator
createGraphPartition()method 
protected function createGraphPartition(decomposition:ObstaclePartition):GraphPartition

Creates a com.yworks.yfiles.layout.router.polyline.GraphPartition that divides the area of the graph into several rectangles.

This implementation creates a GraphPartition using the current com.yworks.yfiles.layout.router.polyline.ObstaclePartition . It may be overridden to customize the partition used in EdgeRouter.

Parameters

decomposition:ObstaclePartition

Returns
GraphPartition — a new GraphPartition

See also

createObstacleDecomposition()method 
protected function createObstacleDecomposition():DynamicObstacleDecomposition

Creates a com.yworks.yfiles.layout.router.polyline.DynamicObstacleDecomposition that is used by the com.yworks.yfiles.layout.router.polyline.GraphPartition to divide the graph area in rectangles.

This implementation creates a new DynamicObstacleDecomposition. May be overridden to customize the area decomposition.

Returns
DynamicObstacleDecomposition — A new DynamicObstacleDecomposition

See also

createPathRouting()method 
protected function createPathRouting():ChannelBasedPathRouting

Creates a com.yworks.yfiles.layout.router.polyline.ChannelBasedPathRouting that routes the edges using pre-calculated com.yworks.yfiles.layout.router.polyline.Path objects.

This implementation creates a new ChannelBasedPathRouting. May be overridden to customize the path routing.

Returns
ChannelBasedPathRouting — A new ChannelBasedPathRouting

See also

createPathSearch()method 
protected function createPathSearch():PathSearch

Creates a com.yworks.yfiles.layout.router.polyline.PathSearch that finds the edges' paths through the com.yworks.yfiles.layout.router.polyline.GraphPartition.

This implementation creates a new PathSearch. May be overridden to customize the path search.

Returns
PathSearch — a new PathSearch

See also

createPathSearchContext()method 
protected function createPathSearchContext(pathSearch:PathSearch, configuration:PathSearchConfiguration):PathSearchContext

Creates a com.yworks.yfiles.layout.router.polyline.PathSearchContext that provides context information for the path search algorithm.

This implementation creates a new PathSearchContext. May be overridden to customize the context information providing.

Parameters

pathSearch:PathSearch — The path search that uses the context to be created.
 
configuration:PathSearchConfiguration — The configuration used for the path search.

Returns
PathSearchContext — A new PathSearchContext

See also

doLayout()method 
override public function doLayout(graph:LayoutGraph):void

Parameters

graph:LayoutGraph

getClass()method 
override public function getClass():Class

Returns
Class
getEdgeLayoutDescriptor()method 
protected function getEdgeLayoutDescriptor(edge:Edge):EdgeLayoutDescriptor

Returns the com.yworks.yfiles.layout.router.polyline.EdgeLayoutDescriptor provided by the com.yworks.yfiles.base.DataProvider with the key EDGE_LAYOUT_DESCRIPTOR_DPKEY for the given edge.

For all those edges, that do not have a specific layout descriptor assigned, the default descriptor is returned.

Parameters

edge:Edge — The edge to return the layout descriptor for.

Returns
EdgeLayoutDescriptor — The layout descriptor used for the given edge.

See also

initEdgeRouter1()method 
protected final function initEdgeRouter1():void

Initializes this object. See the documentation of the corresponding factory method newEdgeRouter1() for details.

See also

initEdgeRouter2()method 
protected final function initEdgeRouter2(core:Layouter):void

Initializes this object. See the documentation of the corresponding factory method newEdgeRouter2() for details.

Parameters

core:Layouter

See also

isSelected()method 
protected function isSelected(e:Edge, graph:Graph):Boolean

Utility method that returns the selection state of the given edge.

If the sphere of action is ROUTE_ALL_EDGES, true is returned for all edges.

Parameters

e:Edge
 
graph:Graph

Returns
Boolean

See also

newEdgeRouter1()method 
public static function newEdgeRouter1():EdgeRouter

Creates a new EdgeRouter instance.

Returns
EdgeRouter
newEdgeRouter2()method 
public static function newEdgeRouter2(core:Layouter):EdgeRouter

Creates a new EdgeRouter instance with the given core Layouter.

Parameters

core:Layouter

Returns
EdgeRouter
Constant Detail
EDGE_LAYOUT_DESCRIPTOR_DPKEYConstant
public static const EDGE_LAYOUT_DESCRIPTOR_DPKEY:String = y.layout.router.polyline.EdgeRouter.EDGE_LAYOUT_DESCRIPTOR_DPKEY

com.yworks.yfiles.base.DataProvider key used to store the com.yworks.yfiles.layout.router.polyline.EdgeLayoutDescriptor for each edge. If there is no descriptor mapped for an edge, the default descriptor is used.

See also

LABEL_CROSSING_COST_FACTOR_DPKEYConstant 
public static const LABEL_CROSSING_COST_FACTOR_DPKEY:String = y.layout.router.polyline.EdgeRouter.LABEL_CROSSING_COST_FACTOR_DPKEY

com.yworks.yfiles.base.DataProvider key used to store a cost factor for each label.

This factor is multiplied with the basic penalty for an edge crossing a node label (com.yworks.yfiles.layout.router.polyline.PenaltySettings.nodeLabelCrossingPenalty) or edge label (com.yworks.yfiles.layout.router.polyline.PenaltySettings.edgeLabelCrossingPenalty) to determine the final costs to cross this label.

See also

ROUTE_ALL_EDGESConstant 
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_NODESConstant 
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_EDGESConstant 
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