Top Inners Fields Constructors Methods
org.apache.poi.sl.draw

public Class PathGradientPaint

extends Object
implements Paint
Class Inheritance
All Implemented Interfaces
java.awt.Paint, java.awt.Transparency
Annotations
@Internal
Imports
java.awt.AlphaComposite, .BasicStroke, .Color, .Graphics2D, .LinearGradientPaint, .MultipleGradientPaint.ColorSpaceType, .MultipleGradientPaint.CycleMethod, .Paint, .PaintContext, .Rectangle, .RenderingHints, .Shape, java.awt.geom.AffineTransform, .Area, .IllegalPathStateException, .Point2D, .Rectangle2D, java.awt.image.BufferedImage, .ColorModel, .Raster, .WritableRaster, org.apache.poi.util.Internal

Nested and Inner Type Summary

Modifier and TypeClass and Description
public class

Field Summary

Modifier and TypeField and Description
private final int
private final Color[]
private final float[]
private final int
private final int

Constructor Summary

AccessConstructor and Description
pack-priv
PathGradientPaint(float[] fractions, Color[] colors)

private
PathGradientPaint(float[] fractions, Color[] colors, int capStyle, int joinStyle)

Method Summary

Modifier and TypeMethod and Description
public PathGradientPaint.PathGradientContext
createContext(ColorModel
the preferred ColorModel which represents the most convenient format for the caller to receive the pixel data, or null if there is no preference.
cm
,
Rectangle
the device space bounding box of the graphics primitive being rendered. Implementations of the Paint interface are allowed to throw NullPointerException for a null deviceBounds.
deviceBounds
,
Rectangle2D
the user space bounding box of the graphics primitive being rendered. Implementations of the Paint interface are allowed to throw NullPointerException for a null userBounds.
userBounds
,
AffineTransform
the AffineTransform from user space into device space. Implementations of the Paint interface are allowed to throw NullPointerException for a null xform.
transform
,
RenderingHints
the set of hints that the context object can use to choose between rendering alternatives. Implementations of the Paint interface are allowed to throw NullPointerException for a null hints.
hints
)

Implements java.awt.Paint.createContext.

Creates and returns a PaintContext used to generate the color pattern.

public int
getTransparency()

Implements java.awt.Transparency.getTransparency.

Returns the type of this Transparency.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

capStyleback to summary
private final int capStyle
colorsback to summary
private final Color[] colors
fractionsback to summary
private final float[] fractions
joinStyleback to summary
private final int joinStyle
transparencyback to summary
private final int transparency

Constructor Detail

PathGradientPaintback to summary
pack-priv PathGradientPaint(float[] fractions, Color[] colors)
PathGradientPaintback to summary
private PathGradientPaint(float[] fractions, Color[] colors, int capStyle, int joinStyle)

Method Detail

createContextback to summary
public PathGradientPaint.PathGradientContext createContext(ColorModel cm, Rectangle deviceBounds, Rectangle2D userBounds, AffineTransform transform, RenderingHints hints)

Implements java.awt.Paint.createContext.

Doc from java.awt.Paint.createContext.

Creates and returns a PaintContext used to generate the color pattern. The arguments to this method convey additional information about the rendering operation that may be used or ignored on various implementations of the Paint interface. A caller must pass non-null values for all of the arguments except for the ColorModel argument which may be null to indicate that no specific ColorModel type is preferred. Implementations of the Paint interface are allowed to use or ignore any of the arguments as makes sense for their function, and are not constrained to use the specified ColorModel for the returned PaintContext, even if it is not null. Implementations are allowed to throw NullPointerException for any null argument other than the ColorModel argument, but are not required to do so.

Parameters
cm:ColorModel

the preferred ColorModel which represents the most convenient format for the caller to receive the pixel data, or null if there is no preference.

deviceBounds:Rectangle

the device space bounding box of the graphics primitive being rendered. Implementations of the Paint interface are allowed to throw NullPointerException for a null deviceBounds.

userBounds:Rectangle2D

the user space bounding box of the graphics primitive being rendered. Implementations of the Paint interface are allowed to throw NullPointerException for a null userBounds.

transform:AffineTransform

the AffineTransform from user space into device space. Implementations of the Paint interface are allowed to throw NullPointerException for a null xform.

hints:RenderingHints

the set of hints that the context object can use to choose between rendering alternatives. Implementations of the Paint interface are allowed to throw NullPointerException for a null hints.

Returns:PathGradientPaint.PathGradientContext

the PaintContext for generating color patterns.

Annotations
@Override
getTransparencyback to summary
public int getTransparency()

Implements java.awt.Transparency.getTransparency.

Doc from java.awt.Transparency.getTransparency.

Returns the type of this Transparency.

Returns:int

the field type of this Transparency, which is either OPAQUE, BITMASK or TRANSLUCENT.

org.apache.poi.sl.draw back to summary

public Class PathGradientPaint.PathGradientContext

extends Object
implements PaintContext
Class Inheritance
All Implemented Interfaces
java.awt.PaintContext

Field Summary

Modifier and TypeField and Description
pack-priv final Rectangle
pack-priv final int
pack-priv final RenderingHints
pack-priv final PaintContext
pack-priv WritableRaster
protected final Shape
shape

for POI: the shape will be only known when the subclasses determines the concrete implementation in the draw/-content method, so we need to postpone the setting/creation as long as possible

pack-priv final Rectangle2D
protected final AffineTransform

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public WritableRaster
public void
dispose()

Implements java.awt.PaintContext.dispose.

Releases the resources allocated for the operation.

public ColorModel
getColorModel()

Implements java.awt.PaintContext.getColorModel.

Returns the ColorModel of the output.

pack-priv int
getGradientSteps(Shape gradientShape)

public Raster
getRaster(int
the x coordinate of the area in device space for which colors are generated.
xOffset
,
int
the y coordinate of the area in device space for which colors are generated.
yOffset
,
int
the width of the area in device space
w
,
int
the height of the area in device space
h
)

Implements java.awt.PaintContext.getRaster.

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

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

deviceBoundsback to summary
pack-priv final Rectangle deviceBounds
gradientStepsback to summary
pack-priv final int gradientSteps
hintsback to summary
pack-priv final RenderingHints hints
pCtxback to summary
pack-priv final PaintContext pCtx
rasterback to summary
pack-priv WritableRaster raster
shapeback to summary
protected final Shape shape

for POI: the shape will be only known when the subclasses determines the concrete implementation in the draw/-content method, so we need to postpone the setting/creation as long as possible

userBoundsback to summary
pack-priv final Rectangle2D userBounds
xformback to summary
protected final AffineTransform xform

Constructor Detail

PathGradientContextback to summary
pack-priv PathGradientContext(ColorModel cm, Rectangle deviceBounds, Rectangle2D userBounds, AffineTransform xform, RenderingHints hints)

Method Detail

createRasterback to summary
public WritableRaster createRaster()
disposeback to summary
public void dispose()

Implements java.awt.PaintContext.dispose.

Doc from java.awt.PaintContext.dispose.

Releases the resources allocated for the operation.

getColorModelback to summary
public ColorModel getColorModel()

Implements java.awt.PaintContext.getColorModel.

Doc from java.awt.PaintContext.getColorModel.

Returns the ColorModel of the output. Note that this ColorModel might be different from the hint specified in the createContext method of Paint. Not all PaintContext objects are capable of generating color patterns in an arbitrary ColorModel.

Returns:ColorModel

the ColorModel of the output.

getGradientStepsback to summary
pack-priv int getGradientSteps(Shape gradientShape)
getRasterback to summary
public Raster getRaster(int xOffset, int yOffset, int w, int h)

Implements java.awt.PaintContext.getRaster.

Doc from java.awt.PaintContext.getRaster.

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

Parameters
xOffset:int

the x coordinate of the area in device space for which colors are generated.

yOffset:int

the y coordinate of the area in device space for which colors are generated.

w:int

the width of the area in device space

h:int

the height of the area in device space

Returns:Raster

a Raster representing the specified rectangular area and containing the colors generated for the graphics operation.