Search this API

y.layout.hierarchic.incremental
Interface SequenceConstraintFactory


public interface SequenceConstraintFactory

Specifies the general contract for factory classes that can be used to associate sequence constraints to a graph. Sequence constraints affect the per layer sequence calculated in hierarchical layouts.

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

Notes:


Field Summary
static Object SEQUENCE_CONSTRAINTS_MEMENTO_DPKEY
          DataProvider key to store the constraint graph.
 
Method Summary
 void addPlaceNodeAfterConstraint(Object referenceId, Object afterId)
          Add a constraint that forces the node with id after to lie after the node with id reference.
 void addPlaceNodeAtHeadConstraint(Object nodeId)
          Add a constraint that places a node at the start of the sequence.
 void addPlaceNodeAtTailConstraint(Object nodeId)
          Add a constraint that places a node at the end of the sequence.
 void addPlaceNodeBeforeConstraint(Object referenceId, Object beforeId)
          Add a constraint that forces the node with id before to lie before the node with id reference.
 void dispose()
          Disposes the SequenceConstraintFactory.
 Object getMemento()
          Get a token that allows to bind a constraint factory to a graph instance after creation.
 

Field Detail

SEQUENCE_CONSTRAINTS_MEMENTO_DPKEY

static final Object SEQUENCE_CONSTRAINTS_MEMENTO_DPKEY
DataProvider key to store 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

Object getMemento()
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.

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 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(Object referenceId,
                                  Object beforeId)
Add a constraint that forces the node with id before to lie before the node with id reference.

Parameters:
referenceId - the id of the reference node
beforeId - the id of the node that should be placed before the reference

addPlaceNodeAfterConstraint

void addPlaceNodeAfterConstraint(Object referenceId,
                                 Object afterId)
Add a constraint that forces the node with id after to lie after the node with id reference.

Parameters:
referenceId - the id of the reference node
afterId - the id of the node that should be placed after the reference

addPlaceNodeAtHeadConstraint

void addPlaceNodeAtHeadConstraint(Object nodeId)
Add 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

addPlaceNodeAtTailConstraint

void addPlaceNodeAtTailConstraint(Object nodeId)
Add 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

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