Top Description Fields Constructors Methods
org.apache.pdfbox.pdmodel.graphics.pattern

public abstract Class PDAbstractPattern

extends Object
implements COSObjectable
Class Inheritance
All Implemented Interfaces
org.apache.pdfbox.pdmodel.common.COSObjectable
Known Direct Subclasses
org.apache.pdfbox.pdmodel.graphics.pattern.PDShadingPattern, org.apache.pdfbox.pdmodel.graphics.pattern.PDTilingPattern
Imports
java.awt.geom.AffineTransform, java.io.IOException, org.apache.pdfbox.cos.COSArray, .COSDictionary, .COSFloat, .COSName, org.apache.pdfbox.pdmodel.ResourceCache, org.apache.pdfbox.pdmodel.common.COSObjectable, org.apache.pdfbox.util.Matrix

This class wraps a pattern dictionary. Patterns can be found in resource dictionaries.

Field Summary

Modifier and TypeField and Description
private final COSDictionary
public static final int
TYPE_SHADING_PATTERN

Shading pattern type.

public static final int
TYPE_TILING_PATTERN

Tiling pattern type.

Constructor Summary

AccessConstructor and Description
public
PDAbstractPattern()

Creates a new Pattern dictionary.

public
PDAbstractPattern(COSDictionary
The COSDictionary for this pattern.
dictionary
)

Creates a new Pattern dictionary from the given COS dictionary.

Method Summary

Modifier and TypeMethod and Description
public static PDAbstractPattern

Returns:

the newly created pattern object
create
(COSDictionary
the COS pattern dictionary
dictionary
,
ResourceCache
the resource cache, may be null, useful for tiling patterns.
resourceCache
)

Create the correct PD Model pattern based on the COS base pattern.

public COSDictionary

Returns:

The dictionary for this pattern.
getCOSObject
()

Implements org.apache.pdfbox.pdmodel.common.COSObjectable.getCOSObject.

This will get the underlying dictionary.

public Matrix

Returns:

the pattern matrix
getMatrix
()

Returns the pattern matrix, or the identity matrix is none is available.

public abstract int

Returns:

The pattern type
getPatternType
()

This will return the pattern type.

public String

Returns:

The type of object that this is.
getType
()

This will return the paint type.

public void
setMatrix(AffineTransform
the transformation matrix
transform
)

Sets the optional Matrix entry for the Pattern.

public void
setPaintType(int
The new paint type.
paintType
)

This will set the paint type.

public void
setPatternType(int
The new pattern type.
patternType
)

This will set the pattern type.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

patternDictionaryback to summary
private final COSDictionary patternDictionary
TYPE_SHADING_PATTERNback to summary
public static final int TYPE_SHADING_PATTERN

Shading pattern type.

TYPE_TILING_PATTERNback to summary
public static final int TYPE_TILING_PATTERN

Tiling pattern type.

Constructor Detail

PDAbstractPatternback to summary
public PDAbstractPattern()

Creates a new Pattern dictionary.

PDAbstractPatternback to summary
public PDAbstractPattern(COSDictionary dictionary)

Creates a new Pattern dictionary from the given COS dictionary.

Parameters
dictionary:COSDictionary

The COSDictionary for this pattern.

Method Detail

createback to summary
public static PDAbstractPattern create(COSDictionary dictionary, ResourceCache resourceCache) throws IOException

Create the correct PD Model pattern based on the COS base pattern.

Parameters
dictionary:COSDictionary

the COS pattern dictionary

resourceCache:ResourceCache

the resource cache, may be null, useful for tiling patterns.

Returns:PDAbstractPattern

the newly created pattern object

Exceptions
IOException:
If we are unable to create the PDPattern object.
getCOSObjectback to summary
public COSDictionary getCOSObject()

Implements org.apache.pdfbox.pdmodel.common.COSObjectable.getCOSObject.

This will get the underlying dictionary.

Returns:COSDictionary

The dictionary for this pattern.

Annotations
@Override
getMatrixback to summary
public Matrix getMatrix()

Returns the pattern matrix, or the identity matrix is none is available.

Returns:Matrix

the pattern matrix

getPatternTypeback to summary
public abstract int getPatternType()

This will return the pattern type.

Returns:int

The pattern type

getTypeback to summary
public String getType()

This will return the paint type.

Returns:String

The type of object that this is.

setMatrixback to summary
public void setMatrix(AffineTransform transform)

Sets the optional Matrix entry for the Pattern.

Parameters
transform:AffineTransform

the transformation matrix

setPaintTypeback to summary
public void setPaintType(int paintType)

This will set the paint type.

Parameters
paintType:int

The new paint type.

setPatternTypeback to summary
public void setPatternType(int patternType)

This will set the pattern type.

Parameters
patternType:int

The new pattern type.