Packagecom.yworks.yfiles.layout.hierarchic
Interfacepublic interface ConstraintLayerer_ConstraintFactory

Interface specification for classes that can create suitable constraints for a com.yworks.yfiles.layout.hierarchic.ConstraintLayerer instance. If you manually register 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.

See also

com.yworks.yfiles.layout.hierarchic.ConstraintLayerer
com.yworks.yfiles.layout.LayouterKeys.NODE_ID_DPKEY


Public Properties
 PropertyDefined By
  memento : Object
[read-only] Get a token that allows to bind a constraint factory to a graph instance after creation.
ConstraintLayerer_ConstraintFactory
Public Methods
 MethodDefined By
  
addPlaceNodeAboveConstraint(referenceId:Object, aboveId:Object):void
Add a constraint that forces the node above to lie above the node reference.
ConstraintLayerer_ConstraintFactory
  
addPlaceNodeAboveConstraintWithDistance(referenceId:Object, aboveId:Object, minDistance:int):void
Add a constraint that forces the node with id above to lie at least minDistance layers above the node with id reference.
ConstraintLayerer_ConstraintFactory
  
addPlaceNodeAboveConstraintWithDistanceAndPenalty(referenceId:Object, aboveId:Object, minDistance:int, weight:int):void
Add a constraint that forces the node with id above to lie at least minDistance layers above the node with id reference with a given weight penalty for larger layer differences.
ConstraintLayerer_ConstraintFactory
  
addPlaceNodeAtBottomConstraint(nodeId:Object):void
Add a constraint that places a node in the bottom layer
ConstraintLayerer_ConstraintFactory
  
addPlaceNodeAtTopConstraint(nodeId:Object):void
Add a constraint that places a node in the topmost layer
ConstraintLayerer_ConstraintFactory
  
addPlaceNodeBelowConstraint(referenceId:Object, belowId:Object):void
Add a constraint that forces the node with id with id below to lie below the node with id reference.
ConstraintLayerer_ConstraintFactory
  
addPlaceNodeBelowConstraintWithDistance(referenceId:Object, belowId:Object, minDistance:int):void
Add a constraint that forces the node with id below to lie at least minDistance layers below the node with id reference.
ConstraintLayerer_ConstraintFactory
  
addPlaceNodeBelowConstraintWithDistanceAndPenalty(referenceId:Object, belowId:Object, minDistance:int, weight:int):void
Add a constraint that forces the node with id below to lie at least minDistance layers below the node with id reference with a given weight penalty for larger layer differences.
ConstraintLayerer_ConstraintFactory
  
addPlaceNodeInSameLayerConstraint(referenceId:Object, sameLayerId:Object):void
Add a constraint that forces the node with id sameLayer to lie in the same layer as the node with id reference.
ConstraintLayerer_ConstraintFactory
  
dispose():void
Disposes the ConstraintFactory.
ConstraintLayerer_ConstraintFactory
  
removeConstraints(nodeId:Object):void
Clears all constraints for a given node
ConstraintLayerer_ConstraintFactory
Property Detail
mementoproperty
memento:Object  [read-only]

Get a token that allows to bind a constraint factory to a graph instance after creation. This method should only be used if the constraint factory is not bound to a graph instance initially. It allows to bind the ConstraintFactory to a graph instance after creation. Please see the factory methods that create instances of this interface for a description.


Implementation
    public function get memento():Object

See also

Method Detail
addPlaceNodeAboveConstraint()method
public function addPlaceNodeAboveConstraint(referenceId:Object, aboveId:Object):void

Add a constraint that forces the node above to lie above the node reference.

Parameters

referenceId:Object — the id of the reference node
 
aboveId:Object — the id of the node that should lie above

addPlaceNodeAboveConstraintWithDistance()method 
public function addPlaceNodeAboveConstraintWithDistance(referenceId:Object, aboveId:Object, minDistance:int):void

Add a constraint that forces the node with id above to lie at least minDistance layers above the node with id reference. The minimum distance includes potentially empty layers that are removed by the layerer. In that case, the actual layer difference may be smaller than minDistance

Parameters

referenceId:Object — the id of the reference node
 
aboveId:Object — the id of the node that should lie above
 
minDistance:int — the minimal layer distance between the node and its reference node

addPlaceNodeAboveConstraintWithDistanceAndPenalty()method 
public function addPlaceNodeAboveConstraintWithDistanceAndPenalty(referenceId:Object, aboveId:Object, minDistance:int, weight:int):void

Add a constraint that forces the node with id above to lie at least minDistance layers above the node with id reference with a given weight penalty for larger layer differences. The minimum distance includes potentially empty layers that are removed by the layerer. In that case, the actual layer difference may be smaller than minDistance

Parameters

referenceId:Object — the id of the reference node
 
aboveId:Object — the id of the node that should lie above
 
minDistance:int — the minimal layer distance between the node and its reference node
 
weight:int

addPlaceNodeAtBottomConstraint()method 
public function addPlaceNodeAtBottomConstraint(nodeId:Object):void

Add a constraint that places a node in the bottom layer

Parameters

nodeId:Object — the id of the node that should lie at the bottom

addPlaceNodeAtTopConstraint()method 
public function addPlaceNodeAtTopConstraint(nodeId:Object):void

Add a constraint that places a node in the topmost layer

Parameters

nodeId:Object — the id of the node that should lie at the top

addPlaceNodeBelowConstraint()method 
public function addPlaceNodeBelowConstraint(referenceId:Object, belowId:Object):void

Add a constraint that forces the node with id with id below to lie below the node with id reference.

Parameters

referenceId:Object — the id of the reference node
 
belowId:Object — the id of the node that should lie below

addPlaceNodeBelowConstraintWithDistance()method 
public function addPlaceNodeBelowConstraintWithDistance(referenceId:Object, belowId:Object, minDistance:int):void

Add a constraint that forces the node with id below to lie at least minDistance layers below the node with id reference. The minimum distance includes potentially empty layers that are removed by the layerer. In that case, the actual layer difference may be smaller than minDistance

Parameters

referenceId:Object — the id of the reference node
 
belowId:Object — the id of the node that should lie below
 
minDistance:int — the minimal layer distance between the node and its reference node

addPlaceNodeBelowConstraintWithDistanceAndPenalty()method 
public function addPlaceNodeBelowConstraintWithDistanceAndPenalty(referenceId:Object, belowId:Object, minDistance:int, weight:int):void

Add a constraint that forces the node with id below to lie at least minDistance layers below the node with id reference with a given weight penalty for larger layer differences. The minimum distance includes potentially empty layers that are removed by the layerer. In that case, the actual layer difference may be smaller than minDistance

Parameters

referenceId:Object — the id of the reference node
 
belowId:Object — the id of the node that should lie below
 
minDistance:int — the minimal layer distance between the node and its reference node
 
weight:int

addPlaceNodeInSameLayerConstraint()method 
public function addPlaceNodeInSameLayerConstraint(referenceId:Object, sameLayerId:Object):void

Add a constraint that forces the node with id sameLayer to lie in the same layer as the node with id reference.

Parameters

referenceId:Object — the id of the reference node
 
sameLayerId:Object — the id of the node that should lie in the same layer

dispose()method 
public function dispose():void

Disposes the ConstraintFactory.

This method should be called when the factory is not needed anymore, i.e. after the layout has been calculated. Calling this method also clears all constraints.

removeConstraints()method 
public function removeConstraints(nodeId:Object):void

Clears all constraints for a given node

Parameters

nodeId:Object — the id of the node for which all constraints should be cleared