public class RectanglePainter<T> extends AbstractAreaPainter<T>
AbstractAreaPainter.Style
AbstractLayoutPainter.HorizontalAlignment, AbstractLayoutPainter.VerticalAlignment
AbstractPainter.Interpolation
Constructor and Description |
---|
RectanglePainter()
Creates a new instance of RectanglePainter
|
RectanglePainter(java.awt.Color fillPaint,
java.awt.Color borderPaint) |
RectanglePainter(java.awt.Insets insets,
int width,
int height,
int roundWidth,
int roundHeight,
boolean rounded,
java.awt.Paint fillPaint,
float strokeWidth,
java.awt.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,
java.awt.Paint fillPaint,
float strokeWidth,
java.awt.Paint borderPaint) |
RectanglePainter(int width,
int height,
int cornerRadius,
java.awt.Paint fillPaint) |
RectanglePainter(java.awt.Paint fillPaint,
java.awt.Paint borderPaint,
float borderWidth,
AbstractAreaPainter.Style style) |
Modifier and Type | Method and Description |
---|---|
protected java.awt.geom.RectangularShape |
calculateShape(int width,
int height) |
protected void |
doPaint(java.awt.Graphics2D g,
T 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
|
java.awt.Shape |
provideShape(java.awt.Graphics2D g,
T 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(java.awt.Color fillPaint, java.awt.Color borderPaint)
public RectanglePainter(java.awt.Paint fillPaint, java.awt.Paint borderPaint, float borderWidth, AbstractAreaPainter.Style style)
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 width, int height, int cornerRadius, java.awt.Paint fillPaint)
public RectanglePainter(java.awt.Insets insets, int width, int height, int roundWidth, int roundHeight, boolean rounded, java.awt.Paint fillPaint, float strokeWidth, java.awt.Paint borderPaint)
public RectanglePainter(int top, int left, int bottom, int right, int roundWidth, int roundHeight, boolean rounded, java.awt.Paint fillPaint, float strokeWidth, java.awt.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 java.awt.geom.RectangularShape calculateShape(int width, int height)
protected void doPaint(java.awt.Graphics2D g, T component, int width, int height)
AbstractPainter
doPaint
in class AbstractPainter<T>
g
- The Graphics2D object in which to paintpublic java.awt.Shape provideShape(java.awt.Graphics2D g, T comp, int width, int height)
AbstractAreaPainter
provideShape
in class AbstractAreaPainter<T>
g
- graphicscomp
- The Object this painter will be painted on.width
- the width to paintheight
- the height to paint