org.apache.pdfbox.pdmodel.graphics.shading
Class PDShadingResources

java.lang.Object
  extended by org.apache.pdfbox.pdmodel.graphics.shading.PDShadingResources
All Implemented Interfaces:
COSObjectable
Direct Known Subclasses:
PDShadingType1, PDShadingType2, PDShadingType4, PDShadingType5

public abstract class PDShadingResources
extends Object
implements COSObjectable

This represents resources for a shading.

Version:
$Revision: 1.0 $

Field Summary
static int SHADING_TYPE1
          shading type 1 = function based shading.
static int SHADING_TYPE2
          shading type 2 = axial shading.
static int SHADING_TYPE3
          shading type 3 = radial shading.
static int SHADING_TYPE4
          shading type 4 = Free-Form Gouraud-Shaded Triangle Meshes.
static int SHADING_TYPE5
          shading type 5 = Lattice-Form Gouraud-Shaded Triangle Meshes.
static int SHADING_TYPE6
          shading type 6 = Coons Patch Meshes.
static int SHADING_TYPE7
          shading type 7 = Tensor-Product Patch Meshes.
 
Constructor Summary
PDShadingResources()
          Default constructor.
PDShadingResources(COSDictionary shadingDictionary)
          Constructor using the given shading dictionary.
 
Method Summary
static PDShadingResources create(COSDictionary resourceDictionary)
          Create the correct PD Model shading based on the COS base shading.
 boolean getAntiAlias()
          This will return the AntiAlias value.
 COSArray getBackground()
          This will return the background.
 PDRectangle getBBox()
          An array of four numbers in the form coordinate system (see below), giving the coordinates of the left, bottom, right, and top edges, respectively, of the shadings's bounding box.
 PDColorSpace getColorSpace()
          This will get the color space or null if none exists.
 COSDictionary getCOSDictionary()
          This will get the underlying dictionary.
 COSBase getCOSObject()
          Convert this standard java object to a COS object.
abstract  int getShadingType()
          This will return the shading type.
 String getType()
          This will return the type.
 void setAntiAlias(boolean antiAlias)
          This will set the AntiAlias value.
 void setBackground(COSArray newBackground)
          This will set the background.
 void setBBox(PDRectangle newBBox)
          This will set the BBox (bounding box) for this Shading.
 void setColorSpace(PDColorSpace newColorspace)
          This will set the color space for the shading.
 void setShadingType(int shadingType)
          This will set the shading type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SHADING_TYPE1

public static final int SHADING_TYPE1
shading type 1 = function based shading.

See Also:
Constant Field Values

SHADING_TYPE2

public static final int SHADING_TYPE2
shading type 2 = axial shading.

See Also:
Constant Field Values

SHADING_TYPE3

public static final int SHADING_TYPE3
shading type 3 = radial shading.

See Also:
Constant Field Values

SHADING_TYPE4

public static final int SHADING_TYPE4
shading type 4 = Free-Form Gouraud-Shaded Triangle Meshes.

See Also:
Constant Field Values

SHADING_TYPE5

public static final int SHADING_TYPE5
shading type 5 = Lattice-Form Gouraud-Shaded Triangle Meshes.

See Also:
Constant Field Values

SHADING_TYPE6

public static final int SHADING_TYPE6
shading type 6 = Coons Patch Meshes.

See Also:
Constant Field Values

SHADING_TYPE7

public static final int SHADING_TYPE7
shading type 7 = Tensor-Product Patch Meshes.

See Also:
Constant Field Values
Constructor Detail

PDShadingResources

public PDShadingResources()
Default constructor.


PDShadingResources

public PDShadingResources(COSDictionary shadingDictionary)
Constructor using the given shading dictionary.

Parameters:
shadingDictionary - The dictionary for this shading.
Method Detail

getCOSDictionary

public COSDictionary getCOSDictionary()
This will get the underlying dictionary.

Returns:
The dictionary for this shading.

getCOSObject

public COSBase getCOSObject()
Convert this standard java object to a COS object.

Specified by:
getCOSObject in interface COSObjectable
Returns:
The cos object that matches this Java object.

getType

public String getType()
This will return the type.

Returns:
The type of object that this is.

setShadingType

public void setShadingType(int shadingType)
This will set the shading type.

Parameters:
shadingType - The new shading type.

getShadingType

public abstract int getShadingType()
This will return the shading type.

Returns:
The shading type

setBackground

public void setBackground(COSArray newBackground)
This will set the background.

Parameters:
newBackground - The new background.

getBackground

public COSArray getBackground()
This will return the background.

Returns:
The background

getBBox

public PDRectangle getBBox()
An array of four numbers in the form coordinate system (see below), giving the coordinates of the left, bottom, right, and top edges, respectively, of the shadings's bounding box.

Returns:
The BBox of the form.

setBBox

public void setBBox(PDRectangle newBBox)
This will set the BBox (bounding box) for this Shading.

Parameters:
newBBox - The new BBox.

setAntiAlias

public void setAntiAlias(boolean antiAlias)
This will set the AntiAlias value.

Parameters:
antiAlias - The new AntiAlias value.

getAntiAlias

public boolean getAntiAlias()
This will return the AntiAlias value.

Returns:
The AntiAlias value

getColorSpace

public PDColorSpace getColorSpace()
                           throws IOException
This will get the color space or null if none exists.

Returns:
The color space for the shading.
Throws:
IOException - If there is an error getting the colorspace.

setColorSpace

public void setColorSpace(PDColorSpace newColorspace)
This will set the color space for the shading.

Parameters:
newColorspace - The color space

create

public static PDShadingResources create(COSDictionary resourceDictionary)
                                 throws IOException
Create the correct PD Model shading based on the COS base shading.

Parameters:
resourceDictionary - the COS shading dictionary
Returns:
the newly created shading resources object
Throws:
IOException - If we are unable to create the PDShading object.


Copyright © 2002-2012 The Apache Software Foundation. All Rights Reserved.