Packagecom.yworks.yfiles.layout
Classpublic class RemoveColinearBendsStage
InheritanceRemoveColinearBendsStage Inheritance AbstractLayoutStage Inheritance YObject Inheritance Object

This LayoutStage removes all collinear bends found in the graph. The algorithms traverses each edge path from source to target and removes for each triple of consecutive collinear bends the middle one.



Public Properties
 PropertyDefined By
 InheritedcoreLayouter : Layouter
Specifies the core layouter.
AbstractLayoutStage
  removeStraightOnly : Boolean
Getter: Returns the current state of the remove straight only property.
RemoveColinearBendsStage
  scale : Number
Specifies the current scale, to which this stage will refer, when checking for collinearity.
RemoveColinearBendsStage
Public Methods
 MethodDefined By
  
RemoveColinearBendsStage(init:Boolean = true)
RemoveColinearBendsStage
  
canLayout(graph:LayoutGraph):Boolean
[override]
RemoveColinearBendsStage
  
doLayout(graph:LayoutGraph):void
[override] Removes collinear bends of the edges.
RemoveColinearBendsStage
 Inherited
equals(o:Object):Boolean
YObject
  
getClass():Class
[override]
RemoveColinearBendsStage
 Inherited
hashCode():int
YObject
  
[static]
RemoveColinearBendsStage
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
  
RemoveColinearBendsStage
Property Detail
removeStraightOnlyproperty
removeStraightOnly:Boolean

Getter: Returns the current state of the remove straight only property.

Setter: Specifies whether the algorithm removes only collinear bends which lie in the middle of their neighbors or all collinear bends. In the first case, the angle at the middle bend must be 180 degrees, while in the second case, the angle can be either 180 degrees or 0 degree. The default is false.


Implementation
    public function get removeStraightOnly():Boolean
    public function set removeStraightOnly(value:Boolean):void
scaleproperty 
scale:Number

Specifies the current scale, to which this stage will refer, when checking for collinearity. Default value is 2.0. Which means that values are rounded to the second position after the decimal point. If the rounded values of an edge are leading to a collinear bend, this bend will be removed.


Implementation
    public function get scale():Number
    public function set scale(value:Number):void
Constructor Detail
RemoveColinearBendsStage()Constructor
public function RemoveColinearBendsStage(init:Boolean = true)



Parameters
init:Boolean (default = true)
Method Detail
canLayout()method
override public function canLayout(graph:LayoutGraph):Boolean

Parameters

graph:LayoutGraph

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

Removes collinear bends of the edges.

Parameters

graph:LayoutGraph — the graph

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

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

newRemoveColinearBendsStage()method 
public static function newRemoveColinearBendsStage():RemoveColinearBendsStage

Returns
RemoveColinearBendsStage