Package | com.yworks.yfiles.layout.hierarchic |
Class | public class IncrementalHierarchicLayouter |
Inheritance | IncrementalHierarchicLayouter CanonicMultiStageLayouter YObject Object |
Instances can be used to simply create hierarchic layouts from scratch or add new elements to the existing sketch drawing incrementally. In order to add elements incrementally to the current sketch or let the algorithm optimize certain elements in the current sketch, set its mode to LAYOUT_MODE_INCREMENTAL and add a com.yworks.yfiles.base.DataProvider (e.g. use com.yworks.yfiles.util.Maps.createHashedDataMap()) using the INCREMENTAL_HINTS_DPKEY DataProvider key to the graph and associate the marks obtained from the com.yworks.yfiles.layout.hierarchic.incremental.IncrementalHintsFactory with the elements to be added incrementally.
Many settings of the layout can be controlled using the com.yworks.yfiles.layout.hierarchic.incremental.EdgeLayoutDescriptor and com.yworks.yfiles.layout.hierarchic.incremental.NodeLayoutDescriptor instances. The ones that are used during the layout run can be obtained from edgeLayoutDescriptor and nodeLayoutDescriptor respectively. If at the time of the invocation DataProvider instances are bound to the graph using either the com.yworks.yfiles.layout.hierarchic.incremental.HierarchicLayouterImpl.EDGE_LAYOUT_DESCRIPTOR_DPKEY or com.yworks.yfiles.layout.hierarchic.incremental.HierarchicLayouterImpl.NODE_LAYOUT_DESCRIPTOR_DPKEY keys, they will be wrapped and whenever they do not provide values the ones set in this instance will be used as fall-back values.
IncrementalHierarchicLayouter 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 PortCandidate
s connects to nodes with PortCandidateSet
s, 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 PortConstraint
s and PortCandidate
s in the same layout.
Here is a sample layout output:
The following example shows the result of an incremental layout with lots of port constraints (For clarity colored layers have been added to the diagram):
The last example shows the result of a layout run that considered swim lanes. Nodes with the same label have been placed into the same swim lane. Swim lanes have been ordered in ascending order of the label names. (For clarity lines have been added to the diagram that depict the bounds of the swim lanes):
See also
Property | Defined By | ||
---|---|---|---|
automaticEdgeGrouping : Boolean
Getter:
Whether or not automatic edge grouping should be applied. | IncrementalHierarchicLayouter | ||
backloopRouting : Boolean
Getter:
Whether or not backloop routing should be applied. | IncrementalHierarchicLayouter | ||
backloopRoutingForSelfloopsEnabled : Boolean
Determines whether or not selfloops should be routed like backloops when backloop routing is enabled. | IncrementalHierarchicLayouter | ||
compactGroups : Boolean
Getter:
Return whether layer compaction for recursive group layering is active. | IncrementalHierarchicLayouter | ||
componentArrangementPolicy : int
Specifies the policy that is used to arrange connected components. | IncrementalHierarchicLayouter | ||
componentLayouter : LayoutStage
Specifies the LayoutStage responsible for laying out the connected components of the graph. | CanonicMultiStageLayouter | ||
componentLayouterEnabled : Boolean [override]
Getter:
Returns whether or not ComponentLayouter is enabled. | IncrementalHierarchicLayouter | ||
considerNodeLabels : Boolean
Getter:
Returns whether or not node labels are taken into account when calculating node positions (thereby preventing possible node/node label or node label/node label overlaps). | IncrementalHierarchicLayouter | ||
edgeLayoutDescriptor : EdgeLayoutDescriptor
Specifies the EdgeLayoutDescriptor instance used for all those edges, that do not have a specific layout descriptor assigned. | IncrementalHierarchicLayouter | ||
edgeToEdgeDistance : Number
Specifies the minimum distance between two adjacent edges in one layer. | IncrementalHierarchicLayouter | ||
fixedElementsLayerer : Layerer
Specifies the com.yworks.yfiles.layout.hierarchic.incremental.Layerer instance that is used to obtain the layering for those nodes that are not marked to be laid out incrementally if the layouter is set to LAYOUT_MODE_INCREMENTAL. | IncrementalHierarchicLayouter | ||
fixedElementsSequencer : Sequencer
Specifies the com.yworks.yfiles.layout.hierarchic.incremental.Sequencer instance that is used to calculated the sequence of the nodes that are not marked to be laid out incrementally if the layouter is set to LAYOUT_MODE_INCREMENTAL. | IncrementalHierarchicLayouter | ||
fromScratchLayerer : Layerer
Specifies the com.yworks.yfiles.layout.hierarchic.incremental.Layerer instance that is used to obtain the layering for the nodes if the layouter is set to LAYOUT_MODE_FROM_SCRATCH. | IncrementalHierarchicLayouter | ||
fromScratchLayeringStrategy : int
Getter:
Returns the currently set layering strategy for the from scratch (fromScratchLayerer) layering. | IncrementalHierarchicLayouter | ||
fromScratchSequencer : Sequencer
Specifies the com.yworks.yfiles.layout.hierarchic.incremental.Sequencer instance that is used to calculate the node sequence if the layouter is set to LAYOUT_MODE_FROM_SCRATCH. | IncrementalHierarchicLayouter | ||
gridSpacing : Number
Specifies the equidistant spacing between the horizontal and vertical grid lines. | IncrementalHierarchicLayouter | ||
groupAlignmentPolicy : int
Specifies the group layer alignment strategy used for recursive group layering. | IncrementalHierarchicLayouter | ||
groupNodeHider : LayoutStage
Specifies the LayoutStage that is responsible for hiding away grouping information for the layout algorithm. | CanonicMultiStageLayouter | ||
hideGroupNodes : Boolean
Specifies whether or not to hide away group nodes before the layout begins. | CanonicMultiStageLayouter | ||
hierarchicLayouter : HierarchicLayouterImpl [read-only]
Returns the internally used com.yworks.yfiles.layout.hierarchic.incremental.HierarchicLayouterImpl instance. | IncrementalHierarchicLayouter | ||
integratedEdgeLabeling : Boolean
Getter:
Returns whether integrated edge labeling is enabled. | IncrementalHierarchicLayouter | ||
labelLayouter : LayoutStage
Getter:
Returns the algorithm used for placing labels. | CanonicMultiStageLayouter | ||
labelLayouterEnabled : Boolean
Getter:
Returns whether or not LabelLayouter is enabled. | CanonicMultiStageLayouter | ||
layoutMode : int
Specifies the layout mode this layouter is currently in. | IncrementalHierarchicLayouter | ||
layoutOrientation : int
Specifies the main layout orientation. | CanonicMultiStageLayouter | ||
maximalDuration : uint
Getter:
Returns the time limit (in milliseconds) set for the layout algorithm. | IncrementalHierarchicLayouter | ||
minimumLayerDistance : Number
Specifies the minimum distance between two adjacent layers. | IncrementalHierarchicLayouter | ||
nodeLayoutDescriptor : NodeLayoutDescriptor
Specifies the NodeLayoutDescriptor instance used for all those nodes, that do not have a specific layout descriptor assigned. | IncrementalHierarchicLayouter | ||
nodePlacer : NodePlacer
Specifies the com.yworks.yfiles.layout.hierarchic.incremental.NodePlacer instance that will be used to calculated the final node placement of the layout. | IncrementalHierarchicLayouter | ||
nodeToEdgeDistance : Number
Getter:
Returns the minimum distance between two adjacent nodes in one layer. | IncrementalHierarchicLayouter | ||
nodeToNodeDistance : Number
Getter:
Returns the minimum distance between two adjacent nodes in one layer. | IncrementalHierarchicLayouter | ||
orientationLayouter : LayoutStage
Specifies the LayoutStage that is responsible for changing the orientation of the computed layout. | CanonicMultiStageLayouter | ||
orientationLayouterEnabled : Boolean
Getter:
Returns whether or not the OrientationLayouter is enabled. | CanonicMultiStageLayouter | ||
orthogonalRouting : Boolean
Specifies whether or not edges should be routed orthogonally. | IncrementalHierarchicLayouter | ||
parallelEdgeLayouter : LayoutStage
Getter:
Returns the LayoutStage responsible for routing parallel edges. | CanonicMultiStageLayouter | ||
parallelEdgeLayouterEnabled : Boolean
Getter:
Returns whether or not the ParallelEdgeLayouter is enabled. | CanonicMultiStageLayouter | ||
recursiveGroupLayering : Boolean
Specifies whether groups are respected during the layering stage. | IncrementalHierarchicLayouter | ||
selfLoopLayouter : LayoutStage
Getter:
Returns the LayoutStage used for routing Self-loops. | CanonicMultiStageLayouter | ||
selfLoopLayouterEnabled : Boolean
Getter:
Returns whether or not the SelfLoopLayouter is enabled. | CanonicMultiStageLayouter | ||
subgraphLayouter : LayoutStage
Specifies the LayoutStage that is responsible for constraining the layout process to a subgraph of the target graph. | CanonicMultiStageLayouter | ||
subgraphLayouterEnabled : Boolean
Getter:
Returns whether or not the SubgraphLayouter is enabled. | CanonicMultiStageLayouter |
Property | Defined By | ||
---|---|---|---|
defaultDrawingDistanceCalculator : DefaultDrawingDistanceCalculator [read-only]
Returns the com.yworks.yfiles.layout.hierarchic.incremental.DefaultDrawingDistanceCalculator that is registered with the layout algorithm by default. | IncrementalHierarchicLayouter | ||
mirrorMask : int [read-only]
Returns the orientation layouter (orientationLayouter) 's mirror mask. | IncrementalHierarchicLayouter |
Method | Defined By | ||
---|---|---|---|
IncrementalHierarchicLayouter(init:Boolean = true)
Creates a new IncrementalHierarchicLayouter instance which is set to LAYOUT_MODE_FROM_SCRATCH initially
| IncrementalHierarchicLayouter | ||
appendStage(stage:LayoutStage):void
Appends a stage to the layout pipeline. | CanonicMultiStageLayouter | ||
Returns a layout for the given layout graph. | CanonicMultiStageLayouter | ||
Returns a layout for the given graph interface and layout. | CanonicMultiStageLayouter | ||
canLayout(graph:LayoutGraph):Boolean
Tests whether or not the given graph can be laid out by this layouter. | CanonicMultiStageLayouter | ||
canLayoutCore(graph:LayoutGraph):Boolean [override]
Determines whether this layouter can perform the core layout on the given graph. | IncrementalHierarchicLayouter | ||
Returns a com.yworks.yfiles.layout.hierarchic.incremental.IncrementalHintsFactory instance that must be used to obtain marks that can be associated with elements in the graph that will be laid out incrementally. | IncrementalHierarchicLayouter | ||
Returns a com.yworks.yfiles.layout.hierarchic.incremental.LayerConstraintFactory instance that can be used to specify layer constraints for the given graph. | IncrementalHierarchicLayouter | ||
Returns a com.yworks.yfiles.layout.hierarchic.incremental.SequenceConstraintFactory instance that can be used to specify sequence constraints for the given graph. | IncrementalHierarchicLayouter | ||
doLayout(layoutGraph:LayoutGraph):void
Calculates a layout for the given graph. | CanonicMultiStageLayouter | ||
Calculates a layout for the given graph interface and layout. | CanonicMultiStageLayouter | ||
doLayoutCore(g:LayoutGraph):void [override]
Performs the actual layout using the currently set mode. | IncrementalHierarchicLayouter | ||
enableOnlyCore():void
Disables all layout stages and performs only the core layouter. | CanonicMultiStageLayouter | ||
equals(o:Object):Boolean | YObject | ||
getClass():Class [override] | IncrementalHierarchicLayouter | ||
hashCode():int | YObject | ||
[static]
Creates a new IncrementalHierarchicLayouter instance which is set to LAYOUT_MODE_FROM_SCRATCH initially
| IncrementalHierarchicLayouter | ||
prependStage(stage:LayoutStage):void
Prepends a stage to the layout pipeline. | CanonicMultiStageLayouter | ||
removeStage(stage:LayoutStage):void
Removes a LayoutStage that has been previously added by the methods appendStage() or prependStage(). | CanonicMultiStageLayouter |
Method | Defined By | ||
---|---|---|---|
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. | CanonicMultiStageLayouter | ||
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. | CanonicMultiStageLayouter | ||
Called before the actual layout is performed. | IncrementalHierarchicLayouter | ||
Factory method that creates the default EdgeLayoutDescriptor. | IncrementalHierarchicLayouter | ||
Factory method that creates the internally used com.yworks.yfiles.layout.hierarchic.incremental.HierarchicLayouterImpl instance. | IncrementalHierarchicLayouter | ||
Factory method that creates the default NodeLayoutDescriptor. | IncrementalHierarchicLayouter | ||
CanonicMultiStageLayouter | |||
Initializes this object. | IncrementalHierarchicLayouter | ||
Called after the actual layout is performed. | IncrementalHierarchicLayouter |
Constant | Defined By | ||
---|---|---|---|
COMPONENT_ARRANGEMENT_COMPACT : int = 0 [static]
Component arrangement constant that can be used in componentArrangementPolicy. | IncrementalHierarchicLayouter | ||
COMPONENT_ARRANGEMENT_TOPMOST : int = 1 [static]
Component arrangement constant that can be used in componentArrangementPolicy. | IncrementalHierarchicLayouter | ||
CRITICAL_EDGE_DPKEY : Object = y.layout.IncrementalHierarchicLayouter.STRAIGHT_EDGES_DPKEY [static]
com.yworks.yfiles.base.DataProvider key used to store the priority (integer values) for "critical" edges. | IncrementalHierarchicLayouter | ||
INCREMENTAL_HINTS_DPKEY : Object = y.layout.hierarchic.incremental.HierarchicLayouter.INCREMENTAL_HINTS_DPKEY [static]
com.yworks.yfiles.base.DataProvider key used to store incremental layout hints that can be retrieved from the com.yworks.yfiles.layout.hierarchic.incremental.IncrementalHintsFactory which itself can be obtained from the createIncrementalHintsFactory() method. | IncrementalHierarchicLayouter | ||
LAYERING_STRATEGY_BFS : int = 4 [static]
Layering strategy specifier. | IncrementalHierarchicLayouter | ||
LAYERING_STRATEGY_FROM_SKETCH : int = 5 [static]
Layering strategy specifier. | IncrementalHierarchicLayouter | ||
LAYERING_STRATEGY_HIERARCHICAL_DOWNSHIFT : int = 3 [static]
Layering strategy specifier. | IncrementalHierarchicLayouter | ||
LAYERING_STRATEGY_HIERARCHICAL_OPTIMAL : int = 1 [static]
Layering strategy specifier. | IncrementalHierarchicLayouter | ||
LAYERING_STRATEGY_HIERARCHICAL_TIGHT_TREE : int = 2 [static]
Layering strategy specifier. | IncrementalHierarchicLayouter | ||
LAYERING_STRATEGY_HIERARCHICAL_TOPMOST : int = 0 [static]
Layering strategy constant. | IncrementalHierarchicLayouter | ||
LAYERING_STRATEGY_UNKNOWN : int = -1 [static]
Dummy layering strategy specifier. | IncrementalHierarchicLayouter | ||
LAYERING_STRATEGY_USER_DEFINED : int = 6 [static]
Layering strategy specifier. | IncrementalHierarchicLayouter | ||
LAYER_VALUE_HOLDER_DPKEY : Object = y.layout.hierarchic.incremental.HierarchicLayouter.LAYER_VALUE_HOLDER_DPKEY [static]
Used for publishing the final layering information. | IncrementalHierarchicLayouter | ||
LAYOUT_MODE_FROM_SCRATCH : int = 1 [static]
Layout mode constant that can be used in layoutMode. | IncrementalHierarchicLayouter | ||
LAYOUT_MODE_INCREMENTAL : int = 0 [static]
Layout mode constant that can be used in layoutMode. | IncrementalHierarchicLayouter | ||
POLICY_ALIGN_GROUPS_BOTTOM : int = 34 [static]
Group layering alignment strategy specifier. | IncrementalHierarchicLayouter | ||
POLICY_ALIGN_GROUPS_CENTER : int = 66 [static]
Group layering alignment strategy specifier. | IncrementalHierarchicLayouter | ||
POLICY_ALIGN_GROUPS_TOP : int = 18 [static]
Group layering alignment strategy specifier. | IncrementalHierarchicLayouter | ||
SEQUENCE_VALUE_HOLDER_DPKEY : Object = y.layout.hierarchic.incremental.HierarchicLayouter.SEQUENCE_VALUE_HOLDER_DPKEY [static]
Used for publishing the final sequencing information. | IncrementalHierarchicLayouter | ||
SWIMLANE_DESCRIPTOR_DPKEY : Object = y.layout.hierarchic.incremental.HierarchicLayouter.SWIMLANE_DESCRIPTOR_DPKEY [static]
com.yworks.yfiles.base.DataProvider key used to store com.yworks.yfiles.layout.hierarchic.incremental.SwimLaneDescriptor instances for each node in the graph. | IncrementalHierarchicLayouter |
automaticEdgeGrouping | property |
automaticEdgeGrouping:Boolean
Getter: Whether or not automatic edge grouping should be applied.
Setter: If this option is set, edges are grouped automatically. The automatic edge grouping tries to group a high number of edges without changing the semantic of the graph, i.e., it groups edges either at a common source node or a common target node. Edge groupings often allow more compact layouts since grouped edges are routed in a bus-style manner. Note: Edges are only grouped at their source (target) node if they do not have a port constraint/port candidates at this node. Furthermore, edges cannot be grouped at a node with specified port candidates (see class com.yworks.yfiles.layout.PortCandidateSet). User specified edge groups are not considered. public function get automaticEdgeGrouping():Boolean
public function set automaticEdgeGrouping(value:Boolean):void
See also
backloopRouting | property |
backloopRouting:Boolean
Getter: Whether or not backloop routing should be applied.
Setter: If this option is set, reversed edges are routed in a backloop style, i.e., such that they attach to the same vertex sides as the other edges. Note that port constraints and port candidates are still considered. public function get backloopRouting():Boolean
public function set backloopRouting(value:Boolean):void
backloopRoutingForSelfloopsEnabled | property |
backloopRoutingForSelfloopsEnabled:Boolean
Determines whether or not selfloops should be routed like backloops when backloop routing is enabled. That means, if there aren't any port constraints the selfloop will start at the bottom of the node and end at the top of it.
public function get backloopRoutingForSelfloopsEnabled():Boolean
public function set backloopRoutingForSelfloopsEnabled(value:Boolean):void
See also
compactGroups | property |
compactGroups:Boolean
Getter: Return whether layer compaction for recursive group layering is active.
Setter: Set whether layer compaction for recursive group layering should be used. If set totrue
, the recursive layering is compacted, i.e. node ranks are decreased if possible without reversing edge directions. This differs from non-recursive layering, where groups are ignored completely. The resulting layering tries to keep the layer span of a group node minimal, while minimizing the overall vertical space. By default, this feature is disabled.
Note: This feature works best when a instance of com.yworks.yfiles.layout.hierarchic.TopologicalLayerer is used for layer assignment. If this feature is enabled, an alignment policy that is set with groupAlignmentPolicy is ignored.
public function get compactGroups():Boolean
public function set compactGroups(value:Boolean):void
See also
componentArrangementPolicy | property |
componentArrangementPolicy:int
Specifies the policy that is used to arrange connected components.
Defaults to COMPONENT_ARRANGEMENT_TOPMOST.
public function get componentArrangementPolicy():int
public function set componentArrangementPolicy(value:int):void
IllegalArgumentException — if the specified policy does not match one component arrangement policy constants.
|
See also
componentLayouterEnabled | property |
componentLayouterEnabled:Boolean
[override] Getter: Returns whether or not ComponentLayouter is enabled. By default it is disabled.
Setter: Specifies whether or not to enable the ComponentLayouter. By default it is disabled. public function get componentLayouterEnabled():Boolean
public function set componentLayouterEnabled(value:Boolean):void
considerNodeLabels | property |
considerNodeLabels:Boolean
Getter:
Returns whether or not node labels are taken into account when calculating node positions (thereby preventing possible node/node label or node label/node label overlaps).
This method is a convenience method checks whether the label layouter (com.yworks.yfiles.layout.CanonicMultiStageLayouter.labelLayouter) is of type com.yworks.yfiles.layout.LabelLayoutTranslator and com.yworks.yfiles.layout.LabelLayoutTranslator.translateNodeLabels returns true
. The default is false
.
true
. Note that setting this option may overwrite the currently set label layouter. Hence, to combine this option with a generic edge labeling algorithm, the generic labeling has to be applied in an additional step after calculating the layout.
public function get considerNodeLabels():Boolean
public function set considerNodeLabels(value:Boolean):void
Error — if the current label layouter is not of type com.yworks.yfiles.layout.LabelLayoutTranslator.
| |
Error — if the current label layouter is not of type com.yworks.yfiles.layout.LabelLayoutTranslator.
|
See also
defaultDrawingDistanceCalculator | property |
defaultDrawingDistanceCalculator:DefaultDrawingDistanceCalculator
[read-only] Returns the com.yworks.yfiles.layout.hierarchic.incremental.DefaultDrawingDistanceCalculator that is registered with the layout algorithm by default.
protected function get defaultDrawingDistanceCalculator():DefaultDrawingDistanceCalculator
Error — if the current instance returned by com.yworks.yfiles.layout.hierarchic.incremental.HierarchicLayouterImpl.drawingDistanceCalculator is not an instance of DefaultDrawingDistanceCalculator .
|
See also
edgeLayoutDescriptor | property |
edgeLayoutDescriptor:EdgeLayoutDescriptor
Specifies the EdgeLayoutDescriptor
instance used for all those edges, that do not have a specific layout descriptor assigned.
public function get edgeLayoutDescriptor():EdgeLayoutDescriptor
public function set edgeLayoutDescriptor(value:EdgeLayoutDescriptor):void
ReferenceError — if the argument is null
|
See also
edgeToEdgeDistance | property |
edgeToEdgeDistance:Number
Specifies the minimum distance between two adjacent edges in one layer. See com.yworks.yfiles.layout.hierarchic.incremental.EdgeLayoutDescriptor.minimumDistance for related settings.
public function get edgeToEdgeDistance():Number
public function set edgeToEdgeDistance(value:Number):void
See also
fixedElementsLayerer | property |
fixedElementsLayerer:Layerer
Specifies the com.yworks.yfiles.layout.hierarchic.incremental.Layerer instance that is used to obtain the layering for those nodes that are not marked to be laid out incrementally if the layouter is set to LAYOUT_MODE_INCREMENTAL.
public function get fixedElementsLayerer():Layerer
public function set fixedElementsLayerer(value:Layerer):void
ReferenceError — if the argument is null
|
See also
fixedElementsSequencer | property |
fixedElementsSequencer:Sequencer
Specifies the com.yworks.yfiles.layout.hierarchic.incremental.Sequencer instance that is used to calculated the sequence of the nodes that are not marked to be laid out incrementally if the layouter is set to LAYOUT_MODE_INCREMENTAL.
public function get fixedElementsSequencer():Sequencer
public function set fixedElementsSequencer(value:Sequencer):void
ReferenceError — if the argument is null
|
See also
fromScratchLayerer | property |
fromScratchLayerer:Layerer
Specifies the com.yworks.yfiles.layout.hierarchic.incremental.Layerer instance that is used to obtain the layering for the nodes if the layouter is set to LAYOUT_MODE_FROM_SCRATCH.
public function get fromScratchLayerer():Layerer
public function set fromScratchLayerer(value:Layerer):void
ReferenceError — if the argument is null
|
See also
fromScratchLayeringStrategy | property |
fromScratchLayeringStrategy:int
Getter: Returns the currently set layering strategy for the from scratch (fromScratchLayerer) layering.
Setter: Convenience method that sets a predefined layering strategy for the from scratch (fromScratchLayerer) layerer. The layouter assigns the nodes to separate layers. The nodes within each layer will be placed on the same horizontal layer. The layers will be arranged vertically starting with the small-numbered layers. The rank of a node is the number of the layer it belongs to. An important layering strategy for the hierarchic layout style is called Hierarchical Layering. A hierarchical layering tries to assign nodes to layers in a way that as much as possible edges of the graph will point to the main layout direction, i.e. the start nodes of the edges will have a smaller rank than the corresponding end nodes. Also, a hierarchical layering will never put two connected nodes in the same layer. By default the layering strategy LAYERING_STRATEGY_HIERARCHICAL_OPTIMAL is set. This method wraps the internal implementations into a com.yworks.yfiles.layout.hierarchic.incremental.MultiComponentLayerer instance so that it is possible to specify the behavior of the algorithm if the component layouter (componentLayouterEnabled) is disabled. public function get fromScratchLayeringStrategy():int
public function set fromScratchLayeringStrategy(value:int):void
See also
fromScratchSequencer | property |
fromScratchSequencer:Sequencer
Specifies the com.yworks.yfiles.layout.hierarchic.incremental.Sequencer instance that is used to calculate the node sequence if the layouter is set to LAYOUT_MODE_FROM_SCRATCH.
public function get fromScratchSequencer():Sequencer
public function set fromScratchSequencer(value:Sequencer):void
ReferenceError — if the argument is null
|
See also
gridSpacing | property |
gridSpacing:Number
Specifies the equidistant spacing between the horizontal and vertical grid lines.
By default no grid is specified (spacing is <= 0).
Note that the grid feature doesn't work together with exact (layer/sequence) coordinate hints (see com.yworks.yfiles.layout.hierarchic.incremental.IncrementalHintsFactory).
public function get gridSpacing():Number
public function set gridSpacing(value:Number):void
See also
groupAlignmentPolicy | property |
groupAlignmentPolicy:int
Specifies the group layer alignment strategy used for recursive group layering.
Default value is POLICY_ALIGN_GROUPS_CENTER.
public function get groupAlignmentPolicy():int
public function set groupAlignmentPolicy(value:int):void
See also
hierarchicLayouter | property |
hierarchicLayouter:HierarchicLayouterImpl
[read-only] Returns the internally used com.yworks.yfiles.layout.hierarchic.incremental.HierarchicLayouterImpl instance.
public function get hierarchicLayouter():HierarchicLayouterImpl
See also
integratedEdgeLabeling | property |
integratedEdgeLabeling:Boolean
Getter:
Returns whether integrated edge labeling is enabled.
This method is a convenience method that checks if the label layouter (com.yworks.yfiles.layout.CanonicMultiStageLayouter.labelLayouter) is of type com.yworks.yfiles.layout.LabelLayoutTranslator and com.yworks.yfiles.layout.LabelLayoutTranslator.translateEdgeLabels returns true
. The default is false
.
true
public function get integratedEdgeLabeling():Boolean
public function set integratedEdgeLabeling(value:Boolean):void
Error — if the current label layouter is not of type com.yworks.yfiles.layout.LabelLayoutTranslator.
| |
Error — if the current label layouter is not of type com.yworks.yfiles.layout.LabelLayoutTranslator.
|
See also
layoutMode | property |
layoutMode:int
Specifies the layout mode this layouter is currently in. Depending on the mode the layout algorithm will use different com.yworks.yfiles.layout.hierarchic.incremental.Layerer and com.yworks.yfiles.layout.hierarchic.incremental.Sequencer implementations. Currently supported modes are:
public function get layoutMode():int
public function set layoutMode(value:int):void
IllegalArgumentException — if the mode is unknown
|
See also
maximalDuration | property |
maximalDuration:uint
Getter: Returns the time limit (in milliseconds) set for the layout algorithm.
The layout algorithm takes also into consideration the time limits of the default com.yworks.yfiles.layout.hierarchic.incremental.Layerer, com.yworks.yfiles.layout.hierarchic.incremental.Sequencer and com.yworks.yfiles.layout.hierarchic.incremental.NodePlacer instances (if any) and will try to not exceed the given values.
Setter: Sets a preferred time limit (in milliseconds) for the layout algorithm.The layout algorithm takes also into consideration the time limits of the default com.yworks.yfiles.layout.hierarchic.incremental.Layerer, com.yworks.yfiles.layout.hierarchic.incremental.Sequencer and com.yworks.yfiles.layout.hierarchic.incremental.NodePlacer instances (if any) and will try to not exceed the given values.
Note that restricting the maximal duration may result in a worse layout quality. Furthermore, the actual runtime may exceed the maximal duration since the layout algorithm still has to find a valid solution.
public function get maximalDuration():uint
public function set maximalDuration(value:uint):void
See also
minimumLayerDistance | property |
minimumLayerDistance:Number
Specifies the minimum distance between two adjacent layers.
The default is 20.0d
.
public function get minimumLayerDistance():Number
public function set minimumLayerDistance(value:Number):void
mirrorMask | property |
mirrorMask:int
[read-only] Returns the orientation layouter (orientationLayouter) 's mirror mask.
protected function get mirrorMask():int
See also
nodeLayoutDescriptor | property |
nodeLayoutDescriptor:NodeLayoutDescriptor
Specifies the NodeLayoutDescriptor
instance used for all those nodes, that do not have a specific layout descriptor assigned.
public function get nodeLayoutDescriptor():NodeLayoutDescriptor
public function set nodeLayoutDescriptor(value:NodeLayoutDescriptor):void
ReferenceError — if the argument is null
|
See also
nodePlacer | property |
nodePlacer:NodePlacer
Specifies the com.yworks.yfiles.layout.hierarchic.incremental.NodePlacer instance that will be used to calculated the final node placement of the layout.
public function get nodePlacer():NodePlacer
public function set nodePlacer(value:NodePlacer):void
ReferenceError — if the argument is null
|
See also
nodeToEdgeDistance | property |
nodeToEdgeDistance:Number
Getter:
Returns the minimum distance between two adjacent nodes in one layer.
The default is 15.0d
.
public function get nodeToEdgeDistance():Number
public function set nodeToEdgeDistance(value:Number):void
See also
nodeToNodeDistance | property |
nodeToNodeDistance:Number
Getter:
Returns the minimum distance between two adjacent nodes in one layer.
The default is 30.0d
.
public function get nodeToNodeDistance():Number
public function set nodeToNodeDistance(value:Number):void
See also
orthogonalRouting | property |
orthogonalRouting:Boolean
Specifies whether or not edges should be routed orthogonally.
Return value true
signals that all resulting edge paths will be composed of vertical and horizontal segments, only. Default is false
. Note that this is a convenience method delegates to com.yworks.yfiles.layout.hierarchic.IncrementalHierarchicLayouter.edgeLayoutDescriptor. com.yworks.yfiles.layout.hierarchic.incremental.EdgeLayoutDescriptor.orthogonallyRouted.
public function get orthogonalRouting():Boolean
public function set orthogonalRouting(value:Boolean):void
See also
recursiveGroupLayering | property |
recursiveGroupLayering:Boolean
Specifies whether groups are respected during the layering stage.
If set to true
(and group compaction (compactGroups) is not enabled), groups are layered recursively, i.e.
By default, this feature is enabled.
public function get recursiveGroupLayering():Boolean
public function set recursiveGroupLayering(value:Boolean):void
See also
IncrementalHierarchicLayouter | () | Constructor |
public function IncrementalHierarchicLayouter(init:Boolean = true)
Creates a new IncrementalHierarchicLayouter instance which is set to LAYOUT_MODE_FROM_SCRATCH initially
Parametersinit: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
canLayoutCore | () | method |
override public function canLayoutCore(graph:LayoutGraph):Boolean
Determines whether this layouter can perform the core layout on the given graph.
Parameters
graph:LayoutGraph |
Boolean |
configureCoreLayout | () | method |
protected function configureCoreLayout(graph:LayoutGraph, ihl:HierarchicLayouterImpl):void
Called before the actual layout is performed. Overwrite this to manually reconfigure the instance. If com.yworks.yfiles.layout.PortCandidateSet.NODE_DP_KEY is registered with the layout graph and there is no com.yworks.yfiles.layout.hierarchic.incremental.HierarchicLayouterImpl.portConstraintOptimizer registered, com.yworks.yfiles.layout.hierarchic.incremental.PCListOptimizer will be temporarily configured with the instance.
Parameters
graph:LayoutGraph — the graph to be laid out
| |
ihl:HierarchicLayouterImpl — the instance used for the core layout.
|
See also
createEdgeLayoutDescriptor | () | method |
protected function createEdgeLayoutDescriptor():EdgeLayoutDescriptor
Factory method that creates the default EdgeLayoutDescriptor.
ReturnsEdgeLayoutDescriptor — a new EdgeLayoutDescriptor (new EdgeLayoutDescriptor() )
|
createHierarchicLayouter | () | method |
protected function createHierarchicLayouter():HierarchicLayouterImpl
Factory method that creates the internally used com.yworks.yfiles.layout.hierarchic.incremental.HierarchicLayouterImpl instance.
ReturnsHierarchicLayouterImpl — new y.layout.hierarchic.incremental.HierarchicLayouter()
|
See also
createIncrementalHintsFactory | () | method |
public function createIncrementalHintsFactory():IncrementalHintsFactory
Returns a com.yworks.yfiles.layout.hierarchic.incremental.IncrementalHintsFactory instance that must be used to obtain marks that can be associated with elements in the graph that will be laid out incrementally. Use this factory and a com.yworks.yfiles.base.DataProvider that is bound to the graph using the INCREMENTAL_HINTS_DPKEY DataProvider key to associate appropriate hints with the elements in the graph that should be laid out incrementally by the algorithm.
ReturnsIncrementalHintsFactory — the factory
|
See also
createLayerConstraintFactory | () | method |
public function createLayerConstraintFactory(graph:Graph):LayerConstraintFactory
Returns a com.yworks.yfiles.layout.hierarchic.incremental.LayerConstraintFactory instance that can be used to specify layer constraints for the given graph.
Note: LayerConstraintFactory
instances have to be disposed (com.yworks.yfiles.layout.hierarchic.incremental.LayerConstraintFactory.dispose()) after use. Disposing the factory will also remove all constraints previously specified for the factory's associated graph. Creating layering constraints with a disposed factory will throw an IllegalStateException
.
Creating a new constraint factory for a graph will render all previously created factories (including any constraints specified) for that graph useless. Therefore a new constraint factory should only be created after previously used factories have been properly disposed.
Parameters
graph:Graph — the given graph.
|
LayerConstraintFactory — A LayerConstraintFactory instance for use with the given graph.
|
See also
createNodeLayoutDescriptor | () | method |
protected function createNodeLayoutDescriptor():NodeLayoutDescriptor
Factory method that creates the default NodeLayoutDescriptor.
ReturnsNodeLayoutDescriptor — a new NodeLayoutDescriptor (new NodeLayoutDescriptor() )
|
createSequenceConstraintFactory | () | method |
public function createSequenceConstraintFactory(graph:LayoutGraph):SequenceConstraintFactory
Returns a com.yworks.yfiles.layout.hierarchic.incremental.SequenceConstraintFactory instance that can be used to specify sequence constraints for the given graph. For these sequence constraints to have any effect, the com.yworks.yfiles.layout.hierarchic.incremental.Sequencer used to determine the in-layer node order (sequence) has to support constraints. Both, DefaultLayerSequencer (com.yworks.yfiles.layout.hierarchic.incremental.DefaultLayerSequencer) and the incremental sequencer used internally support sequence constraints.
Note: SequenceConstraintFactory
instances have to be disposed (com.yworks.yfiles.layout.hierarchic.incremental.SequenceConstraintFactory.dispose()) after use. Disposing the factory will also remove all constraints previously specified for the factory's associated graph. Creating sequence constraints with a disposed factory will throw an IllegalStateException
.
Creating a new constraint factory for a graph will render all previously created factories (including any constraints specified) for that graph useless. Therefore a new constraint factory should only be created after previously used factories have been properly disposed.
You can create a SequenceConstraintFactory without binding it to a graph instance initially by passing a null
parameter. In that case, you must bind the returned instance to the graph instance before calculating a layering:
IncrementalHierarchicLayouter ihl; SequenceConstraintFactory cf = ihl.createSequenceConstraintFactory(null);... Graph g = ...; g.addDataProvider(SequenceConstraintFactory.SEQUENCE_CONSTRAINTS_MEMENTO_DPKEY, DataProviders.createConstantDataProvider(cf.getMemento())); //Calculate layout
Parameters
graph:LayoutGraph |
SequenceConstraintFactory — A SequenceConstraintFactory instance for use with the given graph.
|
See also
doLayoutCore | () | method |
override public function doLayoutCore(g:LayoutGraph):void
Performs the actual layout using the currently set mode.
Parameters
g:LayoutGraph |
See also
getClass | () | method |
override public function getClass():Class
ReturnsClass |
initIncrementalHierarchicLayouter | () | method |
protected final function initIncrementalHierarchicLayouter():void
Initializes this object. See the documentation of the corresponding factory method newIncrementalHierarchicLayouter()
for details.
See also
newIncrementalHierarchicLayouter | () | method |
public static function newIncrementalHierarchicLayouter():IncrementalHierarchicLayouter
Creates a new IncrementalHierarchicLayouter instance which is set to LAYOUT_MODE_FROM_SCRATCH initially
ReturnsIncrementalHierarchicLayouter |
See also
unconfigureCoreLayout | () | method |
protected function unconfigureCoreLayout(graph:LayoutGraph, ihl:HierarchicLayouterImpl):void
Called after the actual layout is performed. Overwrite this to manually unconfigure the instance. If com.yworks.yfiles.layout.PortCandidateSet.NODE_DP_KEY is registered with the layout graph and com.yworks.yfiles.layout.hierarchic.incremental.PCListOptimizer was registered with the instance during configureCoreLayout() it will be removed by this method.
Parameters
graph:LayoutGraph — the graph to be laid out
| |
ihl:HierarchicLayouterImpl — the instance used for the core layout.
|
See also
COMPONENT_ARRANGEMENT_COMPACT | Constant |
public static const COMPONENT_ARRANGEMENT_COMPACT:int = 0
Component arrangement constant that can be used in componentArrangementPolicy. If the graph consists of multiple components this constant specifies that, after layering the single components with the core layerer, the components will all be merged such that an 1:1 aspect ratio is fulfilled best.
See also
COMPONENT_ARRANGEMENT_TOPMOST | Constant |
public static const COMPONENT_ARRANGEMENT_TOPMOST:int = 1
Component arrangement constant that can be used in componentArrangementPolicy. If the graph consists of multiple components this constant specifies that, after layering the single components with the core layerer, the components are aligned with their topmost layer.
See also
CRITICAL_EDGE_DPKEY | Constant |
public static const CRITICAL_EDGE_DPKEY:Object = y.layout.IncrementalHierarchicLayouter.STRAIGHT_EDGES_DPKEY
com.yworks.yfiles.base.DataProvider key used to store the priority (integer values) for "critical" edges. The layouter tries to vertically align each node pair that is connected by a critical edge (integer value > 0). This feature can for example be utilized to highlight different edge paths that are relevant for a user. Conflicts between different critical edges are always resolved in favor of the higher priority.
Note: "critical" edges of aligned nodes are always placed at the center port. Hence, the edge distribution is no longer uniform.
Note: "critical" edges do no affect the result of the crossing minimization ( com.yworks.yfiles.layout.hierarchic.incremental.Sequencer) phase. Hence, there may be crossings between two "critical" edges.
See also
INCREMENTAL_HINTS_DPKEY | Constant |
public static const INCREMENTAL_HINTS_DPKEY:Object = y.layout.hierarchic.incremental.HierarchicLayouter.INCREMENTAL_HINTS_DPKEY
com.yworks.yfiles.base.DataProvider key used to store incremental layout hints that can be retrieved from the com.yworks.yfiles.layout.hierarchic.incremental.IncrementalHintsFactory which itself can be obtained from the createIncrementalHintsFactory() method.
See also
LAYER_VALUE_HOLDER_DPKEY | Constant |
public static const LAYER_VALUE_HOLDER_DPKEY:Object = y.layout.hierarchic.incremental.HierarchicLayouter.LAYER_VALUE_HOLDER_DPKEY
Used for publishing the final layering information. If the com.yworks.yfiles.base.DataProvider associated to this key is also a com.yworks.yfiles.base.DataAcceptor, the integer layer id of each node is stored using the acceptor's setInt (com.yworks.yfiles.base.DataAcceptor.setInt()) method. Otherwise, the provider's values should be of type com.yworks.yfiles.layout.hierarchic.incremental.IntValueHolder and the value holder's setValue (com.yworks.yfiles.layout.hierarchic.incremental.IntValueHolder.value) method is used to store the integer layer ids of each node.
See also
LAYERING_STRATEGY_BFS | Constant |
public static const LAYERING_STRATEGY_BFS:int = 4
Layering strategy specifier. Layering based on a breadth first search (bfs). All edges will span at most one layer in the resulting drawing. Edges between nodes that belong to the same layer are possible. The nodes that will be placed in the first layer can be provided by a data provider bound to the input graph using the key com.yworks.yfiles.layout.hierarchic.BFSLayerer.CORE_NODES. If this data provider is not given, then nodes that have no incoming edges are placed in the first layer.
See also
LAYERING_STRATEGY_FROM_SKETCH | Constant |
public static const LAYERING_STRATEGY_FROM_SKETCH:int = 5
Layering strategy specifier. A layer assignment strategy that uses the initial y-coordinates of the nodes (x-coordinates when the layout orientation is horizontal) to determine a node layering. It tries to find a layering that is similar to the one in the input graph. When this layering strategy is used, the layouter may place nodes in the same layer, even though they are connected by an edge. These inner layer edges are always routed in an orthogonal style.
See also
LAYERING_STRATEGY_HIERARCHICAL_DOWNSHIFT | Constant |
public static const LAYERING_STRATEGY_HIERARCHICAL_DOWNSHIFT:int = 3
Layering strategy specifier. A fast heuristic that improves the the ranking done by LAYERING_STRATEGY_HIERARCHICAL_TOPMOST by down shifting some nodes in the layering. The quality is usually worse than the one produced by Tight Tree Heuristic.
See also
LAYERING_STRATEGY_HIERARCHICAL_OPTIMAL | Constant |
public static const LAYERING_STRATEGY_HIERARCHICAL_OPTIMAL:int = 1
Layering strategy specifier. An optimal hierarchical layering strategy. The layer distance of an edge is the absolute difference between the layer numbers of its source and target node. Layer assignment will be done in such a way that the overall sum of the layer distances of all edges in the layout is minimal.
See also
LAYERING_STRATEGY_HIERARCHICAL_TIGHT_TREE | Constant |
public static const LAYERING_STRATEGY_HIERARCHICAL_TIGHT_TREE:int = 2
Layering strategy specifier. A heuristic that approximates the ranking done by LAYERING_STRATEGY_HIERARCHICAL_OPTIMAL.
See also
LAYERING_STRATEGY_HIERARCHICAL_TOPMOST | Constant |
public static const LAYERING_STRATEGY_HIERARCHICAL_TOPMOST:int = 0
Layering strategy constant. A simple hierarchical layering variant. All nodes with indegree zero will be assigned to the topmost layer of the layout. The number of separate layers will be as small as possible.
See also
LAYERING_STRATEGY_UNKNOWN | Constant |
public static const LAYERING_STRATEGY_UNKNOWN:int = -1
Dummy layering strategy specifier. Returned by fromScratchLayeringStrategy if the current strategy is not known.
See also
LAYERING_STRATEGY_USER_DEFINED | Constant |
public static const LAYERING_STRATEGY_USER_DEFINED:int = 6
Layering strategy specifier. The ranks of the nodes will be given by the user. The node ranks must be provided by a data provider bound to the input graph using the key com.yworks.yfiles.layout.hierarchic.GivenLayersLayerer.LAYER_ID_KEY . Like LAYERING_STRATEGY_FROM_SKETCH this layering allows inner layer edges.
See also
LAYOUT_MODE_FROM_SCRATCH | Constant |
public static const LAYOUT_MODE_FROM_SCRATCH:int = 1
Layout mode constant that can be used in layoutMode. This constant sets the layout algorithm to "from scratch mode", i.e. the algorithm will recompute the layout from scratch.
See also
LAYOUT_MODE_INCREMENTAL | Constant |
public static const LAYOUT_MODE_INCREMENTAL:int = 0
Layout mode constant that can be used in layoutMode.
This constant sets the layout algorithm to incremental mode, i.e. fixed elements will be handled by the fixedElementsSequencer
and fixedElementsLayerer
and elements marked for incremental layout will be added to the drawing later.
See also
POLICY_ALIGN_GROUPS_BOTTOM | Constant |
public static const POLICY_ALIGN_GROUPS_BOTTOM:int = 34
Group layering alignment strategy specifier. If recursive group layering is enabled, groups and normal nodes that occupy the same layer are bottom aligned with respect to their inner layers.
See also
POLICY_ALIGN_GROUPS_CENTER | Constant |
public static const POLICY_ALIGN_GROUPS_CENTER:int = 66
Group layering alignment strategy specifier. If recursive group layering is enabled, groups and normal nodes that occupy the same layer are center aligned with respect to their inner layers.
See also
POLICY_ALIGN_GROUPS_TOP | Constant |
public static const POLICY_ALIGN_GROUPS_TOP:int = 18
Group layering alignment strategy specifier. If recursive group layering is enabled, groups and normal nodes that occupy the same layer are top aligned with respect to their inner layers.
See also
SEQUENCE_VALUE_HOLDER_DPKEY | Constant |
public static const SEQUENCE_VALUE_HOLDER_DPKEY:Object = y.layout.hierarchic.incremental.HierarchicLayouter.SEQUENCE_VALUE_HOLDER_DPKEY
Used for publishing the final sequencing information. If the com.yworks.yfiles.base.DataProvider associated to this key is also a com.yworks.yfiles.base.DataAcceptor, the sequence order number of each node is stored using the acceptor's setInt (com.yworks.yfiles.base.DataAcceptor.setInt()) method. Otherwise, the provider's values should be of type com.yworks.yfiles.layout.hierarchic.incremental.IntValueHolder and the value holder's setValue (com.yworks.yfiles.layout.hierarchic.incremental.IntValueHolder.value) method is used to store the sequence order number of each node.
See also
SWIMLANE_DESCRIPTOR_DPKEY | Constant |
public static const SWIMLANE_DESCRIPTOR_DPKEY:Object = y.layout.hierarchic.incremental.HierarchicLayouter.SWIMLANE_DESCRIPTOR_DPKEY
com.yworks.yfiles.base.DataProvider key used to store com.yworks.yfiles.layout.hierarchic.incremental.SwimLaneDescriptor instances for each node in the graph. If this key is present during the layout. The layout algorithm will arrange nodes in swim lanes. The information about the swim lanes is finally written back into the descriptor instances. Instances can be shared among multiple nodes in the same lane, but don't have to be shared.
See also