Packagecom.yworks.yfiles.layout.hierarchic.incremental
Classpublic class SelfloopCalculator
InheritanceSelfloopCalculator Inheritance YObject Inheritance Object

This class can be used to calculate bend points for orthogonally routed self loops. It is used during the layout phase of com.yworks.yfiles.layout.hierarchic.incremental.HierarchicLayouterImpl, but can be used as a stand-alone tool.

See also

com.yworks.yfiles.layout.hierarchic.incremental.HierarchicLayouterImpl


Public Methods
 MethodDefined By
  
SelfloopCalculator(minFirstSegmentLength:Number, minEdgeDistance:Number, init:Boolean = true)
Creates a new instance of SelfloopCalculator using the given parameters for minimum first segment length and minimum distance between each pair of edges.
SelfloopCalculator
  
Calculates all self loops at the given node the given graph.
SelfloopCalculator
  
Convenience method that calculates a list of self-loops that belong to a given node.
SelfloopCalculator
 Inherited
equals(o:Object):Boolean
YObject
  
getClass():Class
[override]
SelfloopCalculator
 Inherited
hashCode():int
YObject
  
newSelfloopCalculator(minFirstSegmentLength:Number, minEdgeDistance:Number):SelfloopCalculator
[static] Creates a new instance of SelfloopCalculator using the given parameters for minimum first segment length and minimum distance between each pair of edges.
SelfloopCalculator
Protected Methods
 MethodDefined By
  
getMinimumDistance(graph:LayoutGraph, edge:Edge):Number
Returns the minimum length between two edges.
SelfloopCalculator
  
Returns the minimum length for the first segment of an edge.
SelfloopCalculator
  
Returns the minimum length for the last segment of an edge.
SelfloopCalculator
  
Returns the minimum length between two nodes.
SelfloopCalculator
  
Returns the minimum octilinear segment length for the given edge.
SelfloopCalculator
  
initSelfloopCalculator(minFirstSegmentLength:Number, minEdgeDistance:Number):void
Initializes this object.
SelfloopCalculator
  
isOctilinearEdge(graph:LayoutGraph, edge:Edge):Boolean
Returns whether or not the given edge is octilinear.
SelfloopCalculator
Public Constants
 ConstantDefined By
  IS_OCTILINEAR_DPKEY : Object = y.layout.hierarchic.incremental.SelfloopCalculator.IS_OCTILINEAR_DPKEY
[static] A key used for a com.yworks.yfiles.base.DataProvider bound to the graph that returns for each edge whether or not it is octilinear.
SelfloopCalculator
  MINIMUM_EDGE_DISTANCE_DPKEY : Object = y.layout.hierarchic.incremental.SelfloopCalculator.MINIMUM_EDGE_DISTANCE_DPKEY
[static] A key used for a com.yworks.yfiles.base.DataProvider bound to the graph that yields for each edge a minimum distance to the next edge or node side.
SelfloopCalculator
  MINIMUM_FIRST_SEGMENT_LENGTH_DPKEY : Object = y.layout.hierarchic.incremental.SelfloopCalculator.MINIMUM_FIRST_SEGMENT_LENGTH_DPKEY
[static] A key used for a com.yworks.yfiles.base.DataProvider bound to the graph that yields for each edge a minimum length of its first segment.
SelfloopCalculator
  MINIMUM_LAST_SEGMENT_LENGTH_DPKEY : Object = y.layout.hierarchic.incremental.SelfloopCalculator.MINIMUM_LAST_SEGMENT_LENGTH_DPKEY
[static] A key used for a com.yworks.yfiles.base.DataProvider bound to the graph that yields for each edge a minimum length of its last segment.
SelfloopCalculator
  MINIMUM_NODE_DISTANCE_DPKEY : Object = y.layout.hierarchic.incremental.SelfloopCalculator.MINIMUM_NODE_DISTANCE_DPKEY
[static] A key used for a com.yworks.yfiles.base.DataProvider bound to the graph that yields for each node a minimum distance to the self loop edges.
SelfloopCalculator
  MINIMUM_OCTILINEAR_SEGMENT_LENGTH_DPKEY : Object = y.layout.hierarchic.incremental.SelfloopCalculator.MINIMUM_OCTILINEAR_SEGMENT_LENGTH_DPKEY
[static] A key used for a com.yworks.yfiles.base.DataProvider bound to the graph that yields for each octilinear edge a minimum length of its octilinear segments.
SelfloopCalculator
Constructor Detail
SelfloopCalculator()Constructor
public function SelfloopCalculator(minFirstSegmentLength:Number, minEdgeDistance:Number, init:Boolean = true)

Creates a new instance of SelfloopCalculator using the given parameters for minimum first segment length and minimum distance between each pair of edges.

Parameters
minFirstSegmentLength:Number — the minimum length of the first and last segment of an orthogonally routed self loop
 
minEdgeDistance:Number — the minimum distance between a pair of self loops
 
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
calculateSelfLoops()method
public function calculateSelfLoops(graph:LayoutGraph, node:Node, spc:DataProvider, tpc:DataProvider):void

Calculates all self loops at the given node the given graph. The current port positions will be used to determine the start and end ports. The DataProvider instances can be used to specify the direction of first and last segments.

Parameters

graph:LayoutGraph — the graph that contains the node
 
node:Node — the node whose self loops will be routed
 
spc:DataProvider — a DataProvider that contains com.yworks.yfiles.layout.PortConstraint information for the source ports of the edges
 
tpc:DataProvider — a DataProvider that contains com.yworks.yfiles.layout.PortConstraint information for the target ports of the edges

See also

calculateSelfLoopsForEdges()method 
public function calculateSelfLoopsForEdges(graph:LayoutGraph, node:Node, selfLoops:YList, spc:DataProvider, tpc:DataProvider):void

Convenience method that calculates a list of self-loops that belong to a given node.

Parameters

graph:LayoutGraph — the graph that contains the node
 
node:Node — the node whose self loops will be routed
 
selfLoops:YList — a list of com.yworks.yfiles.base.Edge s that will be routed
 
spc:DataProvider — a DataProvider that contains com.yworks.yfiles.layout.PortConstraint information for the source ports of the edges
 
tpc:DataProvider — a DataProvider that contains com.yworks.yfiles.layout.PortConstraint information for the target ports of the edges

See also

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

Returns
Class
getMinimumDistance()method 
protected function getMinimumDistance(graph:LayoutGraph, edge:Edge):Number

Returns the minimum length between two edges. The value is fetched from the corresponding data provider.

Parameters

graph:LayoutGraph
 
edge:Edge

Returns
Number
getMinimumFirstSegmentLength()method 
protected function getMinimumFirstSegmentLength(graph:LayoutGraph, edge:Edge):Number

Returns the minimum length for the first segment of an edge. The value is fetched from the corresponding data provider.

Parameters

graph:LayoutGraph
 
edge:Edge

Returns
Number
getMinimumLastSegmentLength()method 
protected function getMinimumLastSegmentLength(graph:LayoutGraph, edge:Edge):Number

Returns the minimum length for the last segment of an edge. The value is fetched from the corresponding data provider.

Parameters

graph:LayoutGraph
 
edge:Edge

Returns
Number
getMinimumNodeDistance()method 
protected function getMinimumNodeDistance(graph:LayoutGraph, node:Node):Number

Returns the minimum length between two nodes. The value is fetched from the corresponding data provider.

Parameters

graph:LayoutGraph
 
node:Node

Returns
Number
getMinimumOctilinearSegmentLength()method 
protected function getMinimumOctilinearSegmentLength(graph:LayoutGraph, edge:Edge):Number

Returns the minimum octilinear segment length for the given edge. The value is fetched from the corresponding data provider.

Parameters

graph:LayoutGraph
 
edge:Edge

Returns
Number
initSelfloopCalculator()method 
protected final function initSelfloopCalculator(minFirstSegmentLength:Number, minEdgeDistance:Number):void

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

Parameters

minFirstSegmentLength:Number
 
minEdgeDistance:Number

See also

isOctilinearEdge()method 
protected function isOctilinearEdge(graph:LayoutGraph, edge:Edge):Boolean

Returns whether or not the given edge is octilinear. The value is fetched from the corresponding data provider.

Parameters

graph:LayoutGraph
 
edge:Edge

Returns
Boolean
newSelfloopCalculator()method 
public static function newSelfloopCalculator(minFirstSegmentLength:Number, minEdgeDistance:Number):SelfloopCalculator

Creates a new instance of SelfloopCalculator using the given parameters for minimum first segment length and minimum distance between each pair of edges.

Parameters

minFirstSegmentLength:Number — the minimum length of the first and last segment of an orthogonally routed self loop
 
minEdgeDistance:Number — the minimum distance between a pair of self loops

Returns
SelfloopCalculator
Constant Detail
IS_OCTILINEAR_DPKEYConstant
public static const IS_OCTILINEAR_DPKEY:Object = y.layout.hierarchic.incremental.SelfloopCalculator.IS_OCTILINEAR_DPKEY

A key used for a com.yworks.yfiles.base.DataProvider bound to the graph that returns for each edge whether or not it is octilinear.

See also

MINIMUM_EDGE_DISTANCE_DPKEYConstant 
public static const MINIMUM_EDGE_DISTANCE_DPKEY:Object = y.layout.hierarchic.incremental.SelfloopCalculator.MINIMUM_EDGE_DISTANCE_DPKEY

A key used for a com.yworks.yfiles.base.DataProvider bound to the graph that yields for each edge a minimum distance to the next edge or node side.

See also

MINIMUM_FIRST_SEGMENT_LENGTH_DPKEYConstant 
public static const MINIMUM_FIRST_SEGMENT_LENGTH_DPKEY:Object = y.layout.hierarchic.incremental.SelfloopCalculator.MINIMUM_FIRST_SEGMENT_LENGTH_DPKEY

A key used for a com.yworks.yfiles.base.DataProvider bound to the graph that yields for each edge a minimum length of its first segment.

See also

MINIMUM_LAST_SEGMENT_LENGTH_DPKEYConstant 
public static const MINIMUM_LAST_SEGMENT_LENGTH_DPKEY:Object = y.layout.hierarchic.incremental.SelfloopCalculator.MINIMUM_LAST_SEGMENT_LENGTH_DPKEY

A key used for a com.yworks.yfiles.base.DataProvider bound to the graph that yields for each edge a minimum length of its last segment.

See also

MINIMUM_NODE_DISTANCE_DPKEYConstant 
public static const MINIMUM_NODE_DISTANCE_DPKEY:Object = y.layout.hierarchic.incremental.SelfloopCalculator.MINIMUM_NODE_DISTANCE_DPKEY

A key used for a com.yworks.yfiles.base.DataProvider bound to the graph that yields for each node a minimum distance to the self loop edges.

See also

MINIMUM_OCTILINEAR_SEGMENT_LENGTH_DPKEYConstant 
public static const MINIMUM_OCTILINEAR_SEGMENT_LENGTH_DPKEY:Object = y.layout.hierarchic.incremental.SelfloopCalculator.MINIMUM_OCTILINEAR_SEGMENT_LENGTH_DPKEY

A key used for a com.yworks.yfiles.base.DataProvider bound to the graph that yields for each octilinear edge a minimum length of its octilinear segments.

See also