|
Search this API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public static interface ConstraintLayerer.ConstraintFactory
Interface specification for classes that can create suitable constraints for a ConstraintLayerer
instance.
If you manually register a DataProvider
with the graph using Layouter.NODE_ID_DPKEY
key,
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.
Field Summary | |
---|---|
static java.lang.Object |
LAYER_CONSTRAINTS_MEMENTO_DPKEY
A DataProvider key for storing the constraint graph.
|
Method Summary | |
---|---|
void |
addPlaceNodeAboveConstraint(java.lang.Object referenceId,
java.lang.Object aboveId)
Adds a constraint that forces the node aboveId to lie above the node referenceId . |
void |
addPlaceNodeAboveConstraint(java.lang.Object referenceId,
java.lang.Object aboveId,
int minDistance)
Adds a constraint that forces the node with ID aboveId to lie at least minDistance layers above
the node with ID referenceId . |
void |
addPlaceNodeAboveConstraint(java.lang.Object referenceId,
java.lang.Object aboveId,
int minDistance,
int weight)
Adds a constraint that forces the 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. |
void |
addPlaceNodeAtBottomConstraint(java.lang.Object nodeId)
Adds a constraint that places a node in the bottom layer |
void |
addPlaceNodeAtTopConstraint(java.lang.Object nodeId)
Adds a constraint that places a node in the topmost layer |
void |
addPlaceNodeBelowConstraint(java.lang.Object referenceId,
java.lang.Object belowId)
Adds a constraint that forces a Node with ID belowId to lie below the Node
with ID referenceId . |
void |
addPlaceNodeBelowConstraint(java.lang.Object referenceId,
java.lang.Object belowId,
int minDistance)
Adds a constraint that forces the Node with ID belowId to lie at least
minDistance layers below the Node with ID referenceId . |
void |
addPlaceNodeBelowConstraint(java.lang.Object referenceId,
java.lang.Object belowId,
int minDistance,
int weight)
Adds a constraint that forces the 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. |
void |
addPlaceNodeInSameLayerConstraint(java.lang.Object referenceId,
java.lang.Object sameLayerId)
Adds a constraint that forces the node with ID sameLayerId to lie in the same-layer as the node with ID
referenceId . |
void |
dispose()
Disposes the ConstraintLayerer.ConstraintFactory . |
java.lang.Object |
getMemento()
Returns a token that allows to bind a constraint factory to a graph instance after creation. |
void |
removeConstraints(java.lang.Object nodeId)
Clears all constraints for a given node. |
Field Detail |
---|
static final java.lang.Object LAYER_CONSTRAINTS_MEMENTO_DPKEY
DataProvider
key for storing the constraint graph.
Method Detail |
---|
java.lang.Object getMemento()
This method should only be used if the constraint factory is not bound to a graph instance initially. It allows
to bind the ConstraintLayerer.ConstraintFactory
to a graph instance after creation. See the factory methods that create
instances of this interface for a description.
ConstraintLayerer.createConstraintFactory(Graph)
void dispose()
ConstraintLayerer.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.
The factory cannot be used after the disposal.
void addPlaceNodeBelowConstraint(java.lang.Object referenceId, java.lang.Object belowId)
Node
with ID belowId
to lie below the Node
with ID referenceId
.
void addPlaceNodeBelowConstraint(java.lang.Object referenceId, java.lang.Object belowId, int minDistance)
Node
with ID belowId
to lie at least
minDistance
layers below the Node
with ID referenceId
.
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 nodeLayout without layer constraint | Layout considering below layer constraint with minimum distance 2 |
void addPlaceNodeBelowConstraint(java.lang.Object referenceId, java.lang.Object belowId, int minDistance, int weight)
belowId
to lie at least minDistance
layers below
the node with ID referenceId
with a given weight penalty for larger layer differences.
minDistance
.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 differencesLayout without layer constraint | Layout considering below layer constraint with minimum distance 2 and weight 1000 |
void addPlaceNodeAboveConstraint(java.lang.Object referenceId, java.lang.Object aboveId)
aboveId
to lie above the node referenceId
.
void addPlaceNodeAboveConstraint(java.lang.Object referenceId, java.lang.Object aboveId, int minDistance)
aboveId
to lie at least minDistance
layers above
the node with ID referenceId
.
minDistance
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 nodeLayout without layer constraint | Layout considering above layer constraint with minimum distance 2 |
void addPlaceNodeAboveConstraint(java.lang.Object referenceId, java.lang.Object aboveId, int minDistance, int weight)
aboveId
to lie at least minDistance
layers above
the node with ID referenceId
with a given weight penalty for larger layer differences.
minDistance
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 differencesLayout without layer constraint | Layout considering above layer constraint with minimum distance 2 and weight 1000 |
void addPlaceNodeInSameLayerConstraint(java.lang.Object referenceId, java.lang.Object sameLayerId)
sameLayerId
to lie in the same-layer as the node with ID
referenceId
.
void addPlaceNodeAtTopConstraint(java.lang.Object nodeId)
void addPlaceNodeAtBottomConstraint(java.lang.Object nodeId)
void removeConstraints(java.lang.Object nodeId)
nodeId
- the ID of the node for which all constraints should be cleared
|
© Copyright 2000-2022, yWorks GmbH. All rights reserved. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |