Packagecom.yworks.yfiles.layout.orthogonal
Classpublic class DirectedOrthogonalLayouter
InheritanceDirectedOrthogonalLayouter Inheritance CanonicMultiStageLayouter Inheritance YObject Inheritance Object

This class is a variant of com.yworks.yfiles.layout.orthogonal.OrthogonalLayouter that can route edges in a way that they point to a main layout direction. Also, this class can route edges that connect to the same node in a shared bus-structure. A typical use case for this layout algorithm are UML class diagrams that contain some relationships like generalization or realization which are best expressed by upward-pointing edges.

Directed edges are marked by a boolean data provider that is registered with the key DIRECTED_EDGE_DPKEY to the input graph. Edge groups at a common node can be specified by registering data providers with the keys com.yworks.yfiles.layout.PortConstraintKeys.SOURCE_GROUPID_KEY and com.yworks.yfiles.layout.PortConstraintKeys.TARGET_GROUPID_KEY.

Like com.yworks.yfiles.layout.orthogonal.OrthogonalLayouter this layout algorithm can consider edge label data when laying out a graph. That means that 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 layout algorithm. Note that all edges painted in blue are marked as directed edges. Also, the directed edges at each node have been put into the same edge group.

See also

com.yworks.yfiles.layout.orthogonal.OrthogonalLayouter
DIRECTED_EDGE_DPKEY
com.yworks.yfiles.layout.PortConstraintKeys.SOURCE_GROUPID_KEY
com.yworks.yfiles.layout.PortConstraintKeys.TARGET_GROUPID_KEY
com.yworks.yfiles.layout.LabelLayoutData
com.yworks.yfiles.layout.LabelLayoutConstants
com.yworks.yfiles.layout.LabelLayoutKeys
com.yworks.yfiles.layout.LabelLayoutTranslator


Public Properties
 PropertyDefined By
  alignDegreeOneNodes : Boolean
Specifies whether the algorithm should try to align degree-one nodes that have the same neighbour.
DirectedOrthogonalLayouter
 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).
DirectedOrthogonalLayouter
  edgeLayoutDescriptor : EdgeLayoutDescriptor
Specifies the EdgeLayoutDescriptor instance used for all those edges, that do not have a specific layout descriptor assigned.
DirectedOrthogonalLayouter
  grid : int
Getter: Returns the currently set grid spacing.
DirectedOrthogonalLayouter
 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.
DirectedOrthogonalLayouter
 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
  optimizePerceivedBends : Boolean
Specifies whether the algorithm should perform a post processing algorithm to reduce perceived bends in the drawing.
DirectedOrthogonalLayouter
 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
  usePostprocessing : Boolean
Specifies if an additional postprocessing step is used that improves compactness and reduces the number of edge bends.
DirectedOrthogonalLayouter
  useSketchDrawing : Boolean
Specifies if the existing drawing should be used as sketch.
DirectedOrthogonalLayouter
Public Methods
 MethodDefined By
  
DirectedOrthogonalLayouter(init:Boolean = true)
Creates a new instance of this class.
DirectedOrthogonalLayouter
 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]
DirectedOrthogonalLayouter
  
doLayout(graph:LayoutGraph):void
[override]
DirectedOrthogonalLayouter
 Inherited
Calculates a layout for the given graph interface and layout.
CanonicMultiStageLayouter
  
[override]
DirectedOrthogonalLayouter
 Inherited
Disables all layout stages and performs only the core layouter.
CanonicMultiStageLayouter
 Inherited
equals(o:Object):Boolean
YObject
  
getClass():Class
[override]
DirectedOrthogonalLayouter
 Inherited
hashCode():int
YObject
  
[static] Creates a new instance of this class.
DirectedOrthogonalLayouter
 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.
DirectedOrthogonalLayouter
 Inherited
CanonicMultiStageLayouter
  
Initializes this object.
DirectedOrthogonalLayouter
Public Constants
 ConstantDefined By
  DIRECTED_EDGE_DPKEY : Object = y.layout.orthogonal.DirectedOrthogonalLayouter.DIRECTED_EDGE_DPKEY
[static] DataProvider key that is used to mark edges that should be routed in a way that point in the main layout direction.
DirectedOrthogonalLayouter
  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.
DirectedOrthogonalLayouter
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 label layouter (com.yworks.yfiles.layout.CanonicMultiStageLayouter.labelLayouter) 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.


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

Getter: Returns the currently set grid spacing.

Setter: Sets the grid spacing to be used. By default a value of 20 is set.


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


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

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
usePostprocessingproperty 
usePostprocessing:Boolean

Specifies if an additional postprocessing step is used that improves compactness and reduces the number of edge bends. The postprocessing is enabled by default.


Implementation
    public function get usePostprocessing():Boolean
    public function set usePostprocessing(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
Constructor Detail
DirectedOrthogonalLayouter()Constructor
public function DirectedOrthogonalLayouter(init:Boolean = true)

Creates a new instance of this class.

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

Parameters

graph:LayoutGraph

Returns
Booleantrue for all graphs.
createEdgeLayoutDescriptor()method 
protected function createEdgeLayoutDescriptor():EdgeLayoutDescriptor

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

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

Parameters

graph:LayoutGraph

doLayoutCore()method 
override public function doLayoutCore(graph:LayoutGraph):void

Parameters

graph:LayoutGraph

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

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

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

See also

newDirectedOrthogonalLayouter()method 
public static function newDirectedOrthogonalLayouter():DirectedOrthogonalLayouter

Creates a new instance of this class.

Returns
DirectedOrthogonalLayouter
Constant Detail
DIRECTED_EDGE_DPKEYConstant
public static const DIRECTED_EDGE_DPKEY:Object = y.layout.orthogonal.DirectedOrthogonalLayouter.DIRECTED_EDGE_DPKEY

DataProvider key that is used to mark edges that should be routed in a way that point in the main layout direction. The main layout direction can be set by using method layoutOrientation .

See also

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.

See also