Packagecom.yworks.yfiles.layout
Classpublic class PortCandidateAssignmentStage
InheritancePortCandidateAssignmentStage Inheritance AbstractLayoutStage Inheritance YObject Inheritance Object

LayoutStage that assigns edges to the ports specified by com.yworks.yfiles.layout.PortConstraint s or com.yworks.yfiles.layout.PortCandidate s after calling the core layout. It can be used to adjust ports for layout algorithms that cannot handle such constraints.

If PortCandidates are assigned for edges and nodes, this stage tries to match them. When there is no match, the PortCandidate with the lowest costs specified for the edge is chosen. While PortConstraints are also matched to PortCandidates at nodes and edges, it is not recommended to mix them because they belong to different concepts.

Furthermore, option pathCorrection allows to specify whether the edge path should be corrected after correcting a port.

See also

com.yworks.yfiles.layout.PortConstraint
com.yworks.yfiles.layout.PortCandidate
com.yworks.yfiles.layout.PortCandidateSet
pathCorrection


Public Properties
 PropertyDefined By
 InheritedcoreLayouter : Layouter
Specifies the core layouter.
AbstractLayoutStage
  pathCorrection : Boolean
Specifies whether or not this stage corrects the edge paths after moving the port to the location specified by a com.yworks.yfiles.layout.PortConstraint or com.yworks.yfiles.layout.PortCandidate s.
PortCandidateAssignmentStage
Public Methods
 MethodDefined By
  
PortCandidateAssignmentStage(init:Boolean = true)
PortCandidateAssignmentStage
  
canLayout(graph:LayoutGraph):Boolean
[override]
PortCandidateAssignmentStage
  
doLayout(graph:LayoutGraph):void
[override]
PortCandidateAssignmentStage
 Inherited
equals(o:Object):Boolean
YObject
  
getClass():Class
[override]
PortCandidateAssignmentStage
 Inherited
hashCode():int
YObject
  
[static]
PortCandidateAssignmentStage
  
[static]
PortCandidateAssignmentStage
Protected Methods
 MethodDefined By
 Inherited
canLayoutCore(graph:LayoutGraph):Boolean
Queries the core layouter whether or not the given graph can be laid out.
AbstractLayoutStage
 Inherited
Invokes the layout routine of the core layouter.
AbstractLayoutStage
 Inherited
AbstractLayoutStage
 Inherited
AbstractLayoutStage
  
Initializes this object.
PortCandidateAssignmentStage
  
Initializes this object.
PortCandidateAssignmentStage
Property Detail
pathCorrectionproperty
pathCorrection:Boolean

Specifies whether or not this stage corrects the edge paths after moving the port to the location specified by a com.yworks.yfiles.layout.PortConstraint or com.yworks.yfiles.layout.PortCandidate s.

If path correction is enabled, the edge will be rerouted within a specific area around its source/target node. Outside this area it will keep the route that was calculated by the core layouter (coreLayouter). When disabled, only the ports are moved which may be more suitable for initially straight edges.

Note that the path correction uses a simple orthogonal routing strategy that is fast but may produce overlapping edge segments as well as edge-node intersections.

By default this option is disabled.


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

See also

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

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
doLayout()method 
override public function doLayout(graph:LayoutGraph):void

Parameters

graph:LayoutGraph

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

Returns
Class
initPortCandidateAssignmentStage1()method 
protected final function initPortCandidateAssignmentStage1():void

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

See also

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

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

Parameters

core:Layouter

See also

newPortCandidateAssignmentStage1()method 
public static function newPortCandidateAssignmentStage1():PortCandidateAssignmentStage

Returns
PortCandidateAssignmentStage
newPortCandidateAssignmentStage2()method 
public static function newPortCandidateAssignmentStage2(core:Layouter):PortCandidateAssignmentStage

Parameters

core:Layouter

Returns
PortCandidateAssignmentStage