java.lang.Object
org.sejda.sambox.pdmodel.graphics.pattern.PDAbstractPattern
- All Implemented Interfaces:
COSObjectable
- Direct Known Subclasses:
PDShadingPattern,PDTilingPattern
A Pattern dictionary from a page's resources.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intShading pattern type.static final intTiling pattern type. -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new Pattern dictionary.PDAbstractPattern(COSDictionary resourceDictionary) Creates a new Pattern dictionary from the given COS dictionary. -
Method Summary
Modifier and TypeMethodDescriptionstatic PDAbstractPatterncreate(COSDictionary resourceDictionary) Create the correct PD Model pattern based on the COS base pattern.static PDAbstractPatterncreate(COSDictionary resourceDictionary, ResourceCache resourceCache) Create the correct PD Model pattern based on the COS base pattern.This will get the underlying dictionary.Returns the pattern matrix, or the identity matrix is none is available.abstract intThis will return the pattern type.getType()This will return the paint type.voidsetMatrix(AffineTransform transform) Sets the optional Matrix entry for the Pattern.voidsetPaintType(int paintType) This will set the paint type.voidsetPatternType(int patternType) This will set the pattern type.
-
Field Details
-
TYPE_TILING_PATTERN
public static final int TYPE_TILING_PATTERNTiling pattern type.- See Also:
-
TYPE_SHADING_PATTERN
public static final int TYPE_SHADING_PATTERNShading pattern type.- See Also:
-
-
Constructor Details
-
PDAbstractPattern
public PDAbstractPattern()Creates a new Pattern dictionary. -
PDAbstractPattern
Creates a new Pattern dictionary from the given COS dictionary.- Parameters:
resourceDictionary- The COSDictionary for this pattern resource.
-
-
Method Details
-
create
Create the correct PD Model pattern based on the COS base pattern.- Parameters:
resourceDictionary- the COS pattern dictionary- Returns:
- the newly created pattern resources object
- Throws:
IOException- If we are unable to create the PDPattern object.
-
create
public static PDAbstractPattern create(COSDictionary resourceDictionary, ResourceCache resourceCache) throws IOException Create the correct PD Model pattern based on the COS base pattern.- Parameters:
resourceDictionary- the COS pattern dictionaryresourceCache- the resource cache, may be null, useful for tiling patterns.- Returns:
- the newly created pattern object
- Throws:
IOException- If we are unable to create the PDPattern object.
-
getCOSObject
This will get the underlying dictionary.- Specified by:
getCOSObjectin interfaceCOSObjectable- Returns:
- The dictionary for these pattern resources.
-
setPaintType
public void setPaintType(int paintType) This will set the paint type.- Parameters:
paintType- The new paint type.
-
getType
This will return the paint type.- Returns:
- The type of object that this is.
-
setPatternType
public void setPatternType(int patternType) This will set the pattern type.- Parameters:
patternType- The new pattern type.
-
getPatternType
public abstract int getPatternType()This will return the pattern type.- Returns:
- The pattern type
-
getMatrix
Returns the pattern matrix, or the identity matrix is none is available. -
setMatrix
Sets the optional Matrix entry for the Pattern.- Parameters:
transform- the transformation matrix
-