de.cau.cs.kieler.kiml.layout
Class AbstractLayoutProvider

java.lang.Object
  extended by de.cau.cs.kieler.kiml.layout.AbstractLayoutProvider
Direct Known Subclasses:
BoxLayoutProvider, Draw2DLayoutProvider, GraphvizLayoutProvider, HierarchicalDataflowLayoutProvider, OgdfLayoutProvider

public abstract class AbstractLayoutProvider
extends Object

A layout provider executes a layout algorithm to layout the child elements of a node.

When used in Eclipse, layout providers must register through the layoutProviders extension point. All layout providers published to Eclipse this way are collected in the LayoutServices singleton, provided the UI plugin is loaded.

Rating proposed yellow
(2009-12-11) msp

Constructor Summary
AbstractLayoutProvider()
           
 
Method Summary
abstract  void doLayout(KNode layoutNode, IKielerProgressMonitor progressMonitor)
          Performs the actual layout process, that is attaches layout information to the given node object.
 Object getDefault(String optionId)
          Returns the default value for the given layout option.
 void initialize(String parameter)
          Initialize the layout provider with the given parameter.
 boolean supportsHierarchy(KNode layoutNode)
          Determines whether this layout provider supports hierarchy.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractLayoutProvider

public AbstractLayoutProvider()
Method Detail

initialize

public void initialize(String parameter)
Initialize the layout provider with the given parameter. The default implementation does nothing.

Parameters:
parameter - a string used to parameterize the layout provider instance

doLayout

public abstract void doLayout(KNode layoutNode,
                              IKielerProgressMonitor progressMonitor)
                       throws KielerException
Performs the actual layout process, that is attaches layout information to the given node object.

Parameters:
layoutNode - the parent node which should be laid out
progressMonitor - progress monitor used to keep track of progress
Throws:
KielerException - if the method fails to perform layout

getDefault

public Object getDefault(String optionId)
Returns the default value for the given layout option. The default implementation always returns null.

Parameters:
optionId - identifier of a layout option
Returns:
the default value for the given option, or null if this layout provider does not know that option

supportsHierarchy

public boolean supportsHierarchy(KNode layoutNode)
Determines whether this layout provider supports hierarchy. If it does, it is expected to layout not only the first hierarchy level of the input graph, but also all children. The default implementation returns false.

Parameters:
layoutNode - the parent node for which layout is requested
Returns:
true if the layout provider supports hierarchy