APIdia Launch Partner
Top Description Fields Constructors Methods
java.awt

pack-priv final Class LinearGradientPaintContext

extends MultipleGradientPaintContext
Class Inheritance
Imports
java.awt.MultipleGradientPaint.CycleMethod, .MultipleGradientPaint.ColorSpaceType, java.awt.geom.AffineTransform, .Point2D, .Rectangle2D, java.awt.image.ColorModel

Provides the actual implementation for the LinearGradientPaint. This is where the pixel processing is done.
Author
Nicholas Talian, Vincent Hardy, Jim Graham, Jerry Evans
See Also
java.awt.LinearGradientPaint, java.awt.PaintContext, java.awt.Paint

Field Summary

Modifier and TypeField and Description
private float
dgdX

The following invariants are used to process the gradient value from a device space coordinate, (X, Y): g(X, Y) = dgdX*X + dgdY*Y + gc

private float
dgdY

The following invariants are used to process the gradient value from a device space coordinate, (X, Y): g(X, Y) = dgdX*X + dgdY*Y + gc

private float
gc

The following invariants are used to process the gradient value from a device space coordinate, (X, Y): g(X, Y) = dgdX*X + dgdY*Y + gc

Inherited from java.awt.MultipleGradientPaintContext:
a00a01a02a10a11a12cachedcachedModelcolorSpacecycleMethodfastGradientArraySizegradientGRADIENT_SIZEGRADIENT_SIZE_INDEXisSimpleLookupmodelsaved

Constructor Summary

AccessConstructor and Description
pack-priv
LinearGradientPaintContext(LinearGradientPaint
the LinearGradientPaint from which this context is created
paint
,
ColorModel
ColorModel that receives the Paint data. This is used only as a hint.
cm
,
Rectangle
the device space bounding box of the graphics primitive being rendered
deviceBounds
,
Rectangle2D
the user space bounding box of the graphics primitive being rendered
userBounds
,
AffineTransform
the AffineTransform from user space into device space (gradientTransform should be concatenated with this)
t
,
RenderingHints
the hints that the context object uses to choose between rendering alternatives
hints
,
Point2D
gradient start point, in user space
start
,
Point2D
gradient end point, in user space
end
,
float[]
the fractions specifying the gradient distribution
fractions
,
Color[]
the gradient colors
colors
,
MultipleGradientPaint.CycleMethod
either NO_CYCLE, REFLECT, or REPEAT
cycleMethod
,
MultipleGradientPaint.ColorSpaceType
which colorspace to use for interpolation, either SRGB or LINEAR_RGB
colorSpace
)

Constructor for LinearGradientPaintContext.

Method Summary

Modifier and TypeMethod and Description
protected void
fillRaster(int[] pixels, int off, int adjust, int x, int y, int w, int h)

Implements abstract java.awt.MultipleGradientPaintContext.fillRaster.

Return a Raster containing the colors generated for the graphics operation.

Inherited from java.awt.MultipleGradientPaintContext:
disposegetColorModelgetRasterindexIntoGradientsArrays

Field Detail

dgdXback to summary
private float dgdX

The following invariants are used to process the gradient value from a device space coordinate, (X, Y): g(X, Y) = dgdX*X + dgdY*Y + gc

dgdYback to summary
private float dgdY

The following invariants are used to process the gradient value from a device space coordinate, (X, Y): g(X, Y) = dgdX*X + dgdY*Y + gc

gcback to summary
private float gc

The following invariants are used to process the gradient value from a device space coordinate, (X, Y): g(X, Y) = dgdX*X + dgdY*Y + gc

Constructor Detail

LinearGradientPaintContextback to summary
pack-priv LinearGradientPaintContext(LinearGradientPaint paint, ColorModel cm, Rectangle deviceBounds, Rectangle2D userBounds, AffineTransform t, RenderingHints hints, Point2D start, Point2D end, float[] fractions, Color[] colors, MultipleGradientPaint.CycleMethod cycleMethod, MultipleGradientPaint.ColorSpaceType colorSpace)

Constructor for LinearGradientPaintContext.

Parameters
paint:LinearGradientPaint

the LinearGradientPaint from which this context is created

cm:ColorModel

ColorModel that receives the Paint data. This is used only as a hint.

deviceBounds:Rectangle

the device space bounding box of the graphics primitive being rendered

userBounds:Rectangle2D

the user space bounding box of the graphics primitive being rendered

t:AffineTransform

the AffineTransform from user space into device space (gradientTransform should be concatenated with this)

hints:RenderingHints

the hints that the context object uses to choose between rendering alternatives

start:Point2D

gradient start point, in user space

end:Point2D

gradient end point, in user space

fractions:float[]

the fractions specifying the gradient distribution

colors:Color[]

the gradient colors

cycleMethod:MultipleGradientPaint.CycleMethod

either NO_CYCLE, REFLECT, or REPEAT

colorSpace:MultipleGradientPaint.ColorSpaceType

which colorspace to use for interpolation, either SRGB or LINEAR_RGB

Method Detail

fillRasterback to summary
protected void fillRaster(int[] pixels, int off, int adjust, int x, int y, int w, int h)

Implements abstract java.awt.MultipleGradientPaintContext.fillRaster.

Return a Raster containing the colors generated for the graphics operation. This is where the area is filled with colors distributed linearly.