Class ReflectionDecorator

  • All Implemented Interfaces:
    Decorator

    public class ReflectionDecorator
    extends java.lang.Object
    implements Decorator
    Decorator that paints a reflection of a component.

    TODO Make gradient properties configurable.

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      Bounds getBounds​(Component componentValue)
      Returns the bounding area of the decorator.
      java.awt.geom.AffineTransform getTransform​(Component componentValue)
      Returns the transformation the decorator applies to the component's coordinate space.
      java.awt.Graphics2D prepare​(Component componentValue, java.awt.Graphics2D graphicsValue)
      Prepares the graphics context into which the component or prior decorator will paint.
      void update()
      Updates the graphics context into which the component or prior decorator was painted.
      • Methods inherited from class java.lang.Object

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

      • ReflectionDecorator

        public ReflectionDecorator()
    • Method Detail

      • prepare

        public java.awt.Graphics2D prepare​(Component componentValue,
                                           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:
        componentValue - 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()
        Description copied from interface: Decorator
        Updates the graphics context into which the component or prior decorator was painted. This method is called immediately after Component.paint(Graphics2D); decorators are called in ascending order.

        This default version simply returns, without doing anything (often the appropriate thing to do).

        Specified by:
        update in interface Decorator
      • getBounds

        public Bounds getBounds​(Component componentValue)
        Description copied from interface: Decorator
        Returns the bounding area of the decorator.

        This default simply returns the bounds of the component's size.

        Specified by:
        getBounds in interface Decorator
        Parameters:
        componentValue - The component that the decorator is attached to.
        Returns:
        The decorator's bounds, relative to the component's origin.
      • getTransform

        public java.awt.geom.AffineTransform getTransform​(Component componentValue)
        Description copied from interface: Decorator
        Returns the transformation the decorator applies to the component's coordinate space.

        This default simply returns a new AffineTransform.

        Specified by:
        getTransform in interface Decorator
        Parameters:
        componentValue - The component the decorator is attached to.
        Returns:
        The decorator's transform.