Class SaturationDecorator

  • All Implemented Interfaces:
    Decorator

    public class SaturationDecorator
    extends java.lang.Object
    implements Decorator
    Decorator that modifies the color saturation of a component.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      float getMultiplier()  
      java.awt.Graphics2D prepare​(Component component, java.awt.Graphics2D graphicsValue)
      Prepares the graphics context into which the component or prior decorator will paint.
      void setMultiplier​(float multiplier)  
      void setMultiplier​(java.lang.Number multiplier)  
      void update()
      Adjusts the saturation of the component image and draws the resulting image using the component's graphics.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SaturationDecorator

        public SaturationDecorator()
      • SaturationDecorator

        public SaturationDecorator​(float multiplier)
    • Method Detail

      • getMultiplier

        public float getMultiplier()
      • setMultiplier

        public void setMultiplier​(float multiplier)
      • setMultiplier

        public void setMultiplier​(java.lang.Number multiplier)
      • prepare

        public java.awt.Graphics2D prepare​(Component component,
                                           java.awt.Graphics2D graphicsValue)
        Description copied from interface: Decorator
        Prepares the graphics context into which the component or prior decorator will paint. This method is called immediately prior to Component.paint(Graphics2D); decorators are called in descending order.
        Specified by:
        prepare in interface Decorator
        Parameters:
        component - The component the decorator is attached to.
        graphicsValue - The graphics context to draw into.
        Returns:
        The graphics context that should be used by the component or prior decorators.
      • update

        public void update()
        Adjusts the saturation of the component image and draws the resulting image using the component's graphics.
        Specified by:
        update in interface Decorator