Top Description Inners Fields Constructors Methods
sun.swing.plaf.synth

public Class Paint9Painter

extends CachedPainter
Class Inheritance
Imports
java.awt.*, java.awt.image.BufferedImage, sun.swing.CachedPainter

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

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static enum
Paint9Painter.PaintType

Enumeration for the types of painting this class can handle.

Field Summary

Modifier and TypeField and Description
private static final Insets
public static final int
PAINT_ALL

Specifies that all regions should be painted.

public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int

Constructor Summary

AccessConstructor and Description
public
Paint9Painter(int cacheCount)

Method Summary

Modifier and TypeMethod and Description
protected Image
createImage(Component
Component painting to
c
,
int
Width of image to create
w
,
int
Height to image to create
h
,
GraphicsConfiguration
GraphicsConfiguration that will be rendered to, this may be null.
config
,
Object[]
Arguments passed to paint
args
)

Overrides sun.swing.CachedPainter.createImage.

Subclassed to always create a translucent image.

private void
drawChunk(Image
Image to render.
image
,
Graphics
Graphics to render to
g
,
boolean
Whether the image should be stretched or timed in the provided space.
stretch
,
int
X origin to draw to
dx1
,
int
Y origin to draw to
dy1
,
int
End x location to draw to
dx2
,
int
End y location to draw to
dy2
,
int
X origin to draw from
sx1
,
int
Y origin to draw from
sy1
,
int
Max x location to draw from
sx2
,
int
Max y location to draw from
sy2
,
boolean
Used if the image is not stretched. If true it indicates the image should be tiled along the x axis.
xDirection
)

Draws a portion of an image, stretched or tiled.

private void
drawImage(Image image, Graphics g, int dx1, int dy1, int dx2, int dy2, int sx1, int sy1, int sx2, int sy2)

public void
paint(Component
Component rendering to
c
,
Graphics
Graphics to render to
g
,
int
X-coordinate
x
,
int
Y-coordinate
y
,
int
Width to render to
w
,
int
Height to render to
h
,
Image
Image to render from, if null this method will do nothing
source
,
Insets
Insets specifying the portion of the image that will be stretched or tiled, if null empty Insets will be used.
sInsets
,
Insets
Destination insets specifying the portion of the image will be stretched or tiled, if null empty Insets will be used.
dInsets
,
Paint9Painter.PaintType
Specifies what type of algorithm to use in painting
type
,
int
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.
mask
)

Paints using the algorithm specified by paintType.

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
Component painting to, may be null.
c
,
Image
Image to paint to
destImage
,
Graphics
Graphics to paint to, obtained from the passed in Image.
g
,
int
Width to paint to
w
,
int
Height to paint to
h
,
Object[]
Arguments supplied to paint
args
)

Implements abstract sun.swing.CachedPainter.paintToImage.

Paints the representation to cache to the supplied Graphics.

public static boolean

Returns:

true if image is non-null and has a positive size.
validImage
(Image
Image to check.
image
)

Convenience method for testing the validity of an image.

Inherited from sun.swing.CachedPainter:
flushpaintpaintImage

Field Detail

EMPTY_INSETSback to summary
private static final Insets EMPTY_INSETS
PAINT_ALLback to summary
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.

PAINT_BOTTOMback to summary
public static final int PAINT_BOTTOM
PAINT_BOTTOM_LEFTback to summary
public static final int PAINT_BOTTOM_LEFT
PAINT_BOTTOM_RIGHTback to summary
public static final int PAINT_BOTTOM_RIGHT
PAINT_CENTERback to summary
public static final int PAINT_CENTER
PAINT_LEFTback to summary
public static final int PAINT_LEFT
PAINT_RIGHTback to summary
public static final int PAINT_RIGHT
PAINT_TOPback to summary
public static final int PAINT_TOP
PAINT_TOP_LEFTback to summary
public static final int PAINT_TOP_LEFT
PAINT_TOP_RIGHTback to summary
public static final int PAINT_TOP_RIGHT

Constructor Detail

Paint9Painterback to summary
public Paint9Painter(int cacheCount)

Method Detail

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

Overrides sun.swing.CachedPainter.createImage.

Subclassed to always create a translucent image.

Parameters
c:Component

Doc from sun.swing.CachedPainter.createImage.

Component painting to

w:int

Doc from sun.swing.CachedPainter.createImage.

Width of image to create

h:int

Doc from sun.swing.CachedPainter.createImage.

Height to image to create

config:GraphicsConfiguration

Doc from sun.swing.CachedPainter.createImage.

GraphicsConfiguration that will be rendered to, this may be null.

args:Object[]

Doc from sun.swing.CachedPainter.createImage.

Arguments passed to paint

drawChunkback to summary
private void drawChunk(Image image, Graphics g, boolean stretch, int dx1, int dy1, int dx2, int dy2, int sx1, int sy1, int sx2, int sy2, boolean xDirection)

Draws a portion of an image, stretched or tiled.

Parameters
image:Image

Image to render.

g:Graphics

Graphics to render to

stretch:boolean

Whether the image should be stretched or timed in the provided space.

dx1:int

X origin to draw to

dy1:int

Y origin to draw to

dx2:int

End x location to draw to

dy2:int

End y location to draw to

sx1:int

X origin to draw from

sy1:int

Y origin to draw from

sx2:int

Max x location to draw from

sy2:int

Max y location to draw from

xDirection:boolean

Used if the image is not stretched. If true it indicates the image should be tiled along the x axis.

drawImageback to summary
private void drawImage(Image image, Graphics g, int dx1, int dy1, int dx2, int dy2, int sx1, int sy1, int sx2, int sy2)
paintback to summary
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 algorithm specified by paintType. NOTE that this just invokes super.paint(...) with the same argument ordering as this method.

Parameters
c:Component

Component rendering to

g:Graphics

Graphics to render to

x:int

X-coordinate

y:int

Y-coordinate

w:int

Width to render to

h:int

Height to render to

source:Image

Image to render from, if null this method will do nothing

sInsets:Insets

Insets specifying the portion of the image that will be stretched or tiled, if null empty Insets will be used.

dInsets:Insets

Destination insets specifying the portion of the image will be stretched or tiled, if null empty Insets will be used.

type:Paint9Painter.PaintType

Specifies what type of algorithm to use in painting

mask:int

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.

paint9back to summary
protected void paint9(Graphics g, int x, int y, int w, int h, Image image, Insets sInsets, Insets dInsets, Paint9Painter.PaintType type, int componentMask)
paintToImageback to summary
protected void paintToImage(Component c, Image destImage, Graphics g, int w, int h, Object[] args)

Implements abstract sun.swing.CachedPainter.paintToImage.

Doc from sun.swing.CachedPainter.paintToImage.

Paints the representation to cache to the supplied Graphics.

Parameters
c:Component

Component painting to, may be null.

destImage:Image

Image to paint to

g:Graphics

Graphics to paint to, obtained from the passed in Image.

w:int

Width to paint to

h:int

Height to paint to

args:Object[]

Arguments supplied to paint

validImageback to summary
public static boolean validImage(Image image)

Convenience method for testing the validity of an image.

Parameters
image:Image

Image to check.

Returns:boolean

true if image is non-null and has a positive size.

sun.swing.plaf.synth back to summary

public final Enum Paint9Painter.PaintType

extends Enum<Paint9Painter.PaintType>
Class Inheritance

Enumeration for the types of painting this class can handle.

Field Summary

Modifier and TypeField and Description
public static final Paint9Painter.PaintType
CENTER

Painting type indicating the image should be centered in the space provided.

public static final Paint9Painter.PaintType
PAINT9_STRETCH

Painting type indicating the image should be split into nine regions with the top, left, bottom and right areas stretched.

public static final Paint9Painter.PaintType
PAINT9_TILE

Painting type indicating the image should be split into nine regions with the top, left, bottom and right areas tiled.

public static final Paint9Painter.PaintType
TILE

Painting type indicating the image should be tiled across the specified width and height.

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static Paint9Painter.PaintType
public static Paint9Painter.PaintType[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

CENTERback to summary
public static final Paint9Painter.PaintType CENTER

Painting type indicating the image should be centered in the space provided. When used the mask is ignored.

PAINT9_STRETCHback to summary
public static final Paint9Painter.PaintType PAINT9_STRETCH

Painting type indicating the image should be split into nine regions with the top, left, bottom and right areas stretched.

PAINT9_TILEback to summary
public static final Paint9Painter.PaintType PAINT9_TILE

Painting type indicating the image should be split into nine regions with the top, left, bottom and right areas tiled.

TILEback to summary
public static final Paint9Painter.PaintType TILE

Painting type indicating the image should be tiled across the specified width and height. When used the mask is ignored.

Constructor Detail

PaintTypeback to summary
private PaintType()

Method Detail

valueOfback to summary
public static Paint9Painter.PaintType valueOf(String name)
valuesback to summary
public static Paint9Painter.PaintType[] values()