public class LinearGradientPaint extends MultipleGradientPaint
Shape with a linear gradient.Graphics.setColor(com.codename1.ui.Paint)MultipleGradientPaint.ColorSpaceType, MultipleGradientPaint.CycleMethod| Constructor and Description |
|---|
LinearGradientPaint(double startX,
double startY,
double endX,
double endY,
float[] fractions,
int[] colors,
MultipleGradientPaint.CycleMethod cycleMethod,
MultipleGradientPaint.ColorSpaceType colorSpace,
Transform gradientTransform)
Creates a LinearGradientPaint with the specified settings.
|
LinearGradientPaint(float startX,
float startY,
float endX,
float endY,
float[] fractions,
int[] colors,
MultipleGradientPaint.CycleMethod cycleMethod,
MultipleGradientPaint.ColorSpaceType colorSpace,
Transform gradientTransform)
Creates a LinearGradientPaint with the specified settings.
|
| Modifier and Type | Method and Description |
|---|---|
void |
paint(Graphics g,
double x,
double y,
double w,
double h)
Painds the linear gradient in the given bounds.
|
void |
paint(Graphics g,
Rectangle2D bounds)
Paints linear gradient in the given bounds.
|
getColors, getColorSpace, getCycleMethod, getFractions, getTransform, getTransparency, setColors, setColorSpace, setCycleMethod, setFractions, setTransform, setTransparencypublic LinearGradientPaint(float startX,
float startY,
float endX,
float endY,
float[] fractions,
int[] colors,
MultipleGradientPaint.CycleMethod cycleMethod,
MultipleGradientPaint.ColorSpaceType colorSpace,
Transform gradientTransform)
startX - The startX coordinate of the gradient in user space.startY - The startY coordinate of the gradient in user space.endX - The endX coordinate of the gradient in user space.endY - THe endY coordinate of the gradient in user space.fractions - Fractional positions of where gradient colors begin. Each value should be between 0 and 1.colors - The colors to use in the gradient. There should be the same number of colors as there are fractions.cycleMethod - The cycle method to use.colorSpace - The color space to use.gradientTransform - Transform to use for the gradient. Not used right now.public LinearGradientPaint(double startX,
double startY,
double endX,
double endY,
float[] fractions,
int[] colors,
MultipleGradientPaint.CycleMethod cycleMethod,
MultipleGradientPaint.ColorSpaceType colorSpace,
Transform gradientTransform)
startX - The startX coordinate of the gradient in user space.startY - The startY coordinate of the gradient in user space.endX - The endX coordinate of the gradient in user space.endY - THe endY coordinate of the gradient in user space.fractions - Fractional positions of where gradient colors begin. Each value should be between 0 and 1.colors - The colors to use in the gradient. There should be the same number of colors as there are fractions.cycleMethod - The cycle method to use.colorSpace - The color space to use.gradientTransform - Transform to use for the gradient. Not used right now.public final void paint(Graphics g, Rectangle2D bounds)
g - bounds - public void paint(Graphics g, double x, double y, double w, double h)
g - x - y - w - h -