public interface ILayerConstraintFactory
IDataProvider with the graph with key
LayoutKeys.NODE_ID_DPKEY, you must use the corresponding node IDs stored in this IDataProvider
as arguments for all methods that create a constraint. Otherwise, you can just use the node instances themselves.| Modifier and Type | Method and Description |
|---|---|
ILayerConstraint |
addPlaceNodeAboveConstraint(Object referenceId,
Object aboveId)
|
default ILayerConstraint |
addPlaceNodeAboveConstraint(Object referenceId,
Object aboveId,
int minDistance)
|
ILayerConstraint |
addPlaceNodeAboveConstraint(Object referenceId,
Object aboveId,
int minDistance,
int weight)
|
ILayerConstraint |
addPlaceNodeAtBottomConstraint(Object nodeId)
Adds a constraint that places a
Node on the bottom layer. |
ILayerConstraint |
addPlaceNodeAtTopConstraint(Object nodeId)
Adds a constraint that places a
Node on the topmost layer. |
ILayerConstraint |
addPlaceNodeBelowConstraint(Object referenceId,
Object belowId)
|
default ILayerConstraint |
addPlaceNodeBelowConstraint(Object referenceId,
Object belowId,
int minDistance)
|
ILayerConstraint |
addPlaceNodeBelowConstraint(Object referenceId,
Object belowId,
int minDistance,
int weight)
|
ILayerConstraint |
addPlaceNodeInSameLayerConstraint(Object referenceId,
Object sameLayerId)
|
void |
dispose()
Disposes this factory.
|
Object |
getMemento()
Gets a token that allows to bind a constraint factory to a graph instance after creation.
|
void |
removeConstraints(Object nodeId)
Clears all constraints for a given
Node. |
ILayerConstraint addPlaceNodeAboveConstraint(Object referenceId, Object aboveId)
referenceId - the ID of the reference nodeaboveId - the ID of the node that should lie aboveILayerConstraint object that represents the constraintILayerConstraintdefault ILayerConstraint addPlaceNodeAboveConstraint(Object referenceId, Object aboveId, int minDistance)
Node with ID aboveId to lie at least minDistance
layers above the Node with ID referenceId with a given weight penalty for
larger layer differences.
The minimum distance includes potentially empty layers that are removed by the ILayerer
instance. In that case, the actual layer difference may be smaller than the minimum distance.
referenceId - the ID of the reference nodeaboveId - the ID of the node that should lie aboveminDistance - the minimum layer distance between the node and its reference nodeILayerConstraint object that represents the constraintILayerConstraintILayerConstraint addPlaceNodeAboveConstraint(Object referenceId, Object aboveId, int minDistance, int weight)
Node with ID aboveId to lie at least minDistance
layers above the Node with ID referenceId with a given weight penalty for
larger layer differences.
The minimum distance includes potentially empty layers that are removed by the ILayerer
instance. In that case, the actual layer difference may be smaller than the minimum distance.
referenceId - the ID of the reference nodeaboveId - the ID of the node that should lie aboveminDistance - the minimum layer distance between the node and its reference nodeweight - the weight penalty for larger layer differencesILayerConstraint object that represents the constraintILayerConstraintILayerConstraint addPlaceNodeAtBottomConstraint(Object nodeId)
Node on the bottom layer.nodeId - the ID of the node that should lie on the bottom layerILayerConstraint object that represents the constraintILayerConstraintILayerConstraint addPlaceNodeAtTopConstraint(Object nodeId)
Node on the topmost layer.nodeId - the ID of the node that should lie on the top layerILayerConstraint object that represents the constraintILayerConstraintILayerConstraint addPlaceNodeBelowConstraint(Object referenceId, Object belowId)
referenceId - the ID of the reference nodebelowId - the ID of the node that should lie belowILayerConstraint object that represents the constraintILayerConstraintdefault ILayerConstraint addPlaceNodeBelowConstraint(Object referenceId, Object belowId, int minDistance)
Node with ID belowId to lie at least minDistance
layers below the Node with ID referenceId with a given weight penalty for
larger layer differences.
The minimum distance includes potentially empty layers that are removed by the ILayerer
instance. In that case, the actual layer difference may be smaller than the minimum distance.
referenceId - the ID of the reference nodebelowId - the ID of the node that should lie belowminDistance - the minimum layer distance between the node and its reference nodeILayerConstraint object that represents the constraintILayerConstraintILayerConstraint addPlaceNodeBelowConstraint(Object referenceId, Object belowId, int minDistance, int weight)
Node with ID belowId to lie at least minDistance
layers below the Node with ID referenceId with a given weight penalty for
larger layer differences.
The minimum distance includes potentially empty layers that are removed by the ILayerer
instance. In that case, the actual layer difference may be smaller than the minimum distance.
referenceId - the ID of the reference nodebelowId - the ID of the node that should lie belowminDistance - the minimum layer distance between the node and its reference nodeweight - the weight penalty for larger layer differencesILayerConstraint object that represents the constraintILayerConstraintILayerConstraint addPlaceNodeInSameLayerConstraint(Object referenceId, Object sameLayerId)
Node with ID sameLayerId to lie in the
same layer as the Node with ID referenceId.referenceId - the ID of the reference nodesameLayerId - the ID of the node that should lie in the same layerILayerConstraint object that represents the constraintILayerConstraintvoid dispose()
This method should be called when this factory is not needed anymore, i.e. after the layout has been calculated. Calling this method also clears all constraints.
Object getMemento()
This method should only be used if the constraint factory is not bound to a graph instance initially. It allows to bind this factory to a graph instance after creation. See the factory methods that create instances of this interface for a description.
HierarchicLayout.createLayerConstraintFactory(com.yworks.yfiles.algorithms.Graph)void removeConstraints(Object nodeId)
Node.nodeId - the ID of the node for which all constraints should be clearedILayerConstraint