public class ColorDecorator extends AbstractDecorator implements IColorDecorator
IDecorator
.
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.Constructor and 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.
|
Modifier and Type | Method and 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.
|
getMessage, setMessage
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getMessage, setMessage
public ColorDecorator()
public ColorDecorator(IColorConstant foregroundColor, IColorConstant backgroundColor)
foregroundColor
- an IColorConstant
defining the color for the
foreground of the shapebackgroundColor
- an IColorConstant
defining the color for the
background of the shapepublic IColorConstant getForegroundColor()
IColorDecorator
null
) the
original foreground color of the shape is kept.getForegroundColor
in interface IColorDecorator
IColorConstant
defining the colorpublic void setForegroundColor(IColorConstant foregroundColor)
null
is set)the original foreground color of the shape
is kept.foregroundColor
- an IColorConstant
defining the color for the
foreground of the shapepublic IColorConstant getBackgroundColor()
IColorDecorator
null
) the
original background color of the shape is kept.getBackgroundColor
in interface IColorDecorator
IColorConstant
defining the colorpublic void setBackgroundColor(IColorConstant backgroundColor)
null
is set) the original background color of the
shape is kept.backgroundColor
- an IColorConstant
defining the color for the
background of the shape