Packagecom.yworks.yfiles.layout.hierarchic.incremental
Classpublic class SimplexNodePlacer
InheritanceSimplexNodePlacer Inheritance YObject Inheritance Object
Implements NodePlacer

NodePlacer implementation based on rank-assignment (com.yworks.yfiles.algo.RankAssignments). The drawer works with integer values and rounds double values to integers using sophisticated quantizing.

See also

rank-assignment


Public Properties
 PropertyDefined By
  baryCenterMode : Boolean
Specifies whether or not to use the barycenter drawing mode.
SimplexNodePlacer
  bendReductionEnabled : Boolean
Specifies whether or not an optimization step should be applied that tries to further reduce the number of bends.
SimplexNodePlacer
  breakLongSegments : Boolean
Specifies whether this instance may break long edge segments in favor of a more compact layout.
SimplexNodePlacer
  exactPlacementEnforced : Boolean
Specifies whether this instance should enforce the placement of nodes at their exact current position, even if this violates minimum distance constraints.
SimplexNodePlacer
  fromSketchLayerAssignment : Boolean
Specifies whether this instance should try to use the coordinates given from the current sketch for the determination of the layer coordinates.
SimplexNodePlacer
  groupCompactionStrategy : int
Specifies the strategy that is used to control the horizontal compactness of group nodes.
SimplexNodePlacer
  horizontalCompaction : Boolean
Determines whether this instance tries to create a maximally compact horizontal layout at the cost of more bends.
SimplexNodePlacer
  maximalDuration : uint
Getter: Returns the time limit (in milliseconds) set for the algorithm.
SimplexNodePlacer
  minimumSublayerDistance : Number
Specifies the minimum distance between the upper and lower sublayer (see useNodeCompaction).
SimplexNodePlacer
  straightenEdges : Boolean
Whether or not a postprocessing step should be applied that tries to remove some bends.
SimplexNodePlacer
  swimLaneCrossingWeight : Number
Specifies the relative weight of edges crossing a swim lane relative to edges that stay in their lane.
SimplexNodePlacer
  useLabelCompaction : Boolean
Specifies whether or not labels should be placed in a more compact style.
SimplexNodePlacer
  useNodeCompaction : Boolean
Specifies whether or not nodes should be placed in a more compact style with respect to layout width.
SimplexNodePlacer
Public Methods
 MethodDefined By
  
SimplexNodePlacer(init:Boolean = true)
SimplexNodePlacer
  
assignLayerCoordinates(graph:LayoutGraph, layoutDataProvider:LayoutDataProvider, layers:Layers):void
SimplexNodePlacer
  
assignSequenceCoordinates(graph:LayoutGraph, layoutDataProvider:LayoutDataProvider, layers:Layers, drawingDistanceCalculator:DrawingDistanceCalculator):void
SimplexNodePlacer
 Inherited
equals(o:Object):Boolean
YObject
  
getClass():Class
[override]
SimplexNodePlacer
 Inherited
hashCode():int
YObject
  
[static]
SimplexNodePlacer
Protected Methods
 MethodDefined By
  
assignNodesToSublayer(layerNodes:NodeList, ldp:LayoutDataProvider, graph:LayoutGraph, lowerSublayer:NodeMap):void
If option useNodeCompaction is enabled, this method is called to assign the nodes of a layer to the corresponding upper/lower sublayer.
SimplexNodePlacer
  
getLayerAlignment(graph:LayoutGraph, ldp:LayoutDataProvider, node:Node, layerIndex:int, minLayerHeight:Number):Number
Callback method used by assignLayerCoordinates() to determine the alignment of the node inside the layer
SimplexNodePlacer
  
getMinDistance(graph:LayoutGraph, layer:Layer, predNode:Node, succ:Node):Number
Determines the minimum allowed distance between two nodes in a given layer
SimplexNodePlacer
  
Callback method used by assignLayerCoordinates() to determine the minimum height of a layer.
SimplexNodePlacer
  
SimplexNodePlacer
  
isFixedNode(graph:LayoutGraph, provider:LayoutDataProvider, node:Node, inLayer:Boolean):Boolean
Callback used by both assignLayerCoordinates() and assignSequenceCoordinates() to determine whether the given node should be treated as a node with fixed (given) coordinates.
SimplexNodePlacer
Public Constants
 ConstantDefined By
  GROUP_COMPACTION_MAX : int = 1
[static] Compaction strategy specifier for use with groupCompactionStrategy.
SimplexNodePlacer
  GROUP_COMPACTION_NONE : int = 0
[static] Compaction strategy specifier for use with groupCompactionStrategy.
SimplexNodePlacer
Property Detail
baryCenterModeproperty
baryCenterMode:Boolean

Specifies whether or not to use the barycenter drawing mode. If this mode is enabled the resulting drawing is likely to have more bends but may be more symmetric.

By default this mode is turned off.


Implementation
    public function get baryCenterMode():Boolean
    public function set baryCenterMode(value:Boolean):void
bendReductionEnabledproperty 
bendReductionEnabled:Boolean

Specifies whether or not an optimization step should be applied that tries to further reduce the number of bends. By default this option is enabled. Note: using this option may increase runtime. If the runtime exceeds the maximal duration (see maximalDuration) the number of bends is not reduced.


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

See also

breakLongSegmentsproperty 
breakLongSegments:Boolean

Specifies whether this instance may break long edge segments in favor of a more compact layout.


Implementation
    public function get breakLongSegments():Boolean
    public function set breakLongSegments(value:Boolean):void
exactPlacementEnforcedproperty 
exactPlacementEnforced:Boolean

Specifies whether this instance should enforce the placement of nodes at their exact current position, even if this violates minimum distance constraints.

The default is true.


Implementation
    public function get exactPlacementEnforced():Boolean
    public function set exactPlacementEnforced(value:Boolean):void
fromSketchLayerAssignmentproperty 
fromSketchLayerAssignment:Boolean

Specifies whether this instance should try to use the coordinates given from the current sketch for the determination of the layer coordinates.


Implementation
    public function get fromSketchLayerAssignment():Boolean
    public function set fromSketchLayerAssignment(value:Boolean):void
groupCompactionStrategyproperty 
groupCompactionStrategy:int

Specifies the strategy that is used to control the horizontal compactness of group nodes.


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

See also

horizontalCompactionproperty 
horizontalCompaction:Boolean

Determines whether this instance tries to create a maximally compact horizontal layout at the cost of more bends.

For best results, breakLongSegments and useLabelCompaction should also be enabled.


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

See also

maximalDurationproperty 
maximalDuration:uint

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

Setter: Sets a preferred time limit (in milliseconds) for the algorithm. Note that restricting the maximal duration may result in a worse layout quality. Furthermore, the real runtime may exceed the maximal duration since the algorithm still have to find a valid solution.


Implementation
    public function get maximalDuration():uint
    public function set maximalDuration(value:uint):void
minimumSublayerDistanceproperty 
minimumSublayerDistance:Number

Specifies the minimum distance between the upper and lower sublayer (see useNodeCompaction). Note that this option is only considered if the node compaction is enabled. Furthermore, a too small distance value may prevent adjacent nodes from being placed in a stacked style (horizontally interleaving) because the vertical distance between these nodes must be larger or equal to the value specified by com.yworks.yfiles.layout.hierarchic.incremental.NodeLayoutDescriptor.minimumDistance.


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

See also

straightenEdgesproperty 
straightenEdges:Boolean

Whether or not a postprocessing step should be applied that tries to remove some bends. Note that this option is only considered if option baryCenterMode and useNodeCompaction are both disabled. Furthermore, enabling edge straightening may violate some minimum distances specified by the user and the edge distribution is no longer uniform.

The default is false.


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

See also

swimLaneCrossingWeightproperty 
swimLaneCrossingWeight:Number

Specifies the relative weight of edges crossing a swim lane relative to edges that stay in their lane.

A value of 0.0d will effectively make the algorithm ignore edges crossing a swim lane border.

Defaults to 0.0d.


Implementation
    public function get swimLaneCrossingWeight():Number
    public function set swimLaneCrossingWeight(value:Number):void
useLabelCompactionproperty 
useLabelCompaction:Boolean

Specifies whether or not labels should be placed in a more compact style. If this option is enabled the algorithm tries to place adjacent label elements in a stacked style, i.e., horizontally interleaving. By default this option is disabled. Note that this option does not work with customized com.yworks.yfiles.layout.hierarchic.incremental.DrawingDistanceCalculator s, see com.yworks.yfiles.layout.hierarchic.incremental.HierarchicLayouterImpl.drawingDistanceCalculator.


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

See also

useNodeCompactionproperty 
useNodeCompaction:Boolean

Specifies whether or not nodes should be placed in a more compact style with respect to layout width. If enabled, the algorithm may place the nodes of a layer in a stacked style (horizontally interleaving), i.e., it splits the layer into an upper and lower sublayer and places adjacent nodes into different sublayers if this reduces the width of the layer. Note that enabling this option increases the required layout height. By default this option is disabled.

Note that this option does not work with customized com.yworks.yfiles.layout.hierarchic.incremental.DrawingDistanceCalculator s, see com.yworks.yfiles.layout.hierarchic.incremental.HierarchicLayouterImpl.drawingDistanceCalculator.


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

See also

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



Parameters
init:Boolean (default = true)
Method Detail
assignLayerCoordinates()method
public function assignLayerCoordinates(graph:LayoutGraph, layoutDataProvider:LayoutDataProvider, layers:Layers):void

Parameters

graph:LayoutGraph
 
layoutDataProvider:LayoutDataProvider
 
layers:Layers

assignNodesToSublayer()method 
protected function assignNodesToSublayer(layerNodes:NodeList, ldp:LayoutDataProvider, graph:LayoutGraph, lowerSublayer:NodeMap):void

If option useNodeCompaction is enabled, this method is called to assign the nodes of a layer to the corresponding upper/lower sublayer.

Parameters

layerNodes:NodeList — list that contains all normal nodes (see com.yworks.yfiles.layout.hierarchic.incremental.NodeDataConstants.TYPE_NORMAL) of a layer.
 
ldp:LayoutDataProvider — the LayoutDataProvider instance.
 
graph:LayoutGraph — the graph instance.
 
lowerSublayer:NodeMap — NodeMap whose com.yworks.yfiles.base.NodeMap.getBool() method has to return true for each node that should be placed in the lower sublayer (values are set by this method).

See also

assignSequenceCoordinates()method 
public function assignSequenceCoordinates(graph:LayoutGraph, layoutDataProvider:LayoutDataProvider, layers:Layers, drawingDistanceCalculator:DrawingDistanceCalculator):void

Parameters

graph:LayoutGraph
 
layoutDataProvider:LayoutDataProvider
 
layers:Layers
 
drawingDistanceCalculator:DrawingDistanceCalculator

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

Returns
Class
getLayerAlignment()method 
protected function getLayerAlignment(graph:LayoutGraph, ldp:LayoutDataProvider, node:Node, layerIndex:int, minLayerHeight:Number):Number

Callback method used by assignLayerCoordinates() to determine the alignment of the node inside the layer

Parameters

graph:LayoutGraph
 
ldp:LayoutDataProvider
 
node:Node
 
layerIndex:int
 
minLayerHeight:Number

Returns
Number

See also

getMinDistance()method 
protected function getMinDistance(graph:LayoutGraph, layer:Layer, predNode:Node, succ:Node):Number

Determines the minimum allowed distance between two nodes in a given layer

Parameters

graph:LayoutGraph — the graph that contains the nodes
 
layer:Layer — the layer that contains the nodes
 
predNode:Node — the node to the left of the other one, may be null to indicate a border line
 
succ:Node — the node to the right of the other one, may be null to indicate a border line

Returns
Number — the minimum distance allowed between those two nodes ( >=0 )

See also

getMinimumLayerHeight()method 
protected function getMinimumLayerHeight(graph:LayoutGraph, ldp:LayoutDataProvider, layer:Layer):Number

Callback method used by assignLayerCoordinates() to determine the minimum height of a layer.

Parameters

graph:LayoutGraph
 
ldp:LayoutDataProvider
 
layer:Layer

Returns
Number

See also

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

isFixedNode()method 
protected function isFixedNode(graph:LayoutGraph, provider:LayoutDataProvider, node:Node, inLayer:Boolean):Boolean

Callback used by both assignLayerCoordinates() and assignSequenceCoordinates() to determine whether the given node should be treated as a node with fixed (given) coordinates.

Parameters

graph:LayoutGraph — the graph that contains the node
 
provider:LayoutDataProvider — the current LayoutDataProvider
 
node:Node — the node
 
inLayer:Boolean — whether the nodes' layer coordinate is queried or the sequence coordinate. Iff inLayer is true this method is called from within the assignLayerCoordinates() method

Returns
Boolean — whether the node should be treated as fixed

See also

newSimplexNodePlacer()method 
public static function newSimplexNodePlacer():SimplexNodePlacer

Returns
SimplexNodePlacer
Constant Detail
GROUP_COMPACTION_MAXConstant
public static const GROUP_COMPACTION_MAX:int = 1

Compaction strategy specifier for use with groupCompactionStrategy. This specifies maximal horizontal group compaction, i.e. the node placer will try to minimize the horizontally occupied space for a group node.

See also

GROUP_COMPACTION_NONEConstant 
public static const GROUP_COMPACTION_NONE:int = 0

Compaction strategy specifier for use with groupCompactionStrategy. This specifies no horizontal group compaction, i.e. group node contents will occupy nearly the same horizontal positions as when not grouped at all.

See also