Packagecom.yworks.yfiles.layout
Classpublic class FixNodeLayoutStage
InheritanceFixNodeLayoutStage Inheritance AbstractLayoutStage Inheritance YObject Inheritance Object

Layout stage that can be used to fix the position of either a single node or the alignment of the bounding box of several nodes (but not the positions of the individual nodes).



Public Properties
 PropertyDefined By
 InheritedcoreLayouter : Layouter
Specifies the core layouter.
AbstractLayoutStage
  fixPointPolicy : int
Specifies the fix point calculation policy used in calculateFixPoint() to determine which point in the corresponding rectangle should be considered fixed.
FixNodeLayoutStage
  includingEdges : Boolean
Determines whether or not subgraph edges should be taken into account when calculating the bounding box of the fixed nodes.
FixNodeLayoutStage
  includingLabels : Boolean
Determines whether or not label geometries should be taken into account when calculating the bounding box of the fixed nodes.
FixNodeLayoutStage
Public Methods
 MethodDefined By
  
FixNodeLayoutStage(init:Boolean = true)
Initializes a new FixNodeLayoutStage.
FixNodeLayoutStage
  
canLayout(graph:LayoutGraph):Boolean
[override]
FixNodeLayoutStage
  
doLayout(graph:LayoutGraph):void
[override]
FixNodeLayoutStage
 Inherited
equals(o:Object):Boolean
YObject
  
getClass():Class
[override]
FixNodeLayoutStage
 Inherited
hashCode():int
YObject
  
[static] Initializes a new FixNodeLayoutStage.
FixNodeLayoutStage
  
[static] Initializes a new FixNodeLayoutStage.
FixNodeLayoutStage
Protected Methods
 MethodDefined By
  
Calculates the bounding box of the specified nodes.
FixNodeLayoutStage
  
Calculates the fix point of the specified rectangle according to the policy returned by fixPointPolicy.
FixNodeLayoutStage
  
Calculates the fix point for the specified nodes in the specified graph.
FixNodeLayoutStage
 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.
FixNodeLayoutStage
  
Initializes this object.
FixNodeLayoutStage
Public Constants
 ConstantDefined By
  FIXED_NODE_DPKEY : Object = y.layout.FixNodeLayoutStage.FIXED_NODE_DPKEY
[static] com.yworks.yfiles.base.DataProvider key to specify a DataProvider whose com.yworks.yfiles.base.DataProvider.getBool() method is used to determine which nodes should be considered fixed.
FixNodeLayoutStage
  FIX_POINT_POLICY_CENTER : int = 1
[static] Fix point calculation policy that results in the center of a given rectangle to be considered the fix point.
FixNodeLayoutStage
  FIX_POINT_POLICY_LOWER_LEFT : int = 5
[static] Fix point calculation policy that results in the lower left corner of a given rectangle to be considered the fix point.
FixNodeLayoutStage
  FIX_POINT_POLICY_LOWER_RIGHT : int = 4
[static] Fix point calculation policy that results in the lower right corner of a given rectangle to be considered the fix point.
FixNodeLayoutStage
  FIX_POINT_POLICY_UPPER_LEFT : int = 2
[static] Fix point calculation policy that results in the upper left corner of a given rectangle to be considered the fix point.
FixNodeLayoutStage
  FIX_POINT_POLICY_UPPER_RIGHT : int = 3
[static] Fix point calculation policy that results in the upper right corner of a given rectangle to be considered the fix point.
FixNodeLayoutStage
Property Detail
fixPointPolicyproperty
fixPointPolicy:int

Specifies the fix point calculation policy used in calculateFixPoint() to determine which point in the corresponding rectangle should be considered fixed.

By default, FIX_POINT_POLICY_CENTER is used.


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

See also

includingEdgesproperty 
includingEdges:Boolean

Determines whether or not subgraph edges should be taken into account when calculating the bounding box of the fixed nodes.

By default, this property is set to false, i.e. subgraph edges are not taken into account.


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

See also

includingLabelsproperty 
includingLabels:Boolean

Determines whether or not label geometries should be taken into account when calculating the bounding box of the fixed nodes.

By default, this property is set to false, i.e. label geometries are not taken into account.


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

See also

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

Initializes a new FixNodeLayoutStage.

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
calculateBounds()method
protected function calculateBounds(graph:LayoutGraph, fixed:NodeList):Rectangle2D

Calculates the bounding box of the specified nodes. The return values of methods includingEdges and includingLabels determine whether or not edges and labels are taken into account when calculating the box.

Parameters

graph:LayoutGraph — the graph associated to the specified nodes.
 
fixed:NodeList — the list of nodes that determine the bounding box.

Returns
Rectangle2D — the bounding box of the specified nodes.

See also

calculateFixPoint()method 
protected function calculateFixPoint(bounds:Rectangle2D):YPoint

Calculates the fix point of the specified rectangle according to the policy returned by fixPointPolicy. If the specified rectangle is null or the rectangle has negative width or negative height, null will be returned.

Parameters

bounds:Rectangle2D — the rectangle for which to determine the fix point.

Returns
YPoint — the fix point of the specified rectangle or null if nothing should be fixed.

See also

calculateFixPoint2()method 
protected function calculateFixPoint2(graph:LayoutGraph, fixed:NodeList):YPoint

Calculates the fix point for the specified nodes in the specified graph. The default implementation calls calculateBounds() and calculateFixPoint().

Parameters

graph:LayoutGraph — the graph associated to the specified nodes.
 
fixed:NodeList — the list of nodes for which a fix point has to be determined.

Returns
YPoint — the fix point for the specified nodes in the specified graph.

See also

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

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

See also

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

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

Parameters

core:Layouter

See also

newFixNodeLayoutStage1()method 
public static function newFixNodeLayoutStage1():FixNodeLayoutStage

Initializes a new FixNodeLayoutStage.

Returns
FixNodeLayoutStage
newFixNodeLayoutStage2()method 
public static function newFixNodeLayoutStage2(core:Layouter):FixNodeLayoutStage

Initializes a new FixNodeLayoutStage.

Parameters

core:Layouter — the core layout algorithm for this stage.

Returns
FixNodeLayoutStage
Constant Detail
FIX_POINT_POLICY_CENTERConstant
public static const FIX_POINT_POLICY_CENTER:int = 1

Fix point calculation policy that results in the center of a given rectangle to be considered the fix point.

See also

FIX_POINT_POLICY_LOWER_LEFTConstant 
public static const FIX_POINT_POLICY_LOWER_LEFT:int = 5

Fix point calculation policy that results in the lower left corner of a given rectangle to be considered the fix point.

See also

FIX_POINT_POLICY_LOWER_RIGHTConstant 
public static const FIX_POINT_POLICY_LOWER_RIGHT:int = 4

Fix point calculation policy that results in the lower right corner of a given rectangle to be considered the fix point.

See also

FIX_POINT_POLICY_UPPER_LEFTConstant 
public static const FIX_POINT_POLICY_UPPER_LEFT:int = 2

Fix point calculation policy that results in the upper left corner of a given rectangle to be considered the fix point.

See also

FIX_POINT_POLICY_UPPER_RIGHTConstant 
public static const FIX_POINT_POLICY_UPPER_RIGHT:int = 3

Fix point calculation policy that results in the upper right corner of a given rectangle to be considered the fix point.

See also

FIXED_NODE_DPKEYConstant 
public static const FIXED_NODE_DPKEY:Object = y.layout.FixNodeLayoutStage.FIXED_NODE_DPKEY

com.yworks.yfiles.base.DataProvider key to specify a DataProvider whose com.yworks.yfiles.base.DataProvider.getBool() method is used to determine which nodes should be considered fixed.

See also