@JavaBean public class RectanglePainter extends AbstractAreaPainter<Object>
AbstractAreaPainter.Style
AbstractLayoutPainter.HorizontalAlignment, AbstractLayoutPainter.VerticalAlignment
AbstractPainter.Interpolation
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.
|
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
|
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, isDirty, isVisible, paint, setAntialiasing, setCacheable, setDirty, setFilters, setInterpolation, setVisible, shouldUseCache, validate
addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, addVetoableChangeListener, clone, fireIndexedPropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, fireVetoableChange, getPropertyChangeListeners, getPropertyChangeListeners, getVetoableChangeListeners, getVetoableChangeListeners, hasPropertyChangeListeners, hasVetoableChangeListeners, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, removeVetoableChangeListener
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(Paint fillPaint, Paint borderPaint, float borderWidth, AbstractAreaPainter.Style style)
public RectanglePainter(int width, int height, int cornerRadius, Paint fillPaint)
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 paintprotected 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 paintCopyright © 2020. All rights reserved.