de.cau.cs.kieler.kiml
Class AbstractLayoutProvider

java.lang.Object
  extended by de.cau.cs.kieler.core.properties.MapPropertyHolder
      extended by de.cau.cs.kieler.kiml.AbstractLayoutProvider
All Implemented Interfaces:
IPropertyHolder
Direct Known Subclasses:
BoxLayoutProvider, Draw2DLayoutProvider, FixedLayoutProvider, GraphvizLayoutProvider, HierarchicalDataflowLayoutProvider, OgdfLayoutProvider, RandomLayoutProvider

public abstract class AbstractLayoutProvider
extends MapPropertyHolder

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.

Layout providers can hold properties, which represent the default layout option values of the layout provider. Subclasses can register their default layout option values in their constructor.

Rating proposed yellow
(2009-12-11) msp

Constructor Summary
AbstractLayoutProvider()
           
 
Method Summary
abstract  void doLayout(KNode parentNode, IKielerProgressMonitor progressMonitor)
          Performs the actual layout process, that is attaches layout information to the given node object.
 IDebugCanvas getDebugCanvas()
          Returns the current debug canvas.
 void initialize(String parameter)
          Initialize the layout provider with the given parameter.
 void setDebugCanvas(IDebugCanvas thedebugCanvas)
          Sets the current debug canvas.
 boolean supportsHierarchy(KNode layoutNode)
          Determines whether this layout provider would handle the complete hierarchy of the given layout node.
 
Methods inherited from class de.cau.cs.kieler.core.properties.MapPropertyHolder
copyProperties, getAllProperties, getProperty, setProperty
 
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)
                throws KielerException
Initialize the layout provider with the given parameter.

Parameters:
parameter - a string used to parameterize the layout provider instance
Throws:
KielerException - if the provider has received a wrong parameter

doLayout

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

Parameters:
parentNode - 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

supportsHierarchy

public boolean supportsHierarchy(KNode layoutNode)
Determines whether this layout provider would handle the complete hierarchy of the given layout node. If it does, it is expected to layout not only the first hierarchy level of the input graph, but also all its children.

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

setDebugCanvas

public final void setDebugCanvas(IDebugCanvas thedebugCanvas)
Sets the current debug canvas.

Parameters:
thedebugCanvas - the debug canvas

getDebugCanvas

public final IDebugCanvas getDebugCanvas()
Returns the current debug canvas.

Returns:
the debug canvas