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. |
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
Image
|
createImage(Component c, int w, int h, GraphicsConfiguration config, Object[] args)
Creates the image to cache.
|
void
|
flush()
Clear the image cache
|
void
|
paint(Component c, Graphics g, int x, int y, int w, int h, Object... args)
Renders the cached image to the the passed in Graphic .
|
void
|
paintImage(Component c, Graphics g, int x, int y, int w, int h, Image image, Object[] args)
Paints the image to the specified location.
|
abstract
void
|
paintToImage(Component c, Image image, Graphics g, int w, int h, Object[] args)
Paints the representation to cache to the supplied Graphics.
|
|
From class
java.lang.Object
Object
|
clone()
Creates and returns a copy of this object.
|
boolean
|
equals(Object obj)
Indicates whether some other object is "equal to" this one.
|
void
|
finalize()
Called by the garbage collector on an object when garbage collection
determines that there are no more references to the object.
|
final
Class<?>
|
getClass()
Returns the runtime class of this Object .
|
int
|
hashCode()
Returns a hash code value for the object.
|
final
void
|
notify()
Wakes up a single thread that is waiting on this object's
monitor.
|
final
void
|
notifyAll()
Wakes up all threads that are waiting on this object's monitor.
|
String
|
toString()
Returns a string representation of the object.
|
final
void
|
wait()
Causes the current thread to wait until another thread invokes the
notify() method or the
notifyAll() method for this object.
|
final
void
|
wait(long timeout, int nanos)
Causes the current thread to wait until another thread invokes the
notify() method or the
notifyAll() method for this object, or
some other thread interrupts the current thread, or a certain
amount of real time has elapsed.
|
final
void
|
wait(long timeout)
Causes the current thread to wait until either another thread invokes the
notify() method or the
notifyAll() method for this object, or a
specified amount of time has elapsed.
|
|
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
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.
Returns
- true if
image
is non-null and has a positive
size.
Protected Methods
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
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
|