de.cau.cs.kieler.kiml.ui.diagram
Interface IDiagramLayoutManager<T>

Type Parameters:
T - the type of diagram part that is handled by this diagram layout manager
All Known Implementing Classes:
GefDiagramLayoutManager, GmfDiagramLayoutManager, GraphitiDiagramLayoutManager, MultiPartDiagramLayoutManager

public interface IDiagramLayoutManager<T>

Interface for managers of diagram layout.

Rating proposed yellow
(2009-12-11) msp

Method Summary
 void applyLayout(LayoutMapping<T> mapping, boolean zoomToFit, int animationTime)
          Apply the computed layout back to the diagram.
 LayoutMapping<T> buildLayoutGraph(IWorkbenchPart workbenchPart, Object diagramPart)
          Build a KGraph instance for the given diagram.
 IMutableLayoutConfig getLayoutConfig()
          Return a framework-specific layout configuration.
 boolean supports(Object object)
          Determine whether this layout manager is able to perform layout for the given object.
 

Method Detail

supports

boolean supports(Object object)
Determine whether this layout manager is able to perform layout for the given object.

Parameters:
object - a workbench part or edit part
Returns:
true if this layout manager supports the object

buildLayoutGraph

LayoutMapping<T> buildLayoutGraph(IWorkbenchPart workbenchPart,
                                  Object diagramPart)
Build a KGraph instance for the given diagram. The resulting layout graph should reflect the structure of the original diagram.

Parameters:
workbenchPart - the workbench part for which layout is performed
diagramPart - the parent object for which layout is performed, or null if the whole diagram shall be layouted
Returns:
a layout graph mapping

applyLayout

void applyLayout(LayoutMapping<T> mapping,
                 boolean zoomToFit,
                 int animationTime)
Apply the computed layout back to the diagram.

Parameters:
mapping - a layout mapping that was created by this layout manager
zoomToFit - whether the diagram should zoom to fit
animationTime - the animation time in milliseconds, or 0 for no animation

getLayoutConfig

IMutableLayoutConfig getLayoutConfig()
Return a framework-specific layout configuration.

Returns:
a layout configuration for this diagram layout manager