Packagecom.yworks.yfiles.layout.orthogonal
Classpublic class OrthogonalLayouter
InheritanceOrthogonalLayouter Inheritance CanonicMultiStageLayouter Inheritance YObject Inheritance Object

This class provides a layout algorithm which produces orthogonal drawings.

OrthogonalLayouter can consider edge label data when laying out a graph. That means that the the layout of edge labels will be part of the resulting layout and the layout of nodes and edges is chosen in such a way that the edge labels do not conflict with the rest of the layout. See classes com.yworks.yfiles.layout.LabelLayoutData, com.yworks.yfiles.layout.LabelLayoutConstants com.yworks.yfiles.layout.LabelLayoutKeys and com.yworks.yfiles.layout.LabelLayoutTranslator on how to setup the integrated edge label layout feature.

Here is an sample output of the layouter using the layout style NORMAL_STYLE.

See also

com.yworks.yfiles.layout.LabelLayoutData
com.yworks.yfiles.layout.LabelLayoutConstants
com.yworks.yfiles.layout.LabelLayoutKeys
com.yworks.yfiles.layout.LabelLayoutTranslator
NORMAL_STYLE


Public Properties
 PropertyDefined By
  alignDegreeOneNodes : Boolean
Specifies whether the algorithm should try to align degree-one nodes that have the same neighbour.
OrthogonalLayouter
 InheritedcomponentLayouter : LayoutStage
Specifies the LayoutStage responsible for laying out the connected components of the graph.
CanonicMultiStageLayouter
 InheritedcomponentLayouterEnabled : Boolean
Getter: Returns whether or not ComponentLayouter is enabled.
CanonicMultiStageLayouter
  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).
OrthogonalLayouter
  edgeLayoutDescriptor : EdgeLayoutDescriptor
Specifies the EdgeLayoutDescriptor instance used for all those edges, that do not have a specific layout descriptor assigned.
OrthogonalLayouter
  grid : int
Specifies the size of the grid on which the nodes and edges are placed. Default is 20.
OrthogonalLayouter
 InheritedgroupNodeHider : LayoutStage
Specifies the LayoutStage that is responsible for hiding away grouping information for the layout algorithm.
CanonicMultiStageLayouter
 InheritedhideGroupNodes : Boolean
Specifies whether or not to hide away group nodes before the layout begins.
CanonicMultiStageLayouter
  integratedEdgeLabeling : Boolean
Getter: Returns whether integrated edge labeling is enabled.
OrthogonalLayouter
 InheritedlabelLayouter : LayoutStage
Getter: Returns the algorithm used for placing labels.
CanonicMultiStageLayouter
 InheritedlabelLayouterEnabled : Boolean
Getter: Returns whether or not LabelLayouter is enabled.
CanonicMultiStageLayouter
 InheritedlayoutOrientation : int
Specifies the main layout orientation.
CanonicMultiStageLayouter
  layoutStyle : int
Getter: Returns the layout style of this layouter.
OrthogonalLayouter
  nodeModel : int
OrthogonalLayouter
  optimizePerceivedBends : Boolean
Specifies whether the algorithm should perform a post processing algorithm to reduce perceived bends in the drawing.
OrthogonalLayouter
 InheritedorientationLayouter : LayoutStage
Specifies the LayoutStage that is responsible for changing the orientation of the computed layout.
CanonicMultiStageLayouter
 InheritedorientationLayouterEnabled : Boolean
Getter: Returns whether or not the OrientationLayouter is enabled.
CanonicMultiStageLayouter
 InheritedparallelEdgeLayouter : LayoutStage
Getter: Returns the LayoutStage responsible for routing parallel edges.
CanonicMultiStageLayouter
 InheritedparallelEdgeLayouterEnabled : Boolean
Getter: Returns whether or not the ParallelEdgeLayouter is enabled.
CanonicMultiStageLayouter
 InheritedselfLoopLayouter : LayoutStage
Getter: Returns the LayoutStage used for routing Self-loops.
CanonicMultiStageLayouter
 InheritedselfLoopLayouterEnabled : Boolean
Getter: Returns whether or not the SelfLoopLayouter is enabled.
CanonicMultiStageLayouter
 InheritedsubgraphLayouter : LayoutStage
Specifies the LayoutStage that is responsible for constraining the layout process to a subgraph of the target graph.
CanonicMultiStageLayouter
 InheritedsubgraphLayouterEnabled : Boolean
Getter: Returns whether or not the SubgraphLayouter is enabled.
CanonicMultiStageLayouter
  useCrossingPostprocessing : Boolean
Getter: Returns if post-processing is used to reduce the number of crossings.
OrthogonalLayouter
  useFaceMaximization : Boolean
Specifies if the layouter should try to maximize one face of the embedding.
OrthogonalLayouter
  useLengthReduction : Boolean
Specifies if the algorithm optimizes over the length of the edges.
OrthogonalLayouter
  useRandomization : Boolean
Getter: Returns if a randomization strategy is used.
OrthogonalLayouter
  useSketchDrawing : Boolean
Specifies if the existing drawing should be used as sketch.
OrthogonalLayouter
  useSpacePostprocessing : Boolean
Getter: Returns if post-processing is used to reduce the space used by the drawing.
OrthogonalLayouter
Public Methods
 MethodDefined By
  
OrthogonalLayouter(init:Boolean = true)
Returns a new instance.
OrthogonalLayouter
 Inherited
Appends a stage to the layout pipeline.
CanonicMultiStageLayouter
 Inherited
Returns a layout for the given layout graph.
CanonicMultiStageLayouter
 Inherited
Returns a layout for the given graph interface and layout.
CanonicMultiStageLayouter
 Inherited
canLayout(graph:LayoutGraph):Boolean
Tests whether or not the given graph can be laid out by this layouter.
CanonicMultiStageLayouter
  
canLayoutCore(graph:LayoutGraph):Boolean
[override] Returns always true.
OrthogonalLayouter
 Inherited
doLayout(layoutGraph:LayoutGraph):void
Calculates a layout for the given graph.
CanonicMultiStageLayouter
 Inherited
Calculates a layout for the given graph interface and layout.
CanonicMultiStageLayouter
  
[override] Assigns an orthogonal graph layout to the given layout graph.
OrthogonalLayouter
 Inherited
Disables all layout stages and performs only the core layouter.
CanonicMultiStageLayouter
 Inherited
equals(o:Object):Boolean
YObject
  
getClass():Class
[override]
OrthogonalLayouter
 Inherited
hashCode():int
YObject
  
[static] Returns a new instance.
OrthogonalLayouter
 Inherited
Prepends a stage to the layout pipeline.
CanonicMultiStageLayouter
 Inherited
Removes a LayoutStage that has been previously added by the methods appendStage() or prependStage().
CanonicMultiStageLayouter
Protected Methods
 MethodDefined By
 Inherited
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
 Inherited
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
  
Factory method that creates the default EdgeLayoutDescriptor.
OrthogonalLayouter
 Inherited
CanonicMultiStageLayouter
  
Initializes this object.
OrthogonalLayouter
Public Constants
 ConstantDefined By
  BOX_STYLE : int = 2
[static] Layout style specifier.
OrthogonalLayouter
  EDGE_LAYOUT_DESCRIPTOR_DPKEY : Object = y.layout.orthogonal.OrthogonalLayouter.EDGE_LAYOUT_DESCRIPTOR_DPKEY
[static] com.yworks.yfiles.base.DataProvider key used to retrieve com.yworks.yfiles.layout.orthogonal.EdgeLayoutDescriptor instances for each edge in the graph.
OrthogonalLayouter
  FIXED_BOX_STYLE : int = 6
[static] Layout style specifier.
OrthogonalLayouter
  FIXED_MIXED_STYLE : int = 5
[static] Layout style specifier.
OrthogonalLayouter
  MIXED_STYLE : int = 3
[static] Layout style specifier.
OrthogonalLayouter
  NODEMODEL_UNCHANGED : int = 0
[static]
OrthogonalLayouter
  NODEMODEL_UNIFORM : int = 1
[static]
OrthogonalLayouter
  NORMAL_STYLE : int = 0
[static] Layout style specifier.
OrthogonalLayouter
  NORMAL_TREE_STYLE : int = 4
[static] Layout style specifier.
OrthogonalLayouter
  UNIFORM_STYLE : int = 1
[static] Layout style specifier.
OrthogonalLayouter
Property Detail
alignDegreeOneNodesproperty
alignDegreeOneNodes:Boolean

Specifies whether the algorithm should try to align degree-one nodes that have the same neighbour. The default is false.


Implementation
    public function get alignDegreeOneNodes():Boolean
    public function set alignDegreeOneNodes(value:Boolean):void
considerNodeLabelsproperty 
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.

Setter: Specifies whether or not to consider node labels when calculating node positions (thereby preventing possible node/node label or node label/node label overlaps). This method is a convenience method that assures that the com.yworks.yfiles.layout.CanonicMultiStageLayouter.labelLayouter label layouter is of type com.yworks.yfiles.layout.LabelLayoutTranslator and com.yworks.yfiles.layout.LabelLayoutTranslator.translateNodeLabels is set to 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. Furthermore, node labels can only be considered if the layout style is set to NORMAL_STYLE.


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

Throws
Error — if the current label layouter is not of type com.yworks.yfiles.layout.LabelLayoutTranslator.

See also

edgeLayoutDescriptorproperty 
edgeLayoutDescriptor:EdgeLayoutDescriptor

Specifies the EdgeLayoutDescriptor instance used for all those edges, that do not have a specific layout descriptor assigned.


Implementation
    public function get edgeLayoutDescriptor():EdgeLayoutDescriptor
    public function set edgeLayoutDescriptor(value:EdgeLayoutDescriptor):void

Throws
ReferenceError — if the argument is null

See also

gridproperty 
grid:int

Specifies the size of the grid on which the nodes and edges are placed. Default is 20.


Implementation
    public function get grid():int
    public function set grid(value:int):void
integratedEdgeLabelingproperty 
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.

Setter: Specifies whether or not to use integrated edge labeling. This method is a convenience method that assures that the label layouter (com.yworks.yfiles.layout.CanonicMultiStageLayouter.labelLayouter) is of type com.yworks.yfiles.layout.LabelLayoutTranslator and com.yworks.yfiles.layout.LabelLayoutTranslator.translateEdgeLabels is set to true Note: edge labels can only be considered if the layout style is set to NORMAL_STYLE.


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

Throws
Error — if the current label layouter is not of type com.yworks.yfiles.layout.LabelLayoutTranslator.

See also

layoutStyleproperty 
layoutStyle:int

Getter: Returns the layout style of this layouter.

Setter: Sets the layout style for this layouter. By default the layout style NORMAL_STYLE is set.


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

See also

nodeModelproperty 
nodeModel:int


Implementation
    public function get nodeModel():int
    public function set nodeModel(value:int):void
optimizePerceivedBendsproperty 
optimizePerceivedBends:Boolean

Specifies whether the algorithm should perform a post processing algorithm to reduce perceived bends in the drawing. The default is false.


Implementation
    public function get optimizePerceivedBends():Boolean
    public function set optimizePerceivedBends(value:Boolean):void
useCrossingPostprocessingproperty 
useCrossingPostprocessing:Boolean

Getter: Returns if post-processing is used to reduce the number of crossings. Default is true.

Setter: Sets if post-processing is used to reduce the number of crossings. This post-processing may decrease the number of crossings significantly but it may slows down the algorithm, too. Default is true.


Implementation
    public function get useCrossingPostprocessing():Boolean
    public function set useCrossingPostprocessing(value:Boolean):void
useFaceMaximizationproperty 
useFaceMaximization:Boolean

Specifies if the layouter should try to maximize one face of the embedding. Default is false.


Implementation
    public function get useFaceMaximization():Boolean
    public function set useFaceMaximization(value:Boolean):void
useLengthReductionproperty 
useLengthReduction:Boolean

Specifies if the algorithm optimizes over the length of the edges. This may decrease the length of some edges significantly but it slows the algorithm down. Default is true.


Implementation
    public function get useLengthReduction():Boolean
    public function set useLengthReduction(value:Boolean):void
useRandomizationproperty 
useRandomization:Boolean

Getter: Returns if a randomization strategy is used. Default is true.

Setter: Sets if a randomization strategy is used. The randomization usually improves the result but it may be disabled to get a deterministic behavior of the algorithm. Default is true.


Implementation
    public function get useRandomization():Boolean
    public function set useRandomization(value:Boolean):void
useSketchDrawingproperty 
useSketchDrawing:Boolean

Specifies if the existing drawing should be used as sketch.


Implementation
    public function get useSketchDrawing():Boolean
    public function set useSketchDrawing(value:Boolean):void
useSpacePostprocessingproperty 
useSpacePostprocessing:Boolean

Getter: Returns if post-processing is used to reduce the space used by the drawing. Default is true.

Setter: Sets if post-processing is used to reduce the space used by the drawing. This post-processing may decrease space significantly but it slows the algorithm down. Default is true.


Implementation
    public function get useSpacePostprocessing():Boolean
    public function set useSpacePostprocessing(value:Boolean):void
Constructor Detail
OrthogonalLayouter()Constructor
public function OrthogonalLayouter(init:Boolean = true)

Returns a new instance.

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
canLayoutCore()method
override public function canLayoutCore(graph:LayoutGraph):Boolean

Returns always true.

Parameters

graph:LayoutGraph

Returns
Boolean
createEdgeLayoutDescriptor()method 
protected function createEdgeLayoutDescriptor():EdgeLayoutDescriptor

Factory method that creates the default EdgeLayoutDescriptor. May not return null!

Returns
EdgeLayoutDescriptor — a new EdgeLayoutDescriptor (new EdgeLayoutDescriptor())
doLayoutCore()method 
override public function doLayoutCore(graph:LayoutGraph):void

Assigns an orthogonal graph layout to the given layout graph.

Parameters

graph:LayoutGraph

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

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

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

See also

newOrthogonalLayouter()method 
public static function newOrthogonalLayouter():OrthogonalLayouter

Returns a new instance.

Returns
OrthogonalLayouter
Constant Detail
BOX_STYLEConstant
public static const BOX_STYLE:int = 2

Layout style specifier. In this layout style the size of the original nodes will be enlarged in order to save some bends. All edges will be routed orthogonally.

EDGE_LAYOUT_DESCRIPTOR_DPKEYConstant 
public static const EDGE_LAYOUT_DESCRIPTOR_DPKEY:Object = y.layout.orthogonal.OrthogonalLayouter.EDGE_LAYOUT_DESCRIPTOR_DPKEY

com.yworks.yfiles.base.DataProvider key used to retrieve com.yworks.yfiles.layout.orthogonal.EdgeLayoutDescriptor instances for each edge in the graph. Different settings will affect the routing of the edges during the layout. Note: minimum edge length constraints are only considered for layout style NORMAL_STYLE, NORMAL_TREE_STYLE and UNIFORM_STYLE (see layoutStyle).

See also

FIXED_BOX_STYLEConstant 
public static const FIXED_BOX_STYLE:int = 6

Layout style specifier. Nodes will be placed at the same location as with FIXED_MIXED_STYLE but edges will be routed strictly orthogonally. The size of nodes will not be altered.

See also

FIXED_MIXED_STYLEConstant 
public static const FIXED_MIXED_STYLE:int = 5

Layout style specifier. In this layout style not all edges will be routed orthogonally. Edge segments that directly connect to a node may be routed non-vertically and non-horizontally. The size of nodes will not be altered.

MIXED_STYLEConstant 
public static const MIXED_STYLE:int = 3

Layout style specifier. In this layout style not all edges will be routed orthogonally. Edge segments that directly connect to a node may be routed non-vertically and non-horizontally. A small uniform size will be assigned to all nodes.

NODEMODEL_UNCHANGEDConstant 
public static const NODEMODEL_UNCHANGED:int = 0

NODEMODEL_UNIFORMConstant 
public static const NODEMODEL_UNIFORM:int = 1

NORMAL_STYLEConstant 
public static const NORMAL_STYLE:int = 0

Layout style specifier. In this layout style the size of the nodes will not be changed by the algorithm. All edges will be routed orthogonally.

NORMAL_TREE_STYLEConstant 
public static const NORMAL_TREE_STYLE:int = 4

Layout style specifier. Like NORMAL_STYLE but all directed subtree structures of the graph will be laid out in an optimized way. All edges will be routed orthogonally. The tree edges will be routed in a bus-like fashion.

See also

UNIFORM_STYLEConstant 
public static const UNIFORM_STYLE:int = 1

Layout style specifier. In this layout style a uniform size will be assigned to all nodes. All edges will be routed orthogonally.