|
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.LinearGradientPainter
public class LinearGradientPainter
A Gradient based painter used for painting "multi-stop" 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 startPoint and endPoint of the LinearGradientPainter 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".
NOTE: LinearGradientPainter 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
Field Summary | |
---|---|
static org.apache.batik.ext.awt.LinearGradientPaint |
BLACK_PERSPECTIVE
|
static org.apache.batik.ext.awt.LinearGradientPaint |
BLACK_STAR
|
static org.apache.batik.ext.awt.LinearGradientPaint |
ORANGE_DELIGHT
|
Constructor Summary | |
---|---|
LinearGradientPainter()
Creates a new instance of LinearGradientPainter |
|
LinearGradientPainter(org.apache.batik.ext.awt.LinearGradientPaint paint)
Creates a new instance of LinearGradientPainter with the given LinearGradientPaint as input |
Method Summary | |
---|---|
protected Paint |
calculateSizedPaint(int width,
int height)
|
org.apache.batik.ext.awt.LinearGradientPaint |
getGradientPaint()
|
void |
setGradientPaint(org.apache.batik.ext.awt.LinearGradientPaint paint)
Set the gradient paint to use. |
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 |
Field Detail |
---|
public static final org.apache.batik.ext.awt.LinearGradientPaint ORANGE_DELIGHT
public static final org.apache.batik.ext.awt.LinearGradientPaint BLACK_STAR
public static final org.apache.batik.ext.awt.LinearGradientPaint BLACK_PERSPECTIVE
Constructor Detail |
---|
public LinearGradientPainter()
public LinearGradientPainter(org.apache.batik.ext.awt.LinearGradientPaint paint)
paint
- the Paint to useMethod Detail |
---|
public void setGradientPaint(org.apache.batik.ext.awt.LinearGradientPaint paint)
paint
- the LinearGradientPaint to usepublic org.apache.batik.ext.awt.LinearGradientPaint getGradientPaint()
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 |