public abstract class MultipleGradientPaint
extends java.lang.Object
implements java.awt.Paint
Modifier and Type | Class and Description |
---|---|
static class |
MultipleGradientPaint.ColorSpaceEnum
Inner class to allow for typesafe enumerated ColorSpace values.
|
static class |
MultipleGradientPaint.CycleMethodEnum
Inner class to allow for typesafe enumerated CycleMethod values.
|
Modifier and Type | Field and Description |
---|---|
protected java.awt.Color[] |
colors
Gradient colors.
|
protected MultipleGradientPaint.ColorSpaceEnum |
colorSpace
The colorSpace in which to perform the interpolation.
|
protected MultipleGradientPaint.CycleMethodEnum |
cycleMethod
The method to use when painting out of the gradient bounds.
|
protected float[] |
fractions
Gradient keyframe values in the range 0 to 1.
|
protected java.awt.geom.AffineTransform |
gradientTransform
Transform to apply to gradient.
|
static MultipleGradientPaint.ColorSpaceEnum |
LINEAR_RGB
Indicates that the color interpolation should occur in linearized
RGB space.
|
static MultipleGradientPaint.CycleMethodEnum |
NO_CYCLE
Indicates (if the gradient starts or ends inside the target region)
to use the terminal colors to fill the remaining area.
|
static MultipleGradientPaint.CycleMethodEnum |
REFLECT
Indicates (if the gradient starts or ends inside the target region),
to cycle the gradient colors start-to-end, end-to-start to fill the
remaining area.
|
static MultipleGradientPaint.CycleMethodEnum |
REPEAT
Indicates (if the gradient starts or ends inside the target region),
to cycle the gradient colors start-to-end, start-to-end to fill the
remaining area.
|
static MultipleGradientPaint.ColorSpaceEnum |
SRGB
Indicates that the color interpolation should occur in sRGB space.
|
protected int |
transparency
Transparency.
|
Constructor and Description |
---|
MultipleGradientPaint(float[] fractions,
java.awt.Color[] colors,
MultipleGradientPaint.CycleMethodEnum cycleMethod,
MultipleGradientPaint.ColorSpaceEnum colorSpace,
java.awt.geom.AffineTransform gradientTransform)
Superclass constructor, typical user should never have to call this.
|
Modifier and Type | Method and Description |
---|---|
java.awt.Color[] |
getColors()
Returns a copy of the array of colors used by this gradient.
|
MultipleGradientPaint.ColorSpaceEnum |
getColorSpace()
Returns the enumerated type which specifies color space for
interpolation.
|
MultipleGradientPaint.CycleMethodEnum |
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 LinearGradientPaint.
|
protected int transparency
protected float[] fractions
protected java.awt.Color[] colors
protected java.awt.geom.AffineTransform gradientTransform
protected MultipleGradientPaint.CycleMethodEnum cycleMethod
protected MultipleGradientPaint.ColorSpaceEnum colorSpace
public static final MultipleGradientPaint.CycleMethodEnum NO_CYCLE
public static final MultipleGradientPaint.CycleMethodEnum REFLECT
public static final MultipleGradientPaint.CycleMethodEnum REPEAT
public static final MultipleGradientPaint.ColorSpaceEnum SRGB
public static final MultipleGradientPaint.ColorSpaceEnum LINEAR_RGB
public MultipleGradientPaint(float[] fractions, java.awt.Color[] colors, MultipleGradientPaint.CycleMethodEnum cycleMethod, MultipleGradientPaint.ColorSpaceEnum 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 colorspace to use for interpolation,
either SRGB or LINEAR_RGBgradientTransform
- transform to apply to the gradientjava.lang.NullPointerException
- if arrays are null, or
gradientTransform is nulljava.lang.IllegalArgumentException
- if fractions.length != colors.length,
or if colors is less than 2 in size, or if an enumerated value is bad.public java.awt.Color[] getColors()
public float[] getFractions()
public int getTransparency()
getTransparency
in interface java.awt.Transparency
public MultipleGradientPaint.CycleMethodEnum getCycleMethod()
public MultipleGradientPaint.ColorSpaceEnum getColorSpace()
public java.awt.geom.AffineTransform getTransform()
Copyright © 2022 Apache Software Foundation. All Rights Reserved.