|
||||||||||
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<java.lang.Object>
org.jdesktop.swingx.painter.ShapePainter
public class ShapePainter
A Painter that paints java.awt.Shapes. It uses a stroke and a fillPaint to do so. The shape is painted as is, at a specific location. If no Shape is specified, nothing will be painted. If no stroke is specified, the default for the Graphics2D will be used. If no fillPaint is specified, the component background color will be used. The shape can be positioned using the insets, horizontal, and vertical properties.
Here is an example that draws a rectangle aligned on the center right:
Rectangle2D.Double rect = new Rectangle2D.Double(0, 0, 50, 50);
ShapePainter p = new ShapePainter(rect);
p.setHorizontal(HorizontalAlignment.RIGHT);
p.setVertical(VerticalAlignment.CENTER);
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.jdesktop.swingx.painter.AbstractAreaPainter |
---|
AbstractAreaPainter.Style |
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 | |
---|---|
ShapePainter()
Create a new ShapePainter |
|
ShapePainter(java.awt.Shape shape)
Create a new ShapePainter with the specified shape. |
|
ShapePainter(java.awt.Shape shape,
java.awt.Paint paint)
Create a new ShapePainter with the specified shape and fillPaint. |
|
ShapePainter(java.awt.Shape shape,
java.awt.Paint paint,
AbstractAreaPainter.Style style)
Create a new ShapePainter with the specified shape and fillPaint. |
Method Summary | |
---|---|
java.awt.Shape |
getShape()
Gets the current shape |
void |
setShape(java.awt.Shape s)
Sets the shape to fillPaint. |
Methods inherited from class org.jdesktop.swingx.painter.AbstractAreaPainter |
---|
getAreaEffects, getBorderPaint, getBorderWidth, getFillPaint, getStyle, isPaintStretched, setAreaEffects, setBorderPaint, setBorderWidth, setFillPaint, setPaintStretched, setStyle |
Methods inherited from class org.jdesktop.swingx.painter.AbstractLayoutPainter |
---|
getHorizontalAlignment, getInsets, getVerticalAlignment, isFillHorizontal, isFillVertical, setFillHorizontal, setFillVertical, setHorizontalAlignment, setInsets, setVerticalAlignment |
Methods inherited from class org.jdesktop.swingx.painter.AbstractPainter |
---|
clearCache, getFilters, getInterpolation, isAntialiasing, isCacheable, isVisible, paint, setAntialiasing, setCacheable, setFilters, setInterpolation, setVisible |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ShapePainter()
public ShapePainter(java.awt.Shape shape)
shape
- the shape to fillPaintpublic ShapePainter(java.awt.Shape shape, java.awt.Paint paint)
shape
- the shape to fillPaintpaint
- the fillPaint to be used to fillPaint the shapepublic ShapePainter(java.awt.Shape shape, java.awt.Paint paint, AbstractAreaPainter.Style style)
shape
- the shape to fillPaintpaint
- the fillPaint to be used to fillPaint the shapestyle
- specifies the ShapePainter.Style to use for painting this shape.
If null, then Style.BOTH is usedMethod Detail |
---|
public void setShape(java.awt.Shape s)
s
- the Shape to fillPaint. May be nullpublic java.awt.Shape getShape()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |