Packagecom.yworks.yfiles.layout
Classpublic class KeepStrongPortConstraintsStage
InheritanceKeepStrongPortConstraintsStage Inheritance AbstractLayoutStage Inheritance YObject Inheritance Object

This layout stage ensures that layout algorithms that cannot handle port constraints keep the ports of edges with strong port constraints. Without this stage the port locations get lost.

For each edge with strong port constraints, this stage simply stores the original port and restores it after applying the core layouter. Therefore, it either replaces the source/target port by the original port or adds the original port to the edge path calculated by the core layouter (see method keepCalculatedPorts).

See also

keepCalculatedPorts


Public Properties
 PropertyDefined By
 InheritedcoreLayouter : Layouter
Specifies the core layouter.
AbstractLayoutStage
  keepCalculatedPorts : Boolean
Specifies whether or not the final edge routes should contain the ports calculated by the core layouter.
KeepStrongPortConstraintsStage
Public Methods
 MethodDefined By
  
KeepStrongPortConstraintsStage(init:Boolean = true)
Creates a new instance of this layout stage.
KeepStrongPortConstraintsStage
  
canLayout(graph:LayoutGraph):Boolean
[override]
KeepStrongPortConstraintsStage
  
doLayout(graph:LayoutGraph):void
[override]
KeepStrongPortConstraintsStage
 Inherited
equals(o:Object):Boolean
YObject
  
getClass():Class
[override]
KeepStrongPortConstraintsStage
 Inherited
hashCode():int
YObject
  
[static] Creates a new instance of this layout stage.
KeepStrongPortConstraintsStage
  
[static] Creates a new instance of this layout stage using the specified layouter as core layouter.
KeepStrongPortConstraintsStage
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.
KeepStrongPortConstraintsStage
  
Initializes this object.
KeepStrongPortConstraintsStage
Property Detail
keepCalculatedPortsproperty
keepCalculatedPorts:Boolean

Specifies whether or not the final edge routes should contain the ports calculated by the core layouter. If this option is disabled, the layout stage simply replaces the current source/target ports (calculated by the core layouter) by the original ports (for strong ports only). Otherwise, the calculated ports are still contained in the edge paths. Note that for layout algorithms that produce non straight-line edge routes this option should always be enabled.

By default this option is enabled.


Implementation
    public function get keepCalculatedPorts():Boolean
    public function set keepCalculatedPorts(value:Boolean):void
Constructor Detail
KeepStrongPortConstraintsStage()Constructor
public function KeepStrongPortConstraintsStage(init:Boolean = true)

Creates a new instance of this layout stage.

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
initKeepStrongPortConstraintsStage1()method 
protected final function initKeepStrongPortConstraintsStage1():void

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

See also

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

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

Parameters

core:Layouter

See also

newKeepStrongPortConstraintsStage1()method 
public static function newKeepStrongPortConstraintsStage1():KeepStrongPortConstraintsStage

Creates a new instance of this layout stage.

Returns
KeepStrongPortConstraintsStage
newKeepStrongPortConstraintsStage2()method 
public static function newKeepStrongPortConstraintsStage2(core:Layouter):KeepStrongPortConstraintsStage

Creates a new instance of this layout stage using the specified layouter as core layouter.

Parameters

core:Layouter — the core layouter.

Returns
KeepStrongPortConstraintsStage