Search this API

y.layout
Class SequentialLayouter

java.lang.Object
  extended by y.layout.SequentialLayouter
All Implemented Interfaces:
Layouter

public class SequentialLayouter
extends Object
implements Layouter

This Layouter will take several Layouter implementations and will run these layout algorithms one after the other in the order in which they were added.

This class can for example be used to bundle several layout steps and handover a single layouter to a BufferedLayouter.


Field Summary
 
Fields inherited from interface y.layout.Layouter
EDGE_ID_DPKEY, NODE_ID_DPKEY, SELECTED_EDGES, SELECTED_NODES
 
Constructor Summary
SequentialLayouter()
           
 
Method Summary
 void appendLayouter(Layouter layouter)
          Appends the given layouter to the end of the layouter chain.
 void appendLayouters(List layouters)
          Appends the specified layouters to the end of the layouter chain.
 boolean canLayout(LayoutGraph graph)
          Returns true iff the given graph can be laid out by this algorithm.
 void clearLayouterChain()
          Clears the layouter chain and therefore removes all layouters.
 void doLayout(LayoutGraph graph)
          Main layout routine that assigns new layout information to the given graph.
 List getLayouters()
          Returns a list of the layouters that are currently in the layout chain.
 void setLayouters(List layouters)
          Sets the given list of layouters as the layouter chain.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SequentialLayouter

public SequentialLayouter()
Method Detail

canLayout

public boolean canLayout(LayoutGraph graph)
Description copied from interface: Layouter
Returns true iff the given graph can be laid out by this algorithm. Calling doLayout with the given graph as its argument will only success if this method returns true.

Specified by:
canLayout in interface Layouter

doLayout

public void doLayout(LayoutGraph graph)
Description copied from interface: Layouter
Main layout routine that assigns new layout information to the given graph.

Specified by:
doLayout in interface Layouter

appendLayouter

public void appendLayouter(Layouter layouter)
Appends the given layouter to the end of the layouter chain.

Parameters:
layouter - the layouter that should be appended to the chain.

appendLayouters

public void appendLayouters(List layouters)
Appends the specified layouters to the end of the layouter chain.

Parameters:
layouters - the layouters that should be appended to the chain.

getLayouters

public List getLayouters()
Returns a list of the layouters that are currently in the layout chain.

Returns:
a list of the layouters that are currently in the layout chain or an empty list.

setLayouters

public void setLayouters(List layouters)
Sets the given list of layouters as the layouter chain. Note: this will overwrite the current chain.

Parameters:
layouters - a list of layouters that shall be run one after the other.

clearLayouterChain

public void clearLayouterChain()
Clears the layouter chain and therefore removes all layouters.


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