public class

Paint9Painter

extends CachedPainter
java.lang.Object
   ↳ sun.swing.CachedPainter
     ↳ sun.swing.plaf.synth.Paint9Painter

Class Overview

Paint9Painter is used for painting images for both Synth and GTK's pixmap/blueprint engines.

Summary

Nested Classes
enum Paint9Painter.PaintType Enumeration for the types of painting this class can handle. 
Constants
int PAINT_ALL Specifies that all regions should be painted.
int PAINT_BOTTOM
int PAINT_BOTTOM_LEFT
int PAINT_BOTTOM_RIGHT
int PAINT_CENTER
int PAINT_LEFT
int PAINT_RIGHT
int PAINT_TOP
int PAINT_TOP_LEFT
int PAINT_TOP_RIGHT
Public Constructors
Paint9Painter(int cacheCount)
Public Methods
void paint(Component c, Graphics g, int x, int y, int w, int h, Image source, Insets sInsets, Insets dInsets, Paint9Painter.PaintType type, int mask)
Paints using the algorightm specified by paintType.
static boolean validImage(Image image)
Conveniance method for testing the validity of an image.
Protected Methods
Image createImage(Component c, int w, int h, GraphicsConfiguration config, Object[] args)
Subclassed to always create a translucent image.
void paint9(Graphics g, int x, int y, int w, int h, Image image, Insets sInsets, Insets dInsets, Paint9Painter.PaintType type, int componentMask)
void paintToImage(Component c, Image destImage, Graphics g, int w, int h, Object[] args)
Paints the representation to cache to the supplied Graphics.
[Expand]
Inherited Methods
From class sun.swing.CachedPainter
From class java.lang.Object

Constants

public static final int PAINT_ALL

Specifies that all regions should be painted. If this is set any other regions specified will not be painted. For example PAINT_ALL | PAINT_CENTER will paint all but the center.

Constant Value: 512 (0x00000200)

public static final int PAINT_BOTTOM

Constant Value: 128 (0x00000080)

public static final int PAINT_BOTTOM_LEFT

Constant Value: 256 (0x00000100)

public static final int PAINT_BOTTOM_RIGHT

Constant Value: 64 (0x00000040)

public static final int PAINT_CENTER

Constant Value: 16 (0x00000010)

public static final int PAINT_LEFT

Constant Value: 8 (0x00000008)

public static final int PAINT_RIGHT

Constant Value: 32 (0x00000020)

public static final int PAINT_TOP

Constant Value: 2 (0x00000002)

public static final int PAINT_TOP_LEFT

Constant Value: 1 (0x00000001)

public static final int PAINT_TOP_RIGHT

Constant Value: 4 (0x00000004)

Public Constructors

public Paint9Painter (int cacheCount)

Public Methods

public void paint (Component c, Graphics g, int x, int y, int w, int h, Image source, Insets sInsets, Insets dInsets, Paint9Painter.PaintType type, int mask)

Paints using the algorightm specified by paintType. NOTE that this just invokes super.paint(...) with the same argument ordering as this method.

Parameters
c Component rendering to
g Graphics to render to
x X-coordinate
y Y-coordinate
w Width to render to
h Height to render to
source Image to render from, if null this method will do nothing
sInsets Insets specifying the portion of the image that will be stretched or tiled, if null empty Insets will be used.
dInsets Destination insets specifying the portion of the image will be stretched or tiled, if null empty Insets will be used.
mask Specifies portion of image to render, if PAINT_ALL is specified, any other regions specified will not be painted, for example PAINT_ALL | PAINT_CENTER paints everything but the center.

public static boolean validImage (Image image)

Conveniance method for testing the validity of an image.

Parameters
image Image to check.
Returns
  • true if image is non-null and has a positive size.

Protected Methods

protected Image createImage (Component c, int w, int h, GraphicsConfiguration config, Object[] args)

Subclassed to always create a translucent image.

Parameters
c Component painting to
w Width of image to create
h Height to image to create
config GraphicsConfiguration that will be rendered to, this may be null.
args Arguments passed to paint

protected void paint9 (Graphics g, int x, int y, int w, int h, Image image, Insets sInsets, Insets dInsets, Paint9Painter.PaintType type, int componentMask)

protected void paintToImage (Component c, Image destImage, Graphics g, int w, int h, Object[] args)

Paints the representation to cache to the supplied Graphics.

Parameters
c Component painting to, may be null.
destImage Image to paint to
g Graphics to paint to, obtained from the passed in Image.
w Width to paint to
h Height to paint to
args Arguments supplied to paint