Home » openjdk-7 » java » awt » [javadoc | source]
java.awt
abstract class: MultipleGradientPaintContext [javadoc | source]
java.lang.Object
   java.awt.MultipleGradientPaintContext

All Implemented Interfaces:
    PaintContext

Direct Known Subclasses:
    RadialGradientPaintContext, LinearGradientPaintContext

This is the superclass for all PaintContexts which use a multiple color gradient to fill in their raster. It provides the actual color interpolation functionality. Subclasses only have to deal with using the gradient to fill pixels in a raster.
Field Summary
protected  ColorModel model    The PaintContext's ColorModel. This is ARGB if colors are not all opaque, otherwise it is RGB. 
protected static  ColorModel cachedModel    The cached ColorModel. 
protected static  WeakReference<Raster> cached    The cached raster, which is reusable among instances. 
protected  Raster saved    Raster is reused whenever possible. 
protected  CycleMethod cycleMethod    The method to use when painting out of the gradient bounds. 
protected  ColorSpaceType colorSpace    The ColorSpace in which to perform the interpolation 
protected  float a00    Elements of the inverse transform matrix. 
protected  float a01     
protected  float a10     
protected  float a11     
protected  float a02     
protected  float a12     
protected  boolean isSimpleLookup    This boolean specifies wether we are in simple lookup mode, where an input value between 0 and 1 may be used to directly index into a single array of gradient colors. If this boolean value is false, then we have to use a 2-step process where we have to determine which gradient array we fall into, then determine the index into that array. 
protected  int fastGradientArraySize    Size of gradients array for scaling the 0-1 index when looking up colors the fast way. 
protected  int[] gradient    Array which contains the interpolated color values for each interval, used by calculateSingleArrayGradient(). It is protected for possible direct access by subclasses. 
protected static final  int GRADIENT_SIZE    Constant number of max colors between any 2 arbitrary colors. Used for creating and indexing gradients arrays. 
protected static final  int GRADIENT_SIZE_INDEX     
Constructor:
 protected MultipleGradientPaintContext(MultipleGradientPaint mgp,
    ColorModel cm,
    Rectangle deviceBounds,
    Rectangle2D userBounds,
    AffineTransform t,
    RenderingHints hints,
    float[] fractions,
    Color[] colors,
    CycleMethod cycleMethod,
    ColorSpaceType colorSpace) 
    Constructor for MultipleGradientPaintContext superclass.
Method from java.awt.MultipleGradientPaintContext Summary:
dispose,   fillRaster,   getColorModel,   getRaster,   indexIntoGradientsArrays
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from java.awt.MultipleGradientPaintContext Detail:
 public final  void dispose() 
    {@inheritDoc}
 abstract protected  void fillRaster(int[] pixels,
    int off,
    int adjust,
    int x,
    int y,
    int w,
    int h)
 public final ColorModel getColorModel() 
    {@inheritDoc}
 public final Raster getRaster(int x,
    int y,
    int w,
    int h) 
    {@inheritDoc}
 protected final int indexIntoGradientsArrays(float position) 
    Helper function to index into the gradients array. This is necessary because each interval has an array of colors with uniform size 255. However, the color intervals are not necessarily of uniform length, so a conversion is required.