Packagecom.yworks.yfiles.layout
Classpublic class BendConverter
InheritanceBendConverter Inheritance YObject Inheritance Object
Implements LayoutStage

This layout stage replaces bends with dummy nodes, calls the core layout algorithm and recreates the bends. Note that not all data provider values bound to the edges will be automatically adopted be the replacement edges. The adopted values must be provided by data providers registered with one of the following known keys: com.yworks.yfiles.layout.PortConstraintKeys.SOURCE_GROUPID_KEY, com.yworks.yfiles.layout.PortConstraintKeys.TARGET_GROUPID_KEY, com.yworks.yfiles.layout.PortConstraintKeys.SOURCE_PORT_CONSTRAINT_KEY, com.yworks.yfiles.layout.PortConstraintKeys.TARGET_PORT_CONSTRAINT_KEY.

See also

com.yworks.yfiles.layout.PortConstraintKeys.SOURCE_GROUPID_KEY
com.yworks.yfiles.layout.PortConstraintKeys.TARGET_GROUPID_KEY
com.yworks.yfiles.layout.PortConstraintKeys.SOURCE_PORT_CONSTRAINT_KEY
com.yworks.yfiles.layout.PortConstraintKeys.TARGET_PORT_CONSTRAINT_KEY


Public Properties
 PropertyDefined By
  adoptEdgeGroups : Boolean
Specifies whether or not the edge group values of the original edge should be adopted by its replacement edges.
BendConverter
  adoptPortConstraints : Boolean
Specifies whether or not the port constraint values of the original edge should be adopted by its replacement edges.
BendConverter
  adoptSelection : Boolean
Specifies whether or not the selection state of the original edge should be adopted by its replacement edges.
BendConverter
  coreLayouter : Layouter
Specifies the core layouter.
BendConverter
  selectedEdgesDpKey : Object
Specifies the DataProvider key to identify edges as selected.
BendConverter
Public Methods
 MethodDefined By
  
BendConverter(init:Boolean = true)
Creates a new instance of BendConverter
BendConverter
  
canLayout(graph:LayoutGraph):Boolean
BendConverter
  
doLayout(graph:LayoutGraph):void
BendConverter
 Inherited
equals(o:Object):Boolean
YObject
  
getClass():Class
[override]
BendConverter
 Inherited
hashCode():int
YObject
  
[static] Creates a new instance of BendConverter
BendConverter
  
[static] Creates a new instance of BendConverter using the given size as the width and height for the dummy nodes.
BendConverter
Protected Methods
 MethodDefined By
  
addedPathForEdge(graph:LayoutGraph, e:Edge, dummyNodes:NodeList):void
Callback method that will be invoked after new elements for the given edge have been added to the given graph.
BendConverter
  
Initializes this object.
BendConverter
  
initBendConverter2(size:Number):void
Initializes this object.
BendConverter
  
prepare(graph:LayoutGraph):void
Prepares the graph before calling the core layouter
BendConverter
  
Undoes the graph changes performed by prepare() after the core layouter has finished.
BendConverter
Public Constants
 ConstantDefined By
  SCOPE_DPKEY : Object = y.layout.BendConverter#SCOPE_DPKEY
[static] DataProvider key used to specify the set of edges for which this stage will replace bends by nodes.
BendConverter
Property Detail
adoptEdgeGroupsproperty
adoptEdgeGroups:Boolean

Specifies whether or not the edge group values of the original edge should be adopted by its replacement edges. The group node values are looked up in DataProviders registered with the keys com.yworks.yfiles.layout.PortConstraintKeys.SOURCE_GROUPID_KEY and com.yworks.yfiles.layout.PortConstraintKeys.TARGET_GROUPID_KEY.


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

See also

adoptPortConstraintsproperty 
adoptPortConstraints:Boolean

Specifies whether or not the port constraint values of the original edge should be adopted by its replacement edges. The group node values are looked up in DataProviders registered with the keys com.yworks.yfiles.layout.PortConstraintKeys.SOURCE_PORT_CONSTRAINT_KEY and com.yworks.yfiles.layout.PortConstraintKeys.TARGET_PORT_CONSTRAINT_KEY.


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

See also

adoptSelectionproperty 
adoptSelection:Boolean

Specifies whether or not the selection state of the original edge should be adopted by its replacement edges. The selection state is looked up in DataProviders registered with the key returned by selectedEdgesDpKey.


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

See also

coreLayouterproperty 
coreLayouter:Layouter

Specifies the core layouter.


Implementation
    public function get coreLayouter():Layouter
    public function set coreLayouter(value:Layouter):void
selectedEdgesDpKeyproperty 
selectedEdgesDpKey:Object

Specifies the DataProvider key to identify edges as selected.

By default, com.yworks.yfiles.layout.LayouterKeys.SELECTED_EDGES is used.


Implementation
    public function get selectedEdgesDpKey():Object
    public function set selectedEdgesDpKey(value:Object):void

Throws
IllegalArgumentException — if the specified key is null.

See also

Constructor Detail
BendConverter()Constructor
public function BendConverter(init:Boolean = true)

Creates a new instance of BendConverter

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
addedPathForEdge()method
protected function addedPathForEdge(graph:LayoutGraph, e:Edge, dummyNodes:NodeList):void

Callback method that will be invoked after new elements for the given edge have been added to the given graph. At this point the original edge is still in the graph./

Parameters

graph:LayoutGraph
 
e:Edge
 
dummyNodes:NodeList

canLayout()method 
public function canLayout(graph:LayoutGraph):Boolean

Parameters

graph:LayoutGraph

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

Parameters

graph:LayoutGraph

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

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

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

See also

initBendConverter2()method 
protected final function initBendConverter2(size:Number):void

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

Parameters

size:Number

See also

newBendConverter1()method 
public static function newBendConverter1():BendConverter

Creates a new instance of BendConverter

Returns
BendConverter
newBendConverter2()method 
public static function newBendConverter2(size:Number):BendConverter

Creates a new instance of BendConverter using the given size as the width and height for the dummy nodes.

Parameters

size:Number

Returns
BendConverter
prepare()method 
protected function prepare(graph:LayoutGraph):void

Prepares the graph before calling the core layouter

Parameters

graph:LayoutGraph

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

Undoes the graph changes performed by prepare() after the core layouter has finished.

Parameters

graph:LayoutGraph

See also

Constant Detail
SCOPE_DPKEYConstant
public static const SCOPE_DPKEY:Object = y.layout.BendConverter#SCOPE_DPKEY

DataProvider key used to specify the set of edges for which this stage will replace bends by nodes. If this data provider key is being used, then it must return for each edge in the input graph a boolean value indicating whether or not it should be handled by this layouter. If there is no data provider registered with this key, all edges will be handled.