|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jdesktop.beans.AbstractBean
org.jdesktop.swingx.painter.AbstractPainter<T>
org.jdesktop.swingx.painter.AbstractLayoutPainter<T>
org.jdesktop.swingx.painter.AbstractAreaPainter<T>
public abstract class AbstractAreaPainter<T>
The abstract base class for all painters that fill a vector path area. This includes Shapes, Rectangles, Text, and the MattePainter which fills in the entire background of a component. The defining feature of AbstractAreaPainter subclasses is that they implement the provideShape() method which returns the outline shape of the area that this painter will fill. Subclasses must implement the provideShape() method. The AbstractAreaPainter provides support for the following common painting properties
Nested Class Summary | |
---|---|
static class |
AbstractAreaPainter.Style
Different available fill styles. |
Nested classes/interfaces inherited from class org.jdesktop.swingx.painter.AbstractLayoutPainter |
---|
AbstractLayoutPainter.HorizontalAlignment, AbstractLayoutPainter.VerticalAlignment |
Nested classes/interfaces inherited from class org.jdesktop.swingx.painter.AbstractPainter |
---|
AbstractPainter.Interpolation |
Constructor Summary | |
---|---|
AbstractAreaPainter()
Creates a new instance of AbstractAreaPainter |
|
AbstractAreaPainter(Paint paint)
Creates a new instance of AbstractAreaPainter |
Method Summary | |
---|---|
AreaEffect[] |
getAreaEffects()
Gets the current set of path effects applied to this painter. |
Paint |
getBorderPaint()
Gets the current Paint to use for stroking the shape (painting the outline). |
float |
getBorderWidth()
Gets the current border width. |
Paint |
getFillPaint()
Gets the current fill paint. |
AbstractAreaPainter.Style |
getStyle()
Gets the current Style. |
boolean |
isPaintStretched()
Indicates if the paint will be snapped. |
protected abstract Shape |
provideShape(Graphics2D g,
T comp,
int width,
int height)
Returns the outline shape of this painter. |
void |
setAreaEffects(AreaEffect... areaEffects)
Sets the path effects to be drawn on this painter. |
void |
setBorderPaint(Paint p)
The Paint to use for stroking the shape (painting the outline). |
void |
setBorderWidth(float s)
Sets the border width to use for painting. |
void |
setFillPaint(Paint p)
Sets the Paint to use. |
void |
setPaintStretched(boolean paintStretched)
Specifies whether this Painter should attempt to resize the Paint to fit the area being painted. |
void |
setStyle(AbstractAreaPainter.Style s)
The shape can be filled or simply stroked (outlined), or both or none. |
Methods inherited from class org.jdesktop.swingx.painter.AbstractLayoutPainter |
---|
calculateLayout, getHorizontalAlignment, getInsets, getVerticalAlignment, isFillHorizontal, isFillVertical, setFillHorizontal, setFillVertical, setHorizontalAlignment, setInsets, setVerticalAlignment |
Methods inherited from class org.jdesktop.swingx.painter.AbstractPainter |
---|
clearCache, configureGraphics, doPaint, getFilters, getInterpolation, isAntialiasing, isCacheable, isDirty, isVisible, paint, setAntialiasing, setCacheable, setDirty, setFilters, setInterpolation, setVisible, shouldUseCache, validate |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AbstractAreaPainter()
public AbstractAreaPainter(Paint paint)
paint
- the default paint to fill this area painter withMethod Detail |
---|
public Paint getFillPaint()
public void setFillPaint(Paint p)
p
- the Paint to usepublic boolean isPaintStretched()
public void setPaintStretched(boolean paintStretched)
paintStretched
- true if the paint should be stretched, false otherwise.public void setBorderPaint(Paint p)
p
- the Paint to use for stroking the shape. May be null.public Paint getBorderPaint()
public void setStyle(AbstractAreaPainter.Style s)
s
- the Style to use. If null, Style.BOTH is usedpublic AbstractAreaPainter.Style getStyle()
public void setBorderWidth(float s)
s
- the Stroke to fillPaint withpublic float getBorderWidth()
protected abstract Shape provideShape(Graphics2D g, T comp, int width, int height)
g
- graphicscomp
- The Object this painter will be painted on.width
- the width to paintheight
- the height to paint
public void setAreaEffects(AreaEffect... areaEffects)
areaEffects
- the effects to apply to this painterpublic AreaEffect[] getAreaEffects()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |