Home » openjdk-7 » java » awt » [javadoc | source]
abstract public class: MultipleGradientPaint [javadoc | source]

All Implemented Interfaces:

Direct Known Subclasses:
    RadialGradientPaint, LinearGradientPaint

This is the superclass for Paints which use a multiple color gradient to fill in their raster. It provides storage for variables and enumerated values common to {@code LinearGradientPaint} and {@code RadialGradientPaint}.
Nested Class Summary:
public static enum class  MultipleGradientPaint.CycleMethod  The method to use when painting outside the gradient bounds. 
public static enum class  MultipleGradientPaint.ColorSpaceType  The color space in which to perform the gradient interpolation. 
Field Summary
final  int transparency    The transparency of this paint object. 
final  float[] fractions    Gradient keyframe values in the range 0 to 1. 
final  Color[] colors    Gradient colors. 
final  AffineTransform gradientTransform    Transform to apply to gradient. 
final  CycleMethod cycleMethod    The method to use when painting outside the gradient bounds. 
final  ColorSpaceType colorSpace    The color space in which to perform the gradient interpolation. 
 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. 
 float[] normalizedIntervals     
 boolean isSimpleLookup     
 SoftReference<int> gradients     
 SoftReference<int> gradient     
 int fastGradientArraySize     
 MultipleGradientPaint(float[] fractions,
    Color[] colors,
    CycleMethod cycleMethod,
    ColorSpaceType colorSpace,
    AffineTransform gradientTransform) 
    Package-private constructor.
    fractions - numbers ranging from 0.0 to 1.0 specifying the distribution of colors along the gradient
    colors - array of colors corresponding to each fractional value
    cycleMethod - either {@code NO_CYCLE}, {@code REFLECT}, or {@code REPEAT}
    colorSpace - which color space to use for interpolation, either {@code SRGB} or {@code LINEAR_RGB}
    gradientTransform - transform to apply to the gradient
    NullPointerException - if {@code fractions} array is null, or {@code colors} array is null, or {@code gradientTransform} is null, or {@code cycleMethod} is null, or {@code colorSpace} is null
    IllegalArgumentException - if {@code fractions.length != colors.length}, or {@code colors} is less than 2 in size, or a {@code fractions} value is less than 0.0 or greater than 1.0, or the {@code fractions} are not provided in strictly increasing order
Method from java.awt.MultipleGradientPaint Summary:
getColorSpace,   getColors,   getCycleMethod,   getFractions,   getTransform,   getTransparency
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from java.awt.MultipleGradientPaint Detail:
 public final ColorSpaceType getColorSpace() 
    Returns the enumerated type which specifies color space for interpolation.
 public final Color[] getColors() 
    Returns a copy of the array of colors used by this gradient. The first color maps to the first value in the fractions array, and the last color maps to the last value in the fractions array.
 public final CycleMethod getCycleMethod() 
    Returns the enumerated type which specifies cycling behavior.
 public final float[] getFractions() 
    Returns a copy of the array of floats used by this gradient to calculate color distribution. The returned array always has 0 as its first value and 1 as its last value, with increasing values in between.
 public final AffineTransform getTransform() 
    Returns a copy of the transform applied to the gradient.

    Note that if no transform is applied to the gradient when it is created, the identity transform is used.

 public final int getTransparency() 
    Returns the transparency mode for this {@code Paint} object.