Search this API

y.layout.hierarchic.incremental
Interface SequenceConstraintFactory


public interface SequenceConstraintFactory

This interface specifies the general contract for factory classes that can be used to associate sequence constraints with a graph.

Sequence constraints affect the sequence of nodes within a layer.

A SequenceConstraintFactory has to be disposed of after use. Disposing of the factory will also remove all constraints previously specified for the factory's associated graph.

 
 
Your browser does not support SVG content.
Sample Graphs:

A graph laid out with IncrementalHierarchicLayouter with default settings. The labels indicate the desired placement of certain nodes relative to a reference node.

After defining appropriate sequence constraints and running the layout again, the labeled nodes now have their intended placement.

Field Summary
static java.lang.Object SEQUENCE_CONSTRAINTS_MEMENTO_DPKEY
          A DataProvider key for storing the constraint graph A v1 before v2 constraint is represented as an edge between the representatives of v1 and v2 in the constraint graph.
 
Method Summary
 void addPlaceAfterConstraint(java.lang.Object referenceId, java.lang.Object afterId)
          Adds a constraint that forces the Node or Edge with id after to lie after the Node or Edge with id reference.
 void addPlaceAtHeadConstraint(java.lang.Object id)
          Adds a constraint that places a Node or Edge at the start of the sequence.
 void addPlaceAtTailConstraint(java.lang.Object id)
          Adds a constraint that places a Node or Edge at the end of the sequence.
 void addPlaceBeforeConstraint(java.lang.Object referenceId, java.lang.Object beforeId)
          Adds a constraint that forces the Node or Edge with id before to lie before the Node or Edge with id reference.
 void addPlaceNodeAfterConstraint(java.lang.Object referenceId, java.lang.Object afterId)
          Deprecated. Use addPlaceAfterConstraint(Object, Object) instead.
 void addPlaceNodeAtHeadConstraint(java.lang.Object nodeId)
          Deprecated. Use addPlaceAtHeadConstraint(Object) instead.
 void addPlaceNodeAtTailConstraint(java.lang.Object nodeId)
          Deprecated. Use addPlaceAtTailConstraint(Object) instead.
 void addPlaceNodeBeforeConstraint(java.lang.Object referenceId, java.lang.Object beforeId)
          Deprecated. Use addPlaceBeforeConstraint(Object, Object) instead.
 void dispose()
          Disposes of the SequenceConstraintFactory.
 java.lang.Object getMemento()
          Returns a token that allows to bind a constraint factory to a graph instance after creation.
 

Field Detail

SEQUENCE_CONSTRAINTS_MEMENTO_DPKEY

static final java.lang.Object SEQUENCE_CONSTRAINTS_MEMENTO_DPKEY
A DataProvider key for storing the constraint graph

A v1 before v2 constraint is represented as an edge between the representatives of v1 and v2 in the constraint graph.

Method Detail

getMemento

java.lang.Object getMemento()
Returns 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 this factory to a graph instance after creation.

Returns:
a token that allows to bind the constraint factory to a graph instance
See Also:
HierarchicLayouter.createSequenceConstraintFactory(y.base.Graph)

dispose

void dispose()
Disposes of the SequenceConstraintFactory.

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.


addPlaceNodeBeforeConstraint

void addPlaceNodeBeforeConstraint(java.lang.Object referenceId,
                                  java.lang.Object beforeId)
Deprecated. Use addPlaceBeforeConstraint(Object, Object) instead.

Adds a constraint that forces the Node with ID beforeId to lie before the Node with ID referenceId.

Parameters:
referenceId - the ID of the reference node
beforeId - the ID of the node that should be placed before the reference node
Sample Graphs:

A graph laid out with IncrementalHierarchicLayouter with default settings. The labeled node should be placed before the reference node.

After defining an appropriate sequence constraint and running the layout again, the labeled node now lies before the reference node.

addPlaceNodeAfterConstraint

void addPlaceNodeAfterConstraint(java.lang.Object referenceId,
                                 java.lang.Object afterId)
Deprecated. Use addPlaceAfterConstraint(Object, Object) instead.

Adds a constraint that forces the Node with ID afterId to lie after the Node with ID referenceId.

Parameters:
referenceId - the ID of the reference node
afterId - the ID of the node that should be placed after the reference node
Sample Graphs:

A graph laid out with IncrementalHierarchicLayouter with default settings. The labeled node should be placed after the reference node.

After defining an appropriate sequence constraint and running the layout again, the labeled node now lies after the reference node.

addPlaceNodeAtHeadConstraint

void addPlaceNodeAtHeadConstraint(java.lang.Object nodeId)
Deprecated. Use addPlaceAtHeadConstraint(Object) instead.

Adds a constraint that places a Node at the start of the sequence.

Parameters:
nodeId - the ID of the node that should be placed at the start
Sample Graphs:

A graph laid out with IncrementalHierarchicLayouter with default settings. The labeled node should be placed at the start of the layer.

After defining appropriate sequence constraints and running the layout again, the labeled node is now placed first in the layer.

addPlaceNodeAtTailConstraint

void addPlaceNodeAtTailConstraint(java.lang.Object nodeId)
Deprecated. Use addPlaceAtTailConstraint(Object) instead.

Adds a constraint that places a Node at the end of the sequence.

Parameters:
nodeId - the ID of the node that should be placed at the end
Sample Graphs:

Layout without sequence constraint

Layout considering tail sequence constraint

addPlaceBeforeConstraint

void addPlaceBeforeConstraint(java.lang.Object referenceId,
                              java.lang.Object beforeId)
Adds a constraint that forces the Node or Edge with id before to lie before the Node or Edge with id reference.

 
A constraint is only considered if both elements share at least one layer. An edge is associated with each layer that it spans, i.e., each layer between it's source and target (excluding the source and target layer).
Parameters:
referenceId - the ID of the reference node or edge
beforeId - the ID of the node or edge that should be placed before the reference element
Sample Graphs:

A graph laid out with IncrementalHierarchicLayouter with default settings. The labeled node should be placed before the reference node.

After defining an appropriate sequence constraint and running the layout again, the labeled node now lies before the reference node.

addPlaceAfterConstraint

void addPlaceAfterConstraint(java.lang.Object referenceId,
                             java.lang.Object afterId)
Adds a constraint that forces the Node or Edge with id after to lie after the Node or Edge with id reference.

 
A constraint is only considered if both elements share at least one layer. An edge is associated with each layer that it spans, i.e., each layer between it's source and target (excluding the source and target layer).
Parameters:
referenceId - the ID of the reference node or edge
afterId - the ID of the node or edge that should be placed after the reference element
Sample Graphs:

A graph laid out with IncrementalHierarchicLayouter with default settings. The labeled node should be placed after the reference node.

After defining an appropriate sequence constraint and running the layout again, the labeled node now lies after the reference node.

addPlaceAtHeadConstraint

void addPlaceAtHeadConstraint(java.lang.Object id)
Adds a constraint that places a Node or Edge at the start of the sequence.

 
For edges, this constraint applies to each layer that the edge spans including the edge's source and target. Edges with recursive edge style are ignored.
Parameters:
id - the ID of the node or edge that should be placed at the start
Sample Graphs:

A graph laid out with IncrementalHierarchicLayouter with default settings. The labeled node should be placed at the start of the layer.

After defining appropriate sequence constraints and running the layout again, the labeled node is now placed first in the layer.

addPlaceAtTailConstraint

void addPlaceAtTailConstraint(java.lang.Object id)
Adds a constraint that places a Node or Edge at the end of the sequence.

 
For edges, this constraint applies to each layer that the edge spans including the edge's source and target. Edges with recursive edge style are ignored.
Parameters:
id - the ID of the node or edge that should be placed at the end
Sample Graphs:

A graph laid out with IncrementalHierarchicLayouter with default settings. The labeled node should be placed at the end of the layer.

After defining appropriate sequence constraints and running the layout again, the labeled node is now placed last in the layer.

© Copyright 2000-2022,
yWorks GmbH.
All rights reserved.