| Constructor and Description |
|---|
LinearGradientPainter(java.awt.Color startColor,
java.awt.Color endColor,
int direction)
Constructs a LinearGradientPainter.
|
LinearGradientPainter(float[] fractions,
java.awt.Color[] colors,
int direction)
Constructs a LinearGradientPainter.
|
| Modifier and Type | Method and Description |
|---|---|
void |
draw(java.awt.Graphics2D g2,
java.awt.Shape shape) |
void |
paint(java.awt.Graphics2D g2,
java.awt.Shape shape) |
void |
paint(java.awt.Graphics g,
int x,
int y,
int w,
int h)
Paint.
|
public LinearGradientPainter(java.awt.Color startColor,
java.awt.Color endColor,
int direction)
startColor - the start color.endColor - the end color.direction - the direction. Must be SwingConstants.HORIZONTAL
or SwingConstants.VERTICAL.public LinearGradientPainter(float[] fractions,
java.awt.Color[] colors,
int direction)
fractions - stop locations of the painter (see LinearGradientPaint).colors - stops of the painter (see LinearGradientPaint).direction - the direction. Must be SwingConstants.HORIZONTAL
or SwingConstants.VERTICAL.public void paint(java.awt.Graphics g,
int x,
int y,
int w,
int h)
Painterpaint in interface Painterg - the graphics context in which to paint.x - the x-coordinate within the graphics context at which to paint.y - the y-coordinate within the graphics context at which to paint.w - the width of the area to paint.h - the height of the area to paint.public void paint(java.awt.Graphics2D g2,
java.awt.Shape shape)
public void draw(java.awt.Graphics2D g2,
java.awt.Shape shape)