public abstract class AbstractAreaPainter<T> extends AbstractLayoutPainter<T>
Modifier and Type | Class and Description |
---|---|
static class |
AbstractAreaPainter.Style
Different available fill styles.
|
AbstractLayoutPainter.HorizontalAlignment, AbstractLayoutPainter.VerticalAlignment
AbstractPainter.Interpolation
Modifier and Type | Field and Description |
---|---|
private AreaEffect[] |
areaEffects |
private Paint |
borderPaint
The Paint to use when stroking the shape (drawing the outline).
|
private float |
borderWidth
The stroke width to use when painting.
|
private Paint |
fillPaint
The paint to use when filling the shape
|
private boolean |
stretchPaint |
private AbstractAreaPainter.Style |
style |
Constructor and Description |
---|
AbstractAreaPainter()
Creates a new instance of AbstractAreaPainter
|
AbstractAreaPainter(Paint paint)
Creates a new instance of AbstractAreaPainter
|
Modifier and Type | Method and Description |
---|---|
(package private) Paint |
calculateSnappedPaint(Paint p,
int width,
int height)
Resizes the given Paint.
|
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.
|
calculateLayout, getHorizontalAlignment, getInsets, getVerticalAlignment, isFillHorizontal, isFillVertical, setFillHorizontal, setFillVertical, setHorizontalAlignment, setInsets, setVerticalAlignment
clearCache, configureGraphics, doPaint, getFilters, getInterpolation, isAntialiasing, isCacheable, isCacheCleared, isDirty, isInPaintContext, isVisible, paint, setAntialiasing, setCacheable, setDirty, setFilters, setInPaintContext, setInterpolation, setVisible, shouldUseCache, validate
addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, addVetoableChangeListener, clone, fireIndexedPropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, fireVetoableChange, getPropertyChangeListeners, getPropertyChangeListeners, getVetoableChangeListeners, getVetoableChangeListeners, hasPropertyChangeListeners, hasVetoableChangeListeners, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, removeVetoableChangeListener
private boolean stretchPaint
private AreaEffect[] areaEffects
private AbstractAreaPainter.Style style
private float borderWidth
private Paint borderPaint
public AbstractAreaPainter()
public AbstractAreaPainter(Paint paint)
paint
- the default paint to fill this area painter withpublic 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()
Paint calculateSnappedPaint(Paint p, int width, int height)
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 paintpublic void setAreaEffects(AreaEffect... areaEffects)
areaEffects
- the effects to apply to this painterpublic AreaEffect[] getAreaEffects()
WebARTS Library Licensed Under the GNU - General Public License. Other Libraries licensed under their respective Open Source Licenses