public abstract class MultipleGradientPaint
extends java.lang.Object
implements java.awt.Paint
LinearGradientPaint and RadialGradientPaint.| Modifier and Type | Class and Description |
|---|---|
static class |
MultipleGradientPaint.ColorSpaceType
The color space in which to perform the gradient interpolation.
|
static class |
MultipleGradientPaint.CycleMethod
The method to use when painting outside the gradient bounds.
|
| Modifier and Type | Field and Description |
|---|---|
(package private) java.awt.Color[] |
colors
Gradient colors.
|
(package private) MultipleGradientPaint.ColorSpaceType |
colorSpace
The color space in which to perform the gradient interpolation.
|
(package private) MultipleGradientPaint.CycleMethod |
cycleMethod
The method to use when painting outside the gradient bounds.
|
(package private) int |
fastGradientArraySize |
(package private) float[] |
fractions
Gradient keyframe values in the range 0 to 1.
|
(package private) java.lang.ref.SoftReference<int[]> |
gradient |
(package private) java.lang.ref.SoftReference<int[][]> |
gradients |
(package private) java.awt.geom.AffineTransform |
gradientTransform
Transform to apply to gradient.
|
(package private) boolean |
isSimpleLookup |
(package private) java.awt.image.ColorModel |
model
The following fields are used only by MultipleGradientPaintContext
to cache certain values that remain constant and do not need to be
recalculated for each context created from this paint instance.
|
(package private) float[] |
normalizedIntervals |
(package private) int |
transparency
The transparency of this paint object.
|
| Constructor and Description |
|---|
MultipleGradientPaint(float[] fractions,
java.awt.Color[] colors,
MultipleGradientPaint.CycleMethod cycleMethod,
MultipleGradientPaint.ColorSpaceType colorSpace,
java.awt.geom.AffineTransform gradientTransform)
Package-private constructor.
|
| Modifier and Type | Method and Description |
|---|---|
java.awt.Color[] |
getColors()
Returns a copy of the array of colors used by this gradient.
|
MultipleGradientPaint.ColorSpaceType |
getColorSpace()
Returns the enumerated type which specifies color space for
interpolation.
|
MultipleGradientPaint.CycleMethod |
getCycleMethod()
Returns the enumerated type which specifies cycling behavior.
|
float[] |
getFractions()
Returns a copy of the array of floats used by this gradient
to calculate color distribution.
|
java.awt.geom.AffineTransform |
getTransform()
Returns a copy of the transform applied to the gradient.
|
int |
getTransparency()
Returns the transparency mode for this Paint object.
|
final int transparency
final float[] fractions
final java.awt.Color[] colors
final java.awt.geom.AffineTransform gradientTransform
final MultipleGradientPaint.CycleMethod cycleMethod
final MultipleGradientPaint.ColorSpaceType colorSpace
java.awt.image.ColorModel model
float[] normalizedIntervals
boolean isSimpleLookup
java.lang.ref.SoftReference<int[][]> gradients
java.lang.ref.SoftReference<int[]> gradient
int fastGradientArraySize
MultipleGradientPaint(float[] fractions,
java.awt.Color[] colors,
MultipleGradientPaint.CycleMethod cycleMethod,
MultipleGradientPaint.ColorSpaceType colorSpace,
java.awt.geom.AffineTransform gradientTransform)
fractions - numbers ranging from 0.0 to 1.0 specifying the
distribution of colors along the gradientcolors - array of colors corresponding to each fractional valuecycleMethod - either NO_CYCLE, REFLECT,
or REPEATcolorSpace - which color space to use for interpolation,
either SRGB or LINEAR_RGBgradientTransform - transform to apply to the gradientjava.lang.NullPointerException - if fractions array is null,
or colors array is null,
or gradientTransform is null,
or cycleMethod is null,
or colorSpace is nulljava.lang.IllegalArgumentException - if fractions.length != colors.length,
or colors is less than 2 in size,
or a fractions value is less than 0.0 or greater than 1.0,
or the fractions are not provided in strictly increasing orderpublic final float[] getFractions()
public final java.awt.Color[] getColors()
public final MultipleGradientPaint.CycleMethod getCycleMethod()
public final MultipleGradientPaint.ColorSpaceType getColorSpace()
public final java.awt.geom.AffineTransform getTransform()
public final int getTransparency()
getTransparency in interface java.awt.TransparencyTransparency