Package | com.yworks.yfiles.layout.hierarchic |
Class | public class ConstraintLayerer |
Inheritance | ConstraintLayerer YObject Object |
Implements | OldLayerer, Layerer |
This layerer can use two sets of constraints:
See also
Property | Defined By | ||
---|---|---|---|
allowSameLayerEdges : Boolean
Specifies whether same layer edges can be created by this layerer instance. | ConstraintLayerer | ||
coreLayerer : OldLayerer
Specifies the core layerer for this layerer instance. | ConstraintLayerer |
Method | Defined By | ||
---|---|---|---|
ConstraintLayerer(init:Boolean = true) | ConstraintLayerer | ||
ConstraintLayerer | |||
This method assigns the nodes in the graph to layers. | ConstraintLayerer | ||
[static]
Create an instance of com.yworks.yfiles.layout.hierarchic.ConstraintLayerer_ConstraintFactory that is suitable for this layerer implementation. | ConstraintLayerer | ||
equals(o:Object):Boolean | YObject | ||
getClass():Class [override] | ConstraintLayerer | ||
hashCode():int | YObject | ||
[static] | ConstraintLayerer | ||
[static] | ConstraintLayerer |
Method | Defined By | ||
---|---|---|---|
checkConstraints():void
Checks if the current set of strong constraints is consistent (i.e. | ConstraintLayerer | ||
initConstraintLayerer1():void
Initializes this object. | ConstraintLayerer | ||
initConstraintLayerer2(coreLayerer:OldLayerer):void
Initializes this object. | ConstraintLayerer |
Constant | Defined By | ||
---|---|---|---|
EDGE_WEIGHTS_DPKEY : String = y.layout.hierarchic.ConstraintLayerer.EDGE_WEIGHTS_DPKEY [static]
DataProvider key for additional edge weights of type int. | ConstraintLayerer |
allowSameLayerEdges | property |
allowSameLayerEdges:Boolean
Specifies whether same layer edges can be created by this layerer instance.
This only concerns edges between nodes that have no hard constraints that will force a same layer edge (i.e. a same layer constraint). Default value is false
.
public function get allowSameLayerEdges():Boolean
public function set allowSameLayerEdges(value:Boolean):void
coreLayerer | property |
coreLayerer:OldLayerer
Specifies the core layerer for this layerer instance.
The ConstraintLayerer tries to create a layering for the nodes and edges that have no constraints that resembles the layering that would be created by the coreLayerer. This works the better the less constraints exist. Ideally, the constrained nodes are just embedded into the layering created by the coreLayerer. By default, an instance of com.yworks.yfiles.layout.hierarchic.TopologicalLayerer is used. public function get coreLayerer():OldLayerer
public function set coreLayerer(value:OldLayerer):void
See also
ConstraintLayerer | () | Constructor |
public function ConstraintLayerer(init:Boolean = true)
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.
|
assignLayers | () | method |
public function assignLayers(graph:LayoutGraph, layers:Layers, ldp:LayoutDataProvider):void
Parameters
graph:LayoutGraph | |
layers:Layers | |
ldp:LayoutDataProvider |
assignNodeLayer | () | method |
public function assignNodeLayer(g:LayoutGraph, layer:NodeMap, reversedEdges:EdgeList):int
This method assigns the nodes in the graph to layers.
Parameters
g:LayoutGraph — the graph for which the layers are determined.
| |
layer:NodeMap — here the layers are stored
| |
reversedEdges:EdgeList — here the edges are stored which had been reversed.
|
int — the number of layers
|
IllegalArgumentException — if any strong constraints are inconsistent
|
checkConstraints | () | method |
protected function checkConstraints():void
Checks if the current set of strong constraints is consistent (i.e. has no cycles)
IllegalArgumentException — if the constraint network is inconsistent
|
createConstraintFactory | () | method |
public static function createConstraintFactory(g:Graph):ConstraintLayerer_ConstraintFactory
Create an instance of com.yworks.yfiles.layout.hierarchic.ConstraintLayerer_ConstraintFactory that is suitable for this layerer implementation.
The ConstraintFactory instance is usually bound to the graph instance g
, i.e. if the input graph for the layerer changes, a new ConstraintFactory instance must be retrieved. This instance can be used to create constraints for this graph instance.
You can create a ConstraintFactory without binding it to a graph instance initially by passing a null
parameter. In that case, you must bind the returned instance to the graph instance before calculating a layering:
ConstraintFactory cf = ConstraintLayerer.createConstraintFactory(null);... Graph g = ...; g.addDataProvider(ConstraintFactory.LAYER_CONSTRAINTS_MEMENTO_DPKEY, DataProviders.createConstantDataProvider(cf.getMemento()));); //Calculate layoutIf you manually registered a DataProvider under com.yworks.yfiles.layout.LayouterKeys.NODE_ID_DPKEY on the graph, you must use the corresponding node ids stored in this DataProvider as arguments for all methods that create a constraint. Otherwise, you can just use the node instances themselves.
Parameters
g:Graph — the current graph for the layerer
|
ConstraintLayerer_ConstraintFactory — a ConstraintFactory bound to this graph.
|
See also
getClass | () | method |
override public function getClass():Class
ReturnsClass |
initConstraintLayerer1 | () | method |
protected final function initConstraintLayerer1():void
Initializes this object. See the documentation of the corresponding factory method newConstraintLayerer1()
for details.
See also
initConstraintLayerer2 | () | method |
protected final function initConstraintLayerer2(coreLayerer:OldLayerer):void
Initializes this object. See the documentation of the corresponding factory method newConstraintLayerer2()
for details.
Parameters
coreLayerer:OldLayerer |
See also
newConstraintLayerer1 | () | method |
newConstraintLayerer2 | () | method |
public static function newConstraintLayerer2(coreLayerer:OldLayerer):ConstraintLayerer
Parameters
coreLayerer:OldLayerer |
ConstraintLayerer |
EDGE_WEIGHTS_DPKEY | Constant |
public static const EDGE_WEIGHTS_DPKEY:String = y.layout.hierarchic.ConstraintLayerer.EDGE_WEIGHTS_DPKEY
DataProvider key for additional edge weights of type int
.
The Layerer tries to keep edges with higher weights short.