org.eclipse.gmf.runtime.lite.edit.parts.decorations
Class PaneDecorationManager

java.lang.Object
  extended by org.eclipse.gmf.runtime.lite.edit.parts.decorations.AbstractDecorationManager
      extended by org.eclipse.gmf.runtime.lite.edit.parts.decorations.PaneDecorationManager
All Implemented Interfaces:
IDecorationManager

public class PaneDecorationManager
extends AbstractDecorationManager

Decoration manager that places decorations as children of a given figure. The actual position of the decoration is controlled by the getDecorationPosition(String) method.

Author:
bblajer

Constructor Summary
PaneDecorationManager(org.eclipse.draw2d.IFigure decorationParent)
           
 
Method Summary
protected  Object getConstraint(String key, org.eclipse.draw2d.IFigure decoration)
          Returns the constraint with which the decoration will be added to the parent figure.
protected  int getDecorationPosition(String key)
          Returns the position where the decorator with the given key should appear.
protected  int getDefaultDecorationPosition()
          Returns the position where the decorator with an unregistered key should appear.
 void installDecorationPosition(String key, int decorationPosition)
          Registers the given position for the given key.
 void uninstallDecorationPosition(String key)
          Unregisters the given position for the given key.
 
Methods inherited from class org.eclipse.gmf.runtime.lite.edit.parts.decorations.AbstractDecorationManager
getDecoration, getDecorationParent, installDecoration
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PaneDecorationManager

public PaneDecorationManager(org.eclipse.draw2d.IFigure decorationParent)
Method Detail

getConstraint

protected Object getConstraint(String key,
                               org.eclipse.draw2d.IFigure decoration)
Description copied from class: AbstractDecorationManager
Returns the constraint with which the decoration will be added to the parent figure.

Specified by:
getConstraint in class AbstractDecorationManager
Returns:

getDecorationPosition

protected int getDecorationPosition(String key)
Returns the position where the decorator with the given key should appear. Positions for keys may be installed using installDecorationPosition(String, int) If the key is unknown (was never installed or was uninstalled), the default position is used. Subclasses may reimplement.

Parameters:
key - the key which is used to install the decorator

getDefaultDecorationPosition

protected int getDefaultDecorationPosition()
Returns the position where the decorator with an unregistered key should appear. By default, all decorators are positioned to the north-west of the parent figure. Subclasses may reimplement.


installDecorationPosition

public void installDecorationPosition(String key,
                                      int decorationPosition)
Registers the given position for the given key.

Parameters:
key - the key which is used to install a decorator
decorationPosition - position where the decorator with this key should appear.

uninstallDecorationPosition

public void uninstallDecorationPosition(String key)
Unregisters the given position for the given key. Subsequently, decorator with the given key will appear at the default location.

Parameters:
key - the key which is used to install a decorator


Copyright © 2012. All Rights Reserved.