public class SequentialLayout extends Object implements ILayoutAlgorithm
SequentialLayout allows for chaining multiple layout algorithms.
The layout algorithms are invoked one after the other in the order in which they were
added to the chain. They all run independently of each other, i.e., they
only influence each other by the changed input graph. Hence, the sequence determines the result.
One possible application would be to bundle several layout algorithms and pass a single ILayoutAlgorithm
instance to a BufferedLayout.
| Constructor and Description |
|---|
SequentialLayout()
Creates a new
SequentialLayout instance with an empty chain of layout algorithms. |
| Modifier and Type | Method and Description |
|---|---|
void |
appendLayout(ILayoutAlgorithm layouter)
Appends the given
layout algorithm to the end of the chain. |
void |
appendLayouts(Collection<ILayoutAlgorithm> layouters)
Appends the specified list of
layout algorithms to the end of the chain. |
void |
applyLayout(LayoutGraph graph)
Executes all
layout algorithms in the chain, one after the other. |
List<ILayoutAlgorithm> |
getLayouts()
Gets the chain of
layout algorithms. |
void |
removeAll()
Clears the current chain of
layout algorithms and therefore removes all layout algorithms. |
void |
setLayouts(List<ILayoutAlgorithm> value)
Sets the chain of
layout algorithms. |
public SequentialLayout()
SequentialLayout instance with an empty chain of layout algorithms.public void appendLayout(ILayoutAlgorithm layouter)
layout algorithm to the end of the chain.layouter - the layout algorithm to appendpublic void appendLayouts(Collection<ILayoutAlgorithm> layouters)
layout algorithms to the end of the chain.layouters - the list of layout algorithms to appendpublic void applyLayout(LayoutGraph graph)
layout algorithms in the chain, one after the other.
The order of the layout algorithms is defined by the order in which they were appended.
applyLayout in interface ILayoutAlgorithmgraph - the input graphpublic List<ILayoutAlgorithm> getLayouts()
layout algorithms.appendLayout(ILayoutAlgorithm),
appendLayouts(Collection),
setLayouts(List)public void removeAll()
layout algorithms and therefore removes all layout algorithms.public void setLayouts(List<ILayoutAlgorithm> value)
layout algorithms.value - the list of layout algorithms that are invoked one after the otherappendLayout(ILayoutAlgorithm),
appendLayouts(Collection),
getLayouts()