Packagecom.yworks.yfiles.layout
Classpublic class OrientationLayouter
InheritanceOrientationLayouter Inheritance AbstractLayoutStage Inheritance YObject Inheritance Object

A layout stage that performs changes the orientation of the layout that another algorithm calculates.

For all com.yworks.yfiles.layout.CanonicMultiStageLayouter s it is highly recommended to use com.yworks.yfiles.layout.CanonicMultiStageLayouter.orientationLayouter for layout orientation changes and not to wrap the CanonicMultiStageLayouter with an OrientationLayouter, which may cause unwanted artifacts.

See also

com.yworks.yfiles.layout.CanonicMultiStageLayouter
com.yworks.yfiles.layout.CanonicMultiStageLayouter.orientationLayouter


Public Properties
 PropertyDefined By
  considerEdgeLabelsEnabled : Boolean
Getter: Returns whether or not the position of the edge labels should be changed during orientation change.
OrientationLayouter
 InheritedcoreLayouter : Layouter
Specifies the core layouter.
AbstractLayoutStage
  horizontalOrientation : Boolean
[read-only] Returns whether or not the set orientation is a horizontal orientation, i.e.
OrientationLayouter
  mirrorMask : int
Specifies the mirror mask, that defines which orientations this layouter shall mirror.
OrientationLayouter
  orientation : int
Specifies the orientation of the layout.
OrientationLayouter
Public Methods
 MethodDefined By
  
OrientationLayouter(init:Boolean = true)
Instantiates a new OrientationLayouter.
OrientationLayouter
  
canLayout(graph:LayoutGraph):Boolean
[override]
OrientationLayouter
  
Create and return an insets object that is a geometric transform of the given insets.
OrientationLayouter
  
Create and return an insets object that is a geometric transform of the given insets.
OrientationLayouter
  
Create and return a node halo object that is a geometric transform of the given node halo.
OrientationLayouter
  
Create and return an YDimension object that is a geometric transform of the given size.
OrientationLayouter
  
doLayout(graph:LayoutGraph):void
[override]
OrientationLayouter
 Inherited
equals(o:Object):Boolean
YObject
  
getClass():Class
[override]
OrientationLayouter
 Inherited
hashCode():int
YObject
  
isOrientationMirrored(orientation:int):Boolean
This method will return whether the layouter will mirror the graph for a given layout orientation.
OrientationLayouter
  
[static] Instantiates a new OrientationLayouter.
OrientationLayouter
  
[static] Instantiates a new OrientationLayouter with a given orientation.
OrientationLayouter
  
[static] Instantiates a new OrientationLayouter.
OrientationLayouter
Protected Methods
 MethodDefined By
 Inherited
canLayoutCore(graph:LayoutGraph):Boolean
Queries the core layouter whether or not the given graph can be laid out.
AbstractLayoutStage
  
Method that will be called after the core layouter has been activated.
OrientationLayouter
  
Transforms a point for the completion phase.
OrientationLayouter
 Inherited
Invokes the layout routine of the core layouter.
AbstractLayoutStage
 Inherited
AbstractLayoutStage
 Inherited
AbstractLayoutStage
  
Initializes this object.
OrientationLayouter
  
initOrientationLayouter2(orientation:int):void
Initializes this object.
OrientationLayouter
  
Initializes this object.
OrientationLayouter
  
Method that will be called before the core layouter gets activated.
OrientationLayouter
  
Transforms a point for the preparation phase.
OrientationLayouter
  
transform(p:YPoint, prepare:Boolean):YPoint
Transforms a point for the preparation or completion phase.
OrientationLayouter
Public Constants
 ConstantDefined By
  MIRROR_BOTTOM_TO_TOP : int = 4
[static] Constant that can be used to create the mirror mask, that defines which layout orientations shall be mirrored at their corresponding axis.
OrientationLayouter
  MIRROR_LEFT_TO_RIGHT : int = 8
[static] Constant that can be used to create the mirror mask, that defines which layout orientations shall be mirrored at their corresponding axis.
OrientationLayouter
  MIRROR_NONE : int = 0
[static] Constant that can be used to prevent any mirroring of layout orientations.
OrientationLayouter
  MIRROR_RIGHT_TO_LEFT : int = 2
[static] Constant that can be used to create the mirror mask, that defines which layout orientations shall be mirrored at their corresponding axis.
OrientationLayouter
  MIRROR_TOP_TO_BOTTOM : int = 1
[static] Constant that can be used to create the mirror mask, that defines which layout orientations shall be mirrored at their corresponding axis.
OrientationLayouter
Property Detail
considerEdgeLabelsEnabledproperty
considerEdgeLabelsEnabled:Boolean

Getter: Returns whether or not the position of the edge labels should be changed during orientation change. Default is true.

Setter: Specifies whether or not the position of the edge labels should be changed during orientation change. The core layouter should switch this off, when its integrated edge labeling is switched on. Default is true.


Implementation
    public function get considerEdgeLabelsEnabled():Boolean
    public function set considerEdgeLabelsEnabled(value:Boolean):void
horizontalOrientationproperty 
horizontalOrientation:Boolean  [read-only]

Returns whether or not the set orientation is a horizontal orientation, i.e. one of com.yworks.yfiles.layout.LayoutOrientation.LEFT_TO_RIGHT or com.yworks.yfiles.layout.LayoutOrientation.RIGHT_TO_LEFT.


Implementation
    public function get horizontalOrientation():Boolean

See also

mirrorMaskproperty 
mirrorMask:int

Specifies the mirror mask, that defines which orientations this layouter shall mirror. 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

orientationproperty 
orientation:int

Specifies the orientation of the layout. By default com.yworks.yfiles.layout.LayoutOrientation.TOP_TO_BOTTOM is set.


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

See also

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

Instantiates a new OrientationLayouter.

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
completeOrientationChange()method 
protected function completeOrientationChange(graph:LayoutGraph):void

Method that will be called after the core layouter has been activated. It performs the inverse coordinate transformation that has been applied to the layout by method prepareOrientationChange().

Parameters

graph:LayoutGraph

See also

completeTransform()method 
protected function completeTransform(p:YPoint):YPoint

Transforms a point for the completion phase.

Parameters

p:YPoint

Returns
YPoint

See also

createOrientedInsets()method 
public function createOrientedInsets(insets:Insets):YInsets

Create and return an insets object that is a geometric transform of the given insets. The transform will correspond to the currently set orientation.

Parameters

insets:Insets

Returns
YInsets
createOrientedInsets2()method 
public function createOrientedInsets2(insets:YInsets):YInsets

Create and return an insets object that is a geometric transform of the given insets. The transform will correspond to the currently set orientation.

Parameters

insets:YInsets

Returns
YInsets
createOrientedNodeHalo()method 
public function createOrientedNodeHalo(halo:NodeHalo):NodeHalo

Create and return a node halo object that is a geometric transform of the given node halo. The transform will correspond to the currently set orientation.

Parameters

halo:NodeHalo

Returns
NodeHalo
createOrientedNodeSize()method 
public function createOrientedNodeSize(nodeSize:YDimension):YDimension

Create and return an YDimension object that is a geometric transform of the given size. The transform will correspond to the currently set orientation.

Parameters

nodeSize:YDimension

Returns
YDimension
doLayout()method 
override public function doLayout(graph:LayoutGraph):void

Parameters

graph:LayoutGraph

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

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

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

See also

initOrientationLayouter2()method 
protected final function initOrientationLayouter2(orientation:int):void

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

Parameters

orientation:int

See also

initOrientationLayouter3()method 
protected final function initOrientationLayouter3(coreLayouter:Layouter):void

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

Parameters

coreLayouter:Layouter

See also

isOrientationMirrored()method 
public function isOrientationMirrored(orientation:int):Boolean

This method will return whether the layouter will mirror the graph for a given layout orientation.

Parameters

orientation:int — the layout orientation, for which to check the mirror state.

Returns
Boolean
  • true - if the layouter will mirror the graph at the corresponding axis (x-Axis for horizontal orientations, y-Axis for vertical orientations) for the given layout orientation.
  • false - otherwise.
newOrientationLayouter1()method 
public static function newOrientationLayouter1():OrientationLayouter

Instantiates a new OrientationLayouter.

Returns
OrientationLayouter
newOrientationLayouter2()method 
public static function newOrientationLayouter2(orientation:int):OrientationLayouter

Instantiates a new OrientationLayouter with a given orientation.

Parameters

orientation:int

Returns
OrientationLayouter

See also

newOrientationLayouter3()method 
public static function newOrientationLayouter3(coreLayouter:Layouter):OrientationLayouter

Instantiates a new OrientationLayouter. the core layout routine will be delegated to the given layouter.

Parameters

coreLayouter:Layouter

Returns
OrientationLayouter
prepareOrientationChange()method 
protected function prepareOrientationChange(graph:LayoutGraph):void

Method that will be called before the core layouter gets activated. It prepares the layout for the desired orientation by rotating/mirroring the coordinates and bounds of the graph layout such that the core layouter can perform the layout in the canonical TOP_TO_BOTTOM manner.

Parameters

graph:LayoutGraph

prepareTransform()method 
protected function prepareTransform(p:YPoint):YPoint

Transforms a point for the preparation phase.

Parameters

p:YPoint

Returns
YPoint

See also

transform()method 
protected function transform(p:YPoint, prepare:Boolean):YPoint

Transforms a point for the preparation or completion phase.

Parameters

p:YPoint
 
prepare:Boolean — if true then the transformation is for the preparation phase, otherwise for the completion phase.

Returns
YPoint

See also

Constant Detail
MIRROR_BOTTOM_TO_TOPConstant
public static const MIRROR_BOTTOM_TO_TOP:int = 4

Constant that can be used to create the mirror mask, that defines which layout orientations shall be mirrored at their corresponding axis. Adding this constant to the mask will result in mirror the y-axis of the graph for layout orientation LayoutOrientation.BOTTOM_TO_TOP.

MIRROR_LEFT_TO_RIGHTConstant 
public static const MIRROR_LEFT_TO_RIGHT:int = 8

Constant that can be used to create the mirror mask, that defines which layout orientations shall be mirrored at their corresponding axis. Adding this constant to the mask will result in mirror the x-axis of the graph for layout orientation LayoutOrientation.LEFT_TO_RIGHT.

MIRROR_NONEConstant 
public static const MIRROR_NONE:int = 0

Constant that can be used to prevent any mirroring of layout orientations.

MIRROR_RIGHT_TO_LEFTConstant 
public static const MIRROR_RIGHT_TO_LEFT:int = 2

Constant that can be used to create the mirror mask, that defines which layout orientations shall be mirrored at their corresponding axis. Adding this constant to the mask will result in mirror the x-axis of the graph for layout orientation LayoutOrientation.RIGHT_TO_LEFT.

MIRROR_TOP_TO_BOTTOMConstant 
public static const MIRROR_TOP_TO_BOTTOM:int = 1

Constant that can be used to create the mirror mask, that defines which layout orientations shall be mirrored at their corresponding axis. Adding this constant to the mask will result in mirror the y-axis of the graph for layout orientation LayoutOrientation.TOP_TO_BOTTOM.