public class RectanglePainter extends AbstractAreaPainter<Object>
AbstractAreaPainter.Style
AbstractLayoutPainter.HorizontalAlignment, AbstractLayoutPainter.VerticalAlignment
AbstractPainter.Interpolation
Modifier and Type | Field and Description |
---|---|
private int |
height |
private boolean |
rounded |
private int |
roundHeight |
private int |
roundWidth |
private int |
width |
Constructor and Description |
---|
RectanglePainter()
Creates a new instance of RectanglePainter
|
RectanglePainter(Color fillPaint,
Color borderPaint) |
RectanglePainter(Insets insets,
int width,
int height,
int roundWidth,
int roundHeight,
boolean rounded,
Paint fillPaint,
float strokeWidth,
Paint borderPaint) |
RectanglePainter(int top,
int left,
int bottom,
int right) |
RectanglePainter(int top,
int left,
int bottom,
int right,
int roundWidth,
int roundHeight) |
RectanglePainter(int top,
int left,
int bottom,
int right,
int roundWidth,
int roundHeight,
boolean rounded,
Paint fillPaint,
float strokeWidth,
Paint borderPaint) |
RectanglePainter(int width,
int height,
int cornerRadius,
Paint fillPaint) |
RectanglePainter(Paint fillPaint,
Paint borderPaint,
float borderWidth,
AbstractAreaPainter.Style style) |
Modifier and Type | Method and Description |
---|---|
protected RectangularShape |
calculateShape(int width,
int height) |
protected void |
doPaint(Graphics2D g,
Object component,
int width,
int height)
Subclasses must implement this method and perform custom painting operations
here.
|
private void |
drawBackground(Graphics2D g,
Shape shape,
int width,
int height) |
private void |
drawBorder(Graphics2D g,
Shape shape,
int width,
int height) |
int |
getRoundHeight()
gets the round height of the rectangle
|
int |
getRoundWidth()
gets the round width of the rectangle
|
boolean |
isRounded()
Indicates if the rectangle is rounded
|
protected Shape |
provideShape(Graphics2D g,
Object comp,
int width,
int height)
Returns the outline shape of this painter.
|
void |
setRounded(boolean rounded)
sets if the rectangle should be rounded
|
void |
setRoundHeight(int roundHeight)
sets the round height of the rectangle
|
void |
setRoundWidth(int roundWidth)
sets the round width of the rectangle
|
calculateSnappedPaint, getAreaEffects, getBorderPaint, getBorderWidth, getFillPaint, getStyle, isPaintStretched, setAreaEffects, setBorderPaint, setBorderWidth, setFillPaint, setPaintStretched, setStyle
calculateLayout, getHorizontalAlignment, getInsets, getVerticalAlignment, isFillHorizontal, isFillVertical, setFillHorizontal, setFillVertical, setHorizontalAlignment, setInsets, setVerticalAlignment
clearCache, configureGraphics, 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 rounded
private int roundWidth
private int roundHeight
private int width
private int height
public RectanglePainter()
public RectanglePainter(int top, int left, int bottom, int right)
public RectanglePainter(int top, int left, int bottom, int right, int roundWidth, int roundHeight)
public RectanglePainter(int top, int left, int bottom, int right, int roundWidth, int roundHeight, boolean rounded, Paint fillPaint, float strokeWidth, Paint borderPaint)
public RectanglePainter(Color fillPaint, Color borderPaint)
public RectanglePainter(Paint fillPaint, Paint borderPaint, float borderWidth, AbstractAreaPainter.Style style)
public RectanglePainter(int width, int height, int cornerRadius, Paint fillPaint)
public RectanglePainter(Insets insets, int width, int height, int roundWidth, int roundHeight, boolean rounded, Paint fillPaint, float strokeWidth, Paint borderPaint)
public boolean isRounded()
public void setRounded(boolean rounded)
rounded
- if the rectangle should be roundedpublic int getRoundWidth()
public void setRoundWidth(int roundWidth)
roundWidth
- a new round widthpublic int getRoundHeight()
public void setRoundHeight(int roundHeight)
roundHeight
- a new round heightprotected RectangularShape calculateShape(int width, int height)
protected void doPaint(Graphics2D g, Object component, int width, int height)
AbstractPainter
doPaint
in class AbstractPainter<Object>
g
- The Graphics2D object in which to paintprivate void drawBorder(Graphics2D g, Shape shape, int width, int height)
private void drawBackground(Graphics2D g, Shape shape, int width, int height)
protected Shape provideShape(Graphics2D g, Object comp, int width, int height)
AbstractAreaPainter
provideShape
in class AbstractAreaPainter<Object>
g
- graphicscomp
- The Object this painter will be painted on.width
- the width to paintheight
- the height to paintWebARTS Library Licensed Under the GNU - General Public License. Other Libraries licensed under their respective Open Source Licenses