Packagecom.yworks.yfiles.layout.orthogonal
Classpublic class CompactOrthogonalLayouter
InheritanceCompactOrthogonalLayouter Inheritance PartitionLayouter Inheritance AbstractLayoutStage Inheritance YObject Inheritance Object

This class is a variant of com.yworks.yfiles.layout.orthogonal.OrthogonalLayouter that tries to arrange nodes in a more compact way, even allowing to specify a desired aspect ratio for the bounds of the calculated layout. This is especially important if you want to print the layout on a paper with predefined size. As a disadvantage, this algorithm will usually produce less elegant edge routes than com.yworks.yfiles.layout.orthogonal.OrthogonalLayouter does.

The algorithm is realized as a com.yworks.yfiles.layout.PartitionLayouter, that uses com.yworks.yfiles.layout.PartitionLayouter_EdgeBetweennessPartitionFinder to partition the graph, com.yworks.yfiles.layout.orthogonal.OrthogonalLayouter to layout the graph partitions, com.yworks.yfiles.layout.PartitionLayouter_ComponentPartitionPlacer to place the partitions, and finally com.yworks.yfiles.layout.PartitionLayouter_ChannelInterEdgeRouter to route the edges between partitions. Each of these strategies can be individually configured and/or replaced.

Here is a sample output of the layouter with aspect ratio of the resulting layout bounds set to 1.

See also

com.yworks.yfiles.layout.orthogonal.OrthogonalLayouter
com.yworks.yfiles.layout.PartitionLayouter
com.yworks.yfiles.layout.PartitionLayouter_EdgeBetweennessPartitionFinder
com.yworks.yfiles.layout.PartitionLayouter_ComponentPartitionPlacer
com.yworks.yfiles.layout.PartitionLayouter_ChannelInterEdgeRouter


Public Properties
 PropertyDefined By
  aspectRatio : Number
Getter: Returns the desired aspect ratio of the resulting layout bounds.
CompactOrthogonalLayouter
 InheritedcoreLayouter : Layouter
Specifies the core layouter.
AbstractLayoutStage
  gridSpacing : int
Getter: Returns the grid spacing used to place the nodes.
CompactOrthogonalLayouter
 InheritedinterEdgeRouter : PartitionLayouter_InterEdgeRouter
Getter: Returns the currently set InterEdgeRouter instance.
PartitionLayouter
 InheritedpartitionFinder : PartitionLayouter_PartitionFinder
Getter: Returns the currently set PartitionFinder instance.
PartitionLayouter
 InheritedpartitionPlacer : PartitionLayouter_PartitionPlacer
Getter: Returns the currently set PartitionPlacer instance.
PartitionLayouter
Public Methods
 MethodDefined By
  
CompactOrthogonalLayouter(init:Boolean = true)
Create a new instance of this class with a default aspect ratio of 1 and a default grid spacing of 20.
CompactOrthogonalLayouter
 Inherited
canLayout(graph:LayoutGraph):Boolean
[override] Returns canLayoutCore().
PartitionLayouter
 Inherited
doLayout(graph:LayoutGraph):void
[override] Main layout routine that assigns new layout information to the given graph.
PartitionLayouter
 Inherited
equals(o:Object):Boolean
YObject
  
getClass():Class
[override]
CompactOrthogonalLayouter
 Inherited
hashCode():int
YObject
  
[static] Create a new instance of this class with a default aspect ratio of 1 and a default grid spacing of 20.
CompactOrthogonalLayouter
 Inherited
[static]
PartitionLayouter
Protected Methods
 MethodDefined By
 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.
CompactOrthogonalLayouter
 Inherited
PartitionLayouter
Property Detail
aspectRatioproperty
aspectRatio:Number

Getter: Returns the desired aspect ratio of the resulting layout bounds.

Setter: Sets the desired aspect ratio (i.e. the quotient width/height) of the resulting layout bounds. By default a value of 1 is set. This setting will only have an effect if the set com.yworks.yfiles.layout.PartitionLayouter_PartitionPlacer is of the pre-configured type com.yworks.yfiles.layout.PartitionLayouter_ComponentPartitionPlacer. Note: When setting configurable stages after specifying aspect ratio, it is assumed that the aforementioned stages are already properly configured and the previously set aspect ratio will not be passed to these stages.


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

See also

gridSpacingproperty 
gridSpacing:int

Getter: Returns the grid spacing used to place the nodes.

Setter: Sets the grid spacing to be used. By default, a value of 20 is set. Setting the grid spacing will only have an effect if the configurable stages have not been replaced by other implementations. Note: When setting configurable stages after specifying grid spacing, it is assumed that the aforementioned stages are already properly configured and the previously set grid spacing will not be passed to these stages.


Implementation
    public function get gridSpacing():int
    public function set gridSpacing(value:int):void
Constructor Detail
CompactOrthogonalLayouter()Constructor
public function CompactOrthogonalLayouter(init:Boolean = true)

Create a new instance of this class with a default aspect ratio of 1 and a default grid spacing of 20.

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
getClass()method
override public function getClass():Class

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

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

See also

newCompactOrthogonalLayouter()method 
public static function newCompactOrthogonalLayouter():CompactOrthogonalLayouter

Create a new instance of this class with a default aspect ratio of 1 and a default grid spacing of 20.

Returns
CompactOrthogonalLayouter