public interface RegionPainter<T>
RegionPainter
interface defines exactly one method, paint
.
It is used in situations where the developer can change the painting routine
of a component without having to resort to subclassing the component.
It is also generically useful when doing any form of painting delegation.
Painters are simply encapsulations of Java2D code and make it fairly trivial to reuse existing painters or to combine them together. Implementations of this interface are also trivial to write, such that if you can't find a painter that does what you need, you can write one with minimal effort.
Painter
Modifier and Type | Interface and Description |
---|---|
static class |
RegionPainter.Alpha
This class provides a base functionality to paint a region with the specified alpha.
|
static class |
RegionPainter.Image
This class provides a caching functionality for a region painter.
|
Modifier and Type | Method and Description |
---|---|
void |
paint(java.awt.Graphics2D g,
int x,
int y,
int width,
int height,
T object)
Renders to the given
Graphics2D object. |
void paint(java.awt.Graphics2D g, int x, int y, int width, int height, T object)
Graphics2D
object.g
- the Graphics2D
object to render tox
- X position of the area to painty
- Y position of the area to paintwidth
- width of the area to paintheight
- height of the area to paintobject
- an optional configuration parameter