Remarks
Sequence constraints affect the sequence of nodes and edges within a layer.
Instead of using this class, it is recommended to define sequence constraints more conveniently via the layout data property sequenceConstraints.
This class cannot be instantiated
See Also
Developer's Guide
Members
Properties
Methods
Gets all the currently registered constraints as a tuple consisting of the source item, the constraint and the target item (can be null).
Return Value
- IEnumerable<any[]>
- A collection of tuples representing all registered constraints. The first item is the item for which the constraint is defined, the second item is the constraint itself and the third item is the relational other item. The other item can be null if the constraint is one that does not need such an item.
Returns whether any constraints are defined for the given item.
Returns whether any constraints are defined for the given item.
Parameters
- item: LayoutGraphItem
The item to check for
Return Value
- boolean
trueif constraints are defined for the given item,falseotherwise
Parameters
- item: any
- the node or edge that should be placed at the start
Parameters
- item: any
- the node or edge that should be placed at the end
Parameters
- firstItem: any
- the first item
- secondItem: any
- the second item, which should be placed after the first item
This method does nothing if there is no constraint defined for the given combination of source item, target item, and ordering constraint.
Parameters
- sourceItem: LayoutGraphItem
the source item
- orderingConstraint: OrderingConstraint
the ordering constraint
- targetItem: LayoutGraphItem
the target item or
nullif there is none for this constraint
Return Value
- void
Disposes of all constraints modified via this instance (if it was created using createEmpty or createWritableCopy) and restores the state of the constraints before creation of this instance.
Restore should always be called at some point where constraints were modified.
If this instance is a read-only one created via createReadonlyView, then this method has no effect.
Static Methods
Creates an empty, modifiable constraints instance and registers the constraints with the given graph.
Parameters
- graph: LayoutGraph
- The graph for which the newly created empty constraints instance is registered.
Return Value
- LayoutGraphSequenceConstraints
- An empty, modifiable instance.
Factory that reads the current state from the given graph's context.
Parameters
- graph: LayoutGraph
- The graph to read the data from.
Return Value
- LayoutGraphSequenceConstraints
- A read-only, potentially empty instance that contains the constraints associated with this graph.
Factory that reads the current state from the given graph's context and copies it to a mutable instance.
Newly created constraints on the writable copy are automatically registered for the given graph without destroying the old constraints (if some existed).
If no information was associated with the graph, the returned instance will be empty.
Parameters
- graph: LayoutGraph
- The graph to read and copy the initial data from.
Return Value
- LayoutGraphSequenceConstraints
- A writable, potentially empty instance that contains the constraints associated with this graph.