Class TagDecorator

  • All Implemented Interfaces:
    Decorator

    public class TagDecorator
    extends java.lang.Object
    implements Decorator
    Decorator that allows a caller to attach a "tag" visual to a component.
    • Constructor Detail

      • TagDecorator

        public TagDecorator()
      • TagDecorator

        public TagDecorator​(Visual tag)
    • Method Detail

      • getTag

        public Visual getTag()
      • setTag

        public void setTag​(Visual tag)
      • setHorizontalAlignment

        public void setHorizontalAlignment​(HorizontalAlignment horizontalAlignment)
      • setVerticalAlignment

        public void setVerticalAlignment​(VerticalAlignment verticalAlignment)
      • getXOffset

        public int getXOffset()
      • setXOffset

        public void setXOffset​(int xOffset)
      • getYOffset

        public int getYOffset()
      • setYOffset

        public void setYOffset​(int yOffset)
      • prepare

        public java.awt.Graphics2D prepare​(Component component,
                                           java.awt.Graphics2D graphicsArgument)
        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.
        graphicsArgument - 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 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.