Package org.eclipse.graphiti.tb
Class ColorDecorator
- java.lang.Object
-
- org.eclipse.graphiti.tb.AbstractDecorator
-
- org.eclipse.graphiti.tb.ColorDecorator
-
- All Implemented Interfaces:
IColorDecorator
,IDecorator
public class ColorDecorator extends AbstractDecorator implements IColorDecorator
Color decorators can be used to modify the visualization of a shape without modifying the dirty state of the displaying editor, seeIDecorator
. Note that modifying background and foreground colors as it is possible with this decorator will have no effect if the shape is invisible, the complete shape is hidden underneath other (possibly contained) shapes or the shape uses gradients.- Since:
- 0.9
-
-
Constructor Summary
Constructors Constructor Description ColorDecorator()
Creates a new color decorator that decorates a shape with foreground and background colors.ColorDecorator(IColorConstant foregroundColor, IColorConstant backgroundColor)
Creates a new color decorator that decorates a shape with the given foreground and background colors.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IColorConstant
getBackgroundColor()
Returns the color that will be used for painting the background of the shape to decorate.IColorConstant
getForegroundColor()
Returns the color that will be used for painting the foreground of the shape to decorate.void
setBackgroundColor(IColorConstant backgroundColor)
Sets the color to be used for the background of the shape.void
setForegroundColor(IColorConstant foregroundColor)
Sets the color to be used for the foreground of the shape.-
Methods inherited from class org.eclipse.graphiti.tb.AbstractDecorator
getMessage, setMessage
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.eclipse.graphiti.tb.IDecorator
getMessage, setMessage
-
-
-
-
Constructor Detail
-
ColorDecorator
public ColorDecorator()
Creates a new color decorator that decorates a shape with foreground and background colors.
-
ColorDecorator
public ColorDecorator(IColorConstant foregroundColor, IColorConstant backgroundColor)
Creates a new color decorator that decorates a shape with the given foreground and background colors. See the setter methods for details on these values.- Parameters:
foregroundColor
- anIColorConstant
defining the color for the foreground of the shapebackgroundColor
- anIColorConstant
defining the color for the background of the shape
-
-
Method Detail
-
getForegroundColor
public IColorConstant getForegroundColor()
Description copied from interface:IColorDecorator
Returns the color that will be used for painting the foreground of the shape to decorate. By default (when returningnull
) the original foreground color of the shape is kept.- Specified by:
getForegroundColor
in interfaceIColorDecorator
- Returns:
- a
IColorConstant
defining the color
-
setForegroundColor
public void setForegroundColor(IColorConstant foregroundColor)
Sets the color to be used for the foreground of the shape. By default (whennull
is set)the original foreground color of the shape is kept.- Parameters:
foregroundColor
- anIColorConstant
defining the color for the foreground of the shape
-
getBackgroundColor
public IColorConstant getBackgroundColor()
Description copied from interface:IColorDecorator
Returns the color that will be used for painting the background of the shape to decorate. By default (when returningnull
) the original background color of the shape is kept.- Specified by:
getBackgroundColor
in interfaceIColorDecorator
- Returns:
- a
IColorConstant
defining the color
-
setBackgroundColor
public void setBackgroundColor(IColorConstant backgroundColor)
Sets the color to be used for the background of the shape. By default (whennull
is set) the original background color of the shape is kept.- Parameters:
backgroundColor
- anIColorConstant
defining the color for the background of the shape
-
-