Packagecom.yworks.yfiles.layout.hierarchic.incremental
Classpublic class AbstractPortConstraintOptimizer
InheritanceAbstractPortConstraintOptimizer Inheritance YObject Inheritance Object
Implements PortConstraintOptimizer
Subclasses PCListOptimizer

A partial implementation of the com.yworks.yfiles.layout.hierarchic.incremental.PortConstraintOptimizer interface to minimize the effort required to modify the port assignment after the sequencing phase. In this class, the callback method invoked after sequencing (optimizeAfterSequencing()) temporarily restores all same layer edges which, otherwise, wouldn't be present in the layout graph at this time of the algorithm, then invokes the hook in which the custom port assignment should be done, and finally takes care to restore the original state of the layout graph by removing the temporary edges.

See also

com.yworks.yfiles.layout.hierarchic.incremental.PortConstraintOptimizer
callback method invoked after sequencing


Public Properties
 PropertyDefined By
  layoutOrientation : int
Getter: Returns the currently set layout orientation for this class.
AbstractPortConstraintOptimizer
  mirrorMask : int
Specifies the mirror mask that defines which orientations should be mirrored.
AbstractPortConstraintOptimizer
Public Methods
 MethodDefined By
  
AbstractPortConstraintOptimizer(init:Boolean = true)
Creates a new AbstractPortConstraintOptimizer.
AbstractPortConstraintOptimizer
 Inherited
equals(o:Object):Boolean
YObject
  
getClass():Class
[override]
AbstractPortConstraintOptimizer
 Inherited
hashCode():int
YObject
  
Called after the layering information has been determined.
AbstractPortConstraintOptimizer
  
Called after the sequence of the nodes has been determined to assign new temporary port constraints.
AbstractPortConstraintOptimizer
Protected Methods
 MethodDefined By
  
AbstractPortConstraintOptimizer
  
Inserts a same layer edge structure for each same layer edge of the original graph.
AbstractPortConstraintOptimizer
  
optimizeAfterSequencing2(inEdgeOrder:Comparator, outEdgeOrder:Comparator, graph:LayoutGraph, layers:Layers, ldp:LayoutDataProvider, itemFactory:ItemFactory):void
Called after the sequence of the nodes has been determined to assign new temporary port constraints to all nodes.
AbstractPortConstraintOptimizer
  
optimizeAfterSequencing3(node:Node, inEdgeOrder:Comparator, outEdgeOrder:Comparator, graph:LayoutGraph, ldp:LayoutDataProvider, itemFactory:ItemFactory):void
Called after the sequence of the nodes has been determined to assign new temporary port constraints to each original node.
AbstractPortConstraintOptimizer
  
Removes the same layer edge structure created in insertSameLayerStructures().
AbstractPortConstraintOptimizer
Property Detail
layoutOrientationproperty
layoutOrientation:int

Getter: Returns the currently set layout orientation for this class.

Setter: Sets the layout orientation that is used by this class. This setting is necessary to correctly interpret the values provided in the com.yworks.yfiles.layout.PortCandidate s since the com.yworks.yfiles.layout.OrientationLayouter cannot automatically adjust these values.


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

See also

mirrorMaskproperty 
mirrorMask:int

Specifies the mirror mask that defines which orientations should be mirrored. Setting a layout orientation can be seen as rotating the graph 90, 180 or 270 degrees. Afterwards the graph can be mirrored at the x-Axis (for horizontal layout orientations) or y-Axis (for vertical layout orientations). Which directions are mirrored can be defined by the given mask.

By default a mirror mask is set, where com.yworks.yfiles.layout.LayoutOrientation.BOTTOM_TO_TOP will be mirrored at the y-Axis.


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

See also

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

Creates a new AbstractPortConstraintOptimizer.

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
getClass()method
override public function getClass():Class

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

insertSameLayerStructures()method 
protected function insertSameLayerStructures(graph:LayoutGraph, layers:Layers, ldp:LayoutDataProvider, itemFactory:ItemFactory):AbstractPortConstraintOptimizer_SameLayerData

Inserts a same layer edge structure for each same layer edge of the original graph. Note that, in this phase of the layout, the graph does not contain any same layer edges. The structure for a same layer edge (s,t) consists of a temporary node w and the edges (s,w) and (t,w).

Parameters

graph:LayoutGraph — the graph to work on.
 
layers:Layers — the layering information.
 
ldp:LayoutDataProvider — the LayoutDataProvider which provides access to the com.yworks.yfiles.layout.hierarchic.incremental.NodeData and com.yworks.yfiles.layout.hierarchic.incremental.EdgeData.
 
itemFactory:ItemFactory — the factory which can set the temporary port constraints.

Returns
AbstractPortConstraintOptimizer_SameLayerData

See also

optimizeAfterLayering()method 
public function optimizeAfterLayering(graph:LayoutGraph, layers:Layers, ldp:LayoutDataProvider, itemFactory:ItemFactory):void

Called after the layering information has been determined. This method can be used to assign new temporary port constraints for the next phases of the algorithm. In this phase, it is possible to create back-loops by assigning in-edges to the south side or out-edges to the north side, respectively.

Parameters

graph:LayoutGraph — the graph to work on
 
layers:Layers — the layering information
 
ldp:LayoutDataProvider — the implementation which provides access to the com.yworks.yfiles.layout.hierarchic.incremental.NodeData and com.yworks.yfiles.layout.hierarchic.incremental.EdgeData instances
 
itemFactory:ItemFactory — the factory to set the temporary port constraints with

See also

optimizeAfterSequencing()method 
public function optimizeAfterSequencing(graph:LayoutGraph, layers:Layers, ldp:LayoutDataProvider, itemFactory:ItemFactory):void

Called after the sequence of the nodes has been determined to assign new temporary port constraints. This method inserts the same layer strucutres (insertSameLayerStructures()), invokes the hook (optimizeAfterSequencing3()) in which the custom port assignment should be done, and finally takes care to restore the original state (removeSameLayerStructures()) of the layout graph by removing the temporary edges.

Parameters

graph:LayoutGraph — the graph to work on.
 
layers:Layers — the layering information.
 
ldp:LayoutDataProvider — the LayoutDataProvider which provides access to the com.yworks.yfiles.layout.hierarchic.incremental.NodeData and com.yworks.yfiles.layout.hierarchic.incremental.EdgeData.
 
itemFactory:ItemFactory — the factory which can set the temporary port constraints.

See also

optimizeAfterSequencing2()method 
protected function optimizeAfterSequencing2(inEdgeOrder:Comparator, outEdgeOrder:Comparator, graph:LayoutGraph, layers:Layers, ldp:LayoutDataProvider, itemFactory:ItemFactory):void

Called after the sequence of the nodes has been determined to assign new temporary port constraints to all nodes. This method invokes optimizeAfterSequencing3() for every node of the original layout graph, and omits the nodes of the same layer structures.

Note that, in this phase, it's not allowed to create back-loops, that is, in-edges must not connect to the south side and out-edges must not connect to the north side.

Parameters

inEdgeOrder:Comparator — a com.yworks.yfiles.util.Comparators_PartialOrder which defines the preferred ordering of the in-edges from left to right. Note: to sort collections according to a PartialOrder, an appropriate method like com.yworks.yfiles.util.Comparators.sort() or com.yworks.yfiles.base.YList.sort2() must be used.
 
outEdgeOrder:Comparator — a com.yworks.yfiles.util.Comparators_PartialOrder which defines the preferred ordering of the out-edges from left to right. Note: to sort collections according to a PartialOrder, an appropriate method like com.yworks.yfiles.util.Comparators.sort() or com.yworks.yfiles.base.YList.sort2() must be used.
 
graph:LayoutGraph — the graph to work on.
 
layers:Layers
 
ldp:LayoutDataProvider — the LayoutDataProvider which provides access to the com.yworks.yfiles.layout.hierarchic.incremental.NodeData and com.yworks.yfiles.layout.hierarchic.incremental.EdgeData.
 
itemFactory:ItemFactory — the factory which can set the temporary port constraints.

See also

optimizeAfterSequencing3()method 
protected function optimizeAfterSequencing3(node:Node, inEdgeOrder:Comparator, outEdgeOrder:Comparator, graph:LayoutGraph, ldp:LayoutDataProvider, itemFactory:ItemFactory):void

Called after the sequence of the nodes has been determined to assign new temporary port constraints to each original node.

Note that, in this phase, it's not allowed to create back-loops, that is, in-edges must not connect to the south side and out-edges must not connect to the north side.

Parameters

node:Node — the original node to set temporary port constraints at.
 
inEdgeOrder:Comparator — a com.yworks.yfiles.util.Comparators_PartialOrder which defines the preferred ordering of the in-edges from left to right. Note: to sort collections according to a PartialOrder, an appropriate method like com.yworks.yfiles.util.Comparators.sort() or com.yworks.yfiles.base.YList.sort2() must be used.
 
outEdgeOrder:Comparator — a com.yworks.yfiles.util.Comparators_PartialOrder which defines the preferred ordering of the out-edges from left to right. Note: to sort collections according to a PartialOrder, an appropriate method like com.yworks.yfiles.util.Comparators.sort() or com.yworks.yfiles.base.YList.sort2() must be used.
 
graph:LayoutGraph — the graph to work on.
 
ldp:LayoutDataProvider — the LayoutDataProvider which provides access to the com.yworks.yfiles.layout.hierarchic.incremental.NodeData and com.yworks.yfiles.layout.hierarchic.incremental.EdgeData.
 
itemFactory:ItemFactory — the factory which can set the temporary port constraints.

See also

removeSameLayerStructures()method 
protected function removeSameLayerStructures(sameLayerData:AbstractPortConstraintOptimizer_SameLayerData, graph:LayoutGraph, ldp:LayoutDataProvider, itemFactory:ItemFactory):void

Removes the same layer edge structure created in insertSameLayerStructures().

Parameters

sameLayerData:AbstractPortConstraintOptimizer_SameLayerData — the information about the same layer structures.
 
graph:LayoutGraph — the graph to work on.
 
ldp:LayoutDataProvider — the LayoutDataProvider which provides access to the com.yworks.yfiles.layout.hierarchic.incremental.NodeData and com.yworks.yfiles.layout.hierarchic.incremental.EdgeData.
 
itemFactory:ItemFactory — the factory which can set the temporary port constraints.

See also