Class 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, 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 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 - an IColorConstant defining the color for the foreground of the shape
        backgroundColor - an IColorConstant 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 returning null) the original foreground color of the shape is kept.
        Specified by:
        getForegroundColor in interface IColorDecorator
        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 (when null is set)the original foreground color of the shape is kept.
        Parameters:
        foregroundColor - an IColorConstant 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 returning null) the original background color of the shape is kept.
        Specified by:
        getBackgroundColor in interface IColorDecorator
        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 (when null is set) the original background color of the shape is kept.
        Parameters:
        backgroundColor - an IColorConstant defining the color for the background of the shape