IBM Rational Software Modeler
Release 6.0

com.ibm.xtools.presentation.services.decorator
Interface IDecoratorTarget

All Superinterfaces:
IAdaptable

public interface IDecoratorTarget
extends IAdaptable

An object that can be decorated. The decorator target is an adaptable, minimally, it adapts to an EditPart and org.eclipse.uml2.Element if the shape/connection has an underlying element.


Nested Class Summary
static class IDecoratorTarget.Direction
          Enumeration of directions for location of shape decorations.
 
Method Summary
 IDecoration addConnectionDecoration(Image image, int percentageFromSource, boolean isVolatile)
          Adds an image as a decoration on a connection.
 IDecoration addShapeDecoration(Image image, IDecoratorTarget.Direction direction, int margin, boolean isVolatile)
          Adds an image as a decoration on a shape.
 void installDecorator(Object key, IDecorator decorator)
          Installs a decorator on this decorator target.
 void removeDecoration(IDecoration decoration)
          Removes the decoration from the shape or connector it has been added to.
 
Methods inherited from interface org.eclipse.core.runtime.IAdaptable
getAdapter
 

Method Detail

installDecorator

public void installDecorator(Object key,
                             IDecorator decorator)
Installs a decorator on this decorator target.

Parameters:
key - the key for the decorator, used to override a decorator previously installed on the decoratorTarget object
decorator - the decorator to install

addShapeDecoration

public IDecoration addShapeDecoration(Image image,
                                      IDecoratorTarget.Direction direction,
                                      int margin,
                                      boolean isVolatile)
Adds an image as a decoration on a shape.

Parameters:
image - The image to be used as the decoration.
direction - The direction relative to the shape to place the decoration.
margin - The margin is the space, in himetric units, between the shape's edge and the decoration. A positive margin will place the figure outside the shape, a negative margin will place the decoration inside the shape.
isVolatile - True if this decoration is volatile (i.e. not to be included in the printed output of a diagram); false otherwise.
Returns:
The decoration object, which is needed to later remove the decoration.

addConnectionDecoration

public IDecoration addConnectionDecoration(Image image,
                                           int percentageFromSource,
                                           boolean isVolatile)
Adds an image as a decoration on a connection.

Parameters:
image - The image to be used as the decoration.
percentageFromSource - The percentage of the connector length away from the source end (range is from 0 to 100) where the decoration should be positioned.
isVolatile - True if this decoration is volatile (i.e. not to be included in the printed output of a diagram); false otherwise.
Returns:
The decoration object, which is needed to later remove the decoration.

removeDecoration

public void removeDecoration(IDecoration decoration)
Removes the decoration from the shape or connector it has been added to.

Parameters:
decoration - The decoration to be removed.

IBM Rational Software Modeler
Release 6.0


Guidelines for using Eclipse APIs.

Copyright (c) IBM Corp. and others 2004. All rights reserved.