UIX 2.2.16

oracle.cabo.image.painter
Class AbstractWrappingPainter

java.lang.Object
  |
  +--oracle.cabo.image.painter.AbstractPainter
        |
        +--oracle.cabo.image.painter.AbstractWrappingPainter
All Implemented Interfaces:
Painter
Direct Known Subclasses:
AbstractBorderPainter, ColorChange, OffscreenWrappingPainter

public abstract class AbstractWrappingPainter
extends AbstractPainter

Abstract baseclass for Painters that wrap other painters, modifying the attributes of the wrapped painter. This class delegates all Painter methods through to the wrapped Painter.


Constructor Summary
AbstractWrappingPainter()
          Create an AbstractWrappingPainter wrapping a NullPainter.
AbstractWrappingPainter(Painter wrappedPainter)
          Create an AbstractWrappingPainter wrapping another Painter.
 
Method Summary
 java.awt.Dimension getMinimumSize(PaintContext context)
          Returns the minimum size of the wrapped painter.
 java.awt.Dimension getPreferredSize(PaintContext context)
          Returns the preferred size of the wrapped painter.
protected  Painter getWrappedPainter(PaintContext context)
          Returns the wrapped painter.
 void paint(PaintContext context, java.awt.Graphics g, int x, int y, int width, int height)
          Paints the wrapped Painter.
 
Methods inherited from class oracle.cabo.image.painter.AbstractPainter
getData, getDataKey
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractWrappingPainter

public AbstractWrappingPainter()
Create an AbstractWrappingPainter wrapping a NullPainter.

See Also:
NullPainter.getPainter()

AbstractWrappingPainter

public AbstractWrappingPainter(Painter wrappedPainter)
Create an AbstractWrappingPainter wrapping another Painter.

Parameters:
wrappedPainter - The Painter to wrap.
Method Detail

getPreferredSize

public java.awt.Dimension getPreferredSize(PaintContext context)
Returns the preferred size of the wrapped painter.

Overrides:
getPreferredSize in class AbstractPainter
Parameters:
context - Context for determining the preferred size.

Returns:
The preferred size of the Painter.

getMinimumSize

public java.awt.Dimension getMinimumSize(PaintContext context)
Returns the minimum size of the wrapped painter.

Parameters:
context - Context for determining the minimum size.
Returns:
The minimum size of the Painter.

paint

public void paint(PaintContext context,
                  java.awt.Graphics g,
                  int x,
                  int y,
                  int width,
                  int height)
Paints the wrapped Painter.

Parameters:
context - Context for painting.
g - Graphics object to draw into.
x - X position to draw at.
y - Y position to draw at.
width - Width to draw into.
height - Height to draw into.

getWrappedPainter

protected Painter getWrappedPainter(PaintContext context)
Returns the wrapped painter. By default, just returns the painter passed to the constructor, but subclasses can override this method to dynamically adjust the wrapped painter depending on the PaintContext.
Parameters:
context - Context to use for determining the wrapped painter.

UIX 2.2.16