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
Color decorators can be used to modify the visualization of a shape without
modifying the dirty state of the displaying editor, see
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.- Since:
- 0.9
-
Constructor Summary
ConstructorDescriptionCreates 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
Modifier and TypeMethodDescriptionReturns the color that will be used for painting the background of the shape to decorate.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 Details
-
ColorDecorator
public ColorDecorator()Creates a new color decorator that decorates a shape with foreground and background colors. -
ColorDecorator
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 Details
-
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
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
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
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
-