|
swingx Version 2005-08-19 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jdesktop.swingx.JavaBean
org.jdesktop.swingx.painter.AbstractPainter
org.jdesktop.swingx.painter.gradient.AbstractGradientPainter
org.jdesktop.swingx.painter.gradient.RadialGradientPainter
public class RadialGradientPainter
A Gradient based painter used for painting "multi-stop" radial gradients. These are gradients that imploys more than 2 colors, where each color is defined along with a float value between 0 and 1 indicating at what point along the gradient the new color is used.
As with BasicGradienPainter and mentioned in AbstractGradientPainter, the values given to the centerPoint, radius, and focusPoint of the RadialGradientPainter are crucial. They represent what distance from the origin the gradient should begin and end at, depending on the size of the component. That is, they must be specified as values between 0 and 1, where 0 means "all the way on the left/top" and 1 means "all the way on the right/bottom".
In addition, the resize behavior of the radius is specified in the resizeRadius property. If HORIZONTAL, then the width of the component is used to calculate the new radius. If VERTICAL then the height of the component is used. If BOTH, then the Math.min(width, height) is used. If NONE, then no resize occurs for the radius.
NOTE: RadialGradientPainter relies on LinearGradientPaint, which is included in the optional jar MultipleGradientPaint.jar. Be sure to have this jar on your classpath if you use this class
Constructor Summary | |
---|---|
RadialGradientPainter()
Creates a new instance of RadialGradientPainter |
|
RadialGradientPainter(org.apache.batik.ext.awt.RadialGradientPaint paint)
Creates a new instance of RadialGradientPainter with the given RadialGradientPaint |
Method Summary | |
---|---|
protected Paint |
calculateSizedPaint(int width,
int height)
|
org.apache.batik.ext.awt.RadialGradientPaint |
getGradientPaint()
|
Resize |
getResizeRadius()
|
void |
setGradientPaint(org.apache.batik.ext.awt.RadialGradientPaint paint)
Set the gradient paint to use. |
void |
setResizeRadius(Resize r)
Specifies the resize behavior for the radius of the RadialGradientPaint. |
Methods inherited from class org.jdesktop.swingx.painter.gradient.AbstractGradientPainter |
---|
getResize, isResizeHorizontal, isResizeVertical, paintBackground, setResize |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public RadialGradientPainter()
public RadialGradientPainter(org.apache.batik.ext.awt.RadialGradientPaint paint)
paint
- the RadialGradientPaint to useMethod Detail |
---|
public void setGradientPaint(org.apache.batik.ext.awt.RadialGradientPaint paint)
paint
- the RadialGradientPaint to usepublic org.apache.batik.ext.awt.RadialGradientPaint getGradientPaint()
public void setResizeRadius(Resize r)
r
- the Resize behavior for the radiuspublic Resize getResizeRadius()
protected Paint calculateSizedPaint(int width, int height)
calculateSizedPaint
in class AbstractGradientPainter
width
- the width used to calculate the new paint sizeheight
- the height used to calculate the new paint size
|
swingx Version 2005-08-19 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |