Packagecom.yworks.yfiles.layout
Classpublic class SelfLoopLayouter
InheritanceSelfLoopLayouter Inheritance AbstractLayoutStage Inheritance YObject Inheritance Object

A layout algorithm that routes the self-loops (reflexive edges) of a graph. By default, this layouter routes self-loops in an orthogonal fashion. It places the self-loop in the least crowded quadrant around a node.

A core layout algorithm can be specified for this class. In that case, the performed layout process of this class is subdivided into four stages:

  1. Remove all self-loops of the input graph
  2. Invoke the core layouter on the now self-loops free graph
  3. Reinsert all formerly removed self-loops of the graph
  4. Layout the self-loops of the input graph



Public Properties
 PropertyDefined By
 InheritedcoreLayouter : Layouter
Specifies the core layouter.
AbstractLayoutStage
  cornerApproximationPointsCount : int
Specifies the number of points that are used to round the corner of the selfloops.
SelfLoopLayouter
  keepAllSelfloopLayouts : Boolean
Getter: Returns whether this algorithm should keep the existing layout of all self-loops.
SelfLoopLayouter
  layoutStyle : int
Specifies the layout style to be used.
SelfLoopLayouter
  lineDistance : Number
Getter: Returns the distance between two adjacent paths that run in parallel.
SelfLoopLayouter
  smartSelfloopPlacement : Boolean
Whether or not smart selfloop placement should be enabled.
SelfLoopLayouter
Public Methods
 MethodDefined By
  
SelfLoopLayouter(init:Boolean = true)
Instantiates a new SelfLoopLayouter.
SelfLoopLayouter
  
canLayout(graph:LayoutGraph):Boolean
[override] Whether or not this layouter can layout the given graph.
SelfLoopLayouter
  
doLayout(graph:LayoutGraph):void
[override] Lays out the given graph.
SelfLoopLayouter
 Inherited
equals(o:Object):Boolean
YObject
  
getClass():Class
[override]
SelfLoopLayouter
 Inherited
hashCode():int
YObject
  
[static] Instantiates a new SelfLoopLayouter.
SelfLoopLayouter
  
[static] Instantiates a new SelfLoopLayouter.
SelfLoopLayouter
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.
SelfLoopLayouter
  
initSelfLoopLayouter2(coreLayouter:Layouter):void
Initializes this object.
SelfLoopLayouter
  
Lays out the self-loops of the given graph.
SelfLoopLayouter
Public Constants
 ConstantDefined By
  KEEP_SELF_LOOP_LAYOUT_DPKEY : Object = y.layout.SelfLoopLayouter.KEEP_SELF_LOOP_LAYOUT_DPKEY
[static] This com.yworks.yfiles.base.DataProvider key can be used to register a com.yworks.yfiles.base.DataProvider with the graph to be laid out.
SelfLoopLayouter
  STYLE_ORTHOGONAL : int = 0
[static] Edge layout style modifier.
SelfLoopLayouter
  STYLE_ROUNDED : int = 1
[static] Edge layout style modifier.
SelfLoopLayouter
Property Detail
cornerApproximationPointsCountproperty
cornerApproximationPointsCount:int

Specifies the number of points that are used to round the corner of the selfloops. If this value is set to one the corners are drawn orthogonal. This value is only considered if style STYLE_ROUNDED is used.


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

See also

keepAllSelfloopLayoutsproperty 
keepAllSelfloopLayouts:Boolean

Getter: Returns whether this algorithm should keep the existing layout of all self-loops. If this property is set, the KEEP_SELF_LOOP_LAYOUT_DPKEY data provider will be ignored. No layout for any self-loop will be calculated, instead the existing self-loop layout will be moved with its node. The default is false.

Setter: Sets whether this algorithm should keep all self loops. If this property is set, the KEEP_SELF_LOOP_LAYOUT_DPKEY DataProvider will be ignored. No layout for any self-loop will be calculated, instead the existing self-loop layout will be moved with its node.


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

See also

layoutStyleproperty 
layoutStyle:int

Specifies the layout style to be used. Possible values are STYLE_ORTHOGONAL (default) and STYLE_ROUNDED.


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

See also

lineDistanceproperty 
lineDistance:Number

Getter: Returns the distance between two adjacent paths that run in parallel.

Setter: Sets the distance between two selfloops incident to the same node. This value is only considered for layout style STYLE_ROUNDED.


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

See also

smartSelfloopPlacementproperty 
smartSelfloopPlacement:Boolean

Whether or not smart selfloop placement should be enabled. If this option is enabled, selfloops are placed on one of the four corners of the corresponding node. For the choice of the corner the algorithm considers all incident edges. Otherwise the selfloops are always placed at the upper left corner of the corresponding node.


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

Instantiates a new SelfLoopLayouter.

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

Whether or not this layouter can layout the given graph. Returns true if the core layouter can handle the given graph after all of its self-loops (reflexive) edges have been hidden.

Parameters

graph:LayoutGraph

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

Lays out the given graph.

Parameters

graph:LayoutGraph

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

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

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

See also

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

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

Parameters

coreLayouter:Layouter

See also

layoutSelfLoops()method 
protected function layoutSelfLoops(graph:LayoutGraph):void

Lays out the self-loops of the given graph. This method will be called after the core layouter has laid out the graph and all self-loops have been reinserted in the graph again.

Parameters

graph:LayoutGraph

newSelfLoopLayouter1()method 
public static function newSelfLoopLayouter1():SelfLoopLayouter

Instantiates a new SelfLoopLayouter.

Returns
SelfLoopLayouter
newSelfLoopLayouter2()method 
public static function newSelfLoopLayouter2(coreLayouter:Layouter):SelfLoopLayouter

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

Parameters

coreLayouter:Layouter

Returns
SelfLoopLayouter
Constant Detail
KEEP_SELF_LOOP_LAYOUT_DPKEYConstant
public static const KEEP_SELF_LOOP_LAYOUT_DPKEY:Object = y.layout.SelfLoopLayouter.KEEP_SELF_LOOP_LAYOUT_DPKEY

This com.yworks.yfiles.base.DataProvider key can be used to register a com.yworks.yfiles.base.DataProvider with the graph to be laid out. This algorithm will query for each self-loop the boolean value from the data provider to determine whether the current layout of the self-loop should be kept. I.e., if the DataProvider instance obtained from the graph using this key returns true for a self-loop, that self-loop will not be laid out by this stage but the bends will be moved by that stage according to the movement of their node.

See also

STYLE_ORTHOGONALConstant 
public static const STYLE_ORTHOGONAL:int = 0

Edge layout style modifier. Using this style, selfloops are routed in an orthogonal fashion, i.e., the route consists of an alternating sequence of horizontal and vertical line segments. This style can be set with method layoutStyle.

See also

STYLE_ROUNDEDConstant 
public static const STYLE_ROUNDED:int = 1

Edge layout style modifier. Using this style, the routes of selfloops are rounded. This style can be set with method layoutStyle.

See also