Class OverlayDecorator

  • All Implemented Interfaces:
    Decorator

    public class OverlayDecorator
    extends java.lang.Object
    implements Decorator
    Decorator that overlays a component on top of another component. The overlay component is strictly visual and does not respond to user input.
    • Constructor Detail

      • OverlayDecorator

        public OverlayDecorator()
      • OverlayDecorator

        public OverlayDecorator​(Component overlay)
    • Method Detail

      • setOverlay

        public void setOverlay​(Component overlay)
      • 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()
        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