de.cau.cs.kieler.kiml.gmf
Class GmfCachedLayout

java.lang.Object
  extended by de.cau.cs.kieler.kiml.gmf.GmfCachedLayout
All Implemented Interfaces:
ICachedLayout

public class GmfCachedLayout
extends Object
implements ICachedLayout

A cache for results of automatic layout. Can be used to repeatedly apply the same layout to a diagram.

Rating proposed yellow
(2010-01-26) msp

Constructor Summary
GmfCachedLayout(int initialCapacity)
          Creates a cached layout with given initial capacity.
 
Method Summary
 void addLayout(EObject modelObject, KGraphElement graphElement)
          Adds the given model object with associated layout to the cache.
 void addLayout(org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart editPart, KGraphElement graphElement)
          Adds the given edit part with associated layout to the cache.
 void applyLayout(IWorkbenchPart workbenchPart)
          Applies the cached layout to the given editor part.
 void applyLayout(IWorkbenchPart workbenchPart, boolean animate)
          Applies the cached layout to the given editor part.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GmfCachedLayout

public GmfCachedLayout(int initialCapacity)
Creates a cached layout with given initial capacity.

Parameters:
initialCapacity - the initial capacity of the cache
Method Detail

addLayout

public void addLayout(EObject modelObject,
                      KGraphElement graphElement)
Adds the given model object with associated layout to the cache.

Parameters:
modelObject - a model object
graphElement - the associated layout graph element

addLayout

public void addLayout(org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart editPart,
                      KGraphElement graphElement)
Adds the given edit part with associated layout to the cache.

Parameters:
editPart - an edit part
graphElement - the associated layout graph element

applyLayout

public void applyLayout(IWorkbenchPart workbenchPart,
                        boolean animate)
Applies the cached layout to the given editor part.

Specified by:
applyLayout in interface ICachedLayout
Parameters:
workbenchPart - a diagram workbench part
animate - if true, Draw2D animation is activated

applyLayout

public void applyLayout(IWorkbenchPart workbenchPart)
Applies the cached layout to the given editor part.

Specified by:
applyLayout in interface ICachedLayout
Parameters:
workbenchPart - a diagram workbench part