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
ConstructorsConstructorDescriptionCreates 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.voidsetBackgroundColor(IColorConstant backgroundColor) Sets the color to be used for the background of the shape.voidsetForegroundColor(IColorConstant foregroundColor) Sets the color to be used for the foreground of the shape.Methods inherited from class org.eclipse.graphiti.tb.AbstractDecorator
getMessage, setMessageMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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- anIColorConstantdefining the color for the foreground of the shapebackgroundColor- anIColorConstantdefining the color for the background of the shape
-
-
Method Details
-
getForegroundColor
Description copied from interface:IColorDecoratorReturns 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:
getForegroundColorin interfaceIColorDecorator- Returns:
- a
IColorConstantdefining the color
-
setForegroundColor
Sets the color to be used for the foreground of the shape. By default (whennullis set)the original foreground color of the shape is kept.- Parameters:
foregroundColor- anIColorConstantdefining the color for the foreground of the shape
-
getBackgroundColor
Description copied from interface:IColorDecoratorReturns 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:
getBackgroundColorin interfaceIColorDecorator- Returns:
- a
IColorConstantdefining the color
-
setBackgroundColor
Sets the color to be used for the background of the shape. By default (whennullis set) the original background color of the shape is kept.- Parameters:
backgroundColor- anIColorConstantdefining the color for the background of the shape
-