Package com.sun.pdfview.pattern
Class PDFShader
java.lang.Object
com.sun.pdfview.pattern.PDFShader
- Direct Known Subclasses:
ShaderType2
A PDFShader fills a given region with a shading, such as a gradient.
Shading Dictionaries (section 4.6)
A shading dictionary specifies details of a particular gradient fill,
including the type of shading to be used, the geometry of the area to
be shaded, and the geometry of the gradient fill. Various shading types
are available, depending on the value of the dictionary’s ShadingType entry:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
private PDFPaint
the background colorprivate Rectangle2D
the bounding box of the patternprivate PDFColorSpace
the colorspacestatic final int
static final int
static final int
static final int
static final int
static final int
private int
the type of the shading (1 through 7) -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGet the background colorgetBBox()
Get the bounding boxGet the color spaceabstract PDFPaint
getPaint()
Returns paint that represents the selected shaderstatic PDFShader
Parse a pdf shader into a shader objectint
getType()
Get the typeabstract void
Parse the shader-specific dataprotected void
setBackground
(PDFPaint background) Set the background colorprotected void
setBBox
(Rectangle2D bbox) Set the bounding boxprotected void
setColorSpace
(PDFColorSpace colorSpace) Set the color space
-
Field Details
-
FUNCTION_SHADING
public static final int FUNCTION_SHADING- See Also:
-
AXIAL_SHADING
public static final int AXIAL_SHADING- See Also:
-
RADIAL_SHADING
public static final int RADIAL_SHADING- See Also:
-
FREE_FORM_SHADING
public static final int FREE_FORM_SHADING- See Also:
-
LATTICE_SHADING
public static final int LATTICE_SHADING- See Also:
-
COONS_PATCH_MESH_SHADING
public static final int COONS_PATCH_MESH_SHADING- See Also:
-
TENSOR_PRODUCTS_MESH_SHADING
public static final int TENSOR_PRODUCTS_MESH_SHADING- See Also:
-
type
private int typethe type of the shading (1 through 7) -
colorSpace
the colorspace -
background
the background color -
bbox
the bounding box of the pattern
-
-
Constructor Details
-
PDFShader
protected PDFShader(int type) Creates a new instance of PDFShader
-
-
Method Details
-
getShader
Parse a pdf shader into a shader object- Throws:
IOException
-
getType
public int getType()Get the type -
getColorSpace
Get the color space -
setColorSpace
Set the color space -
getBackground
Get the background color -
setBackground
Set the background color -
getBBox
Get the bounding box -
setBBox
Set the bounding box -
parse
Parse the shader-specific data- Throws:
IOException
-
getPaint
Returns paint that represents the selected shader
-