Class ClipDecorator

  • All Implemented Interfaces:
    Decorator

    public class ClipDecorator
    extends java.lang.Object
    implements Decorator
    Decorator that adds a rectangular region to the current clip.
    • Constructor Detail

      • ClipDecorator

        public ClipDecorator()
    • Method Detail

      • getX

        public int getX()
      • setX

        public void setX​(int x)
      • getY

        public int getY()
      • setY

        public void setY​(int y)
      • setOrigin

        public void setOrigin​(int x,
                              int y)
      • getOrigin

        public Point getOrigin()
      • getWidth

        public int getWidth()
      • setWidth

        public void setWidth​(int width)
      • getHeight

        public int getHeight()
      • setHeight

        public void setHeight​(int height)
      • setSize

        public void setSize​(int width,
                            int height)
      • prepare

        public java.awt.Graphics2D prepare​(Component component,
                                           java.awt.Graphics2D graphics)
        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.
        graphics - The graphics context to draw into.
        Returns:
        The graphics context that should be used by the component or prior decorators.
      • getBounds

        public Bounds getBounds​(Component component)
        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:
        component - The component that the decorator is attached to.
        Returns:
        The decorator's bounds, relative to the component's origin.