public abstract class AbstractComponentPainter extends java.lang.Object implements ComponentPainter, java.io.Serializable
ComponentPainter
's. Default implementations for both paint methods are provided,
but becuase they call each other a sub class must override one or both methods.Modifier | Constructor and Description |
---|---|
protected |
AbstractComponentPainter() |
Modifier and Type | Method and Description |
---|---|
boolean |
isOpaque(java.awt.Component component)
Returns true if this painter paints the entire area with an opaque color.
|
void |
paint(java.awt.Component component,
java.awt.Graphics g,
int x,
int y,
int width,
int height)
Paints an area of a component.
|
void |
paint(java.awt.Component component,
java.awt.Graphics g,
int x,
int y,
int width,
int height,
Direction direction,
boolean horizontalFlip,
boolean verticalFlip)
Paints an area in a specific direction and optinally flipped horizontally and/or vertically.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getColor
public void paint(java.awt.Component component, java.awt.Graphics g, int x, int y, int width, int height)
ComponentPainter
paint
in interface ComponentPainter
component
- the component to paint ong
- the graphics to paint onx
- the x-coordinatey
- the y-coordinatewidth
- the widthheight
- the heightpublic void paint(java.awt.Component component, java.awt.Graphics g, int x, int y, int width, int height, Direction direction, boolean horizontalFlip, boolean verticalFlip)
ComponentPainter
paint
in interface ComponentPainter
component
- the component to paint ong
- the graphics to paint onx
- the x-coordinatey
- the y-coordinatewidth
- the widthheight
- the heightdirection
- the direction, Direction.RIGHT is the normal directionhorizontalFlip
- flip the painted graphics horizontallyverticalFlip
- flip the painted graphics verticallypublic boolean isOpaque(java.awt.Component component)
ComponentPainter
isOpaque
in interface ComponentPainter
component
- the component to paint on