PDFWritable
public class PDFPattern extends PDFPathPaint
Modifier and Type | Field | Description |
---|---|---|
protected java.util.List |
bBox |
List of Doubles representing the Bounding box rectangle
|
protected java.lang.StringBuffer |
extGState |
TODO use PDFGState
String representing the extended Graphics state.
|
protected java.util.List |
matrix |
List of Doubles representing the Transformation matrix.
|
protected int |
paintType |
1 for colored pattern, 2 for uncolored
|
protected java.lang.StringBuffer |
patternDataStream |
The stream of a pattern
|
protected java.lang.String |
patternName |
The name of the pattern such as "Pa1" or "Pattern1"
|
protected int |
patternType |
Either one (1) for tiling, or two (2) for shading.
|
protected PDFResources |
resources |
The resources associated with this pattern
|
protected PDFShading |
shading |
The Shading object comprising the Type 2 pattern
|
protected int |
tilingType |
1 for constant spacing, 2 for no distortion, and 3 for fast rendering
|
protected double |
xStep |
Horizontal spacing
|
protected java.util.List |
xUID |
List of Integers represetning the Extended unique Identifier
|
protected double |
yStep |
Vertical spacing
|
colorSpace
Constructor | Description |
---|---|
PDFPattern(int thePatternType,
PDFShading shading,
java.util.List theXUID,
java.lang.StringBuffer theExtGState,
java.util.List theMatrix) |
Create a type 2 pattern (smooth shading)
|
PDFPattern(PDFResources theResources,
int thePatternType,
int thePaintType,
int theTilingType,
java.util.List theBBox,
double theXStep,
double theYStep,
java.util.List theMatrix,
java.util.List theXUID,
java.lang.StringBuffer thePatternDataStream) |
Create a tiling pattern (type 1).
|
Modifier and Type | Method | Description |
---|---|---|
protected boolean |
contentEquals(PDFObject obj) |
Check if the other PDFObject has the same content as the current object.
|
java.lang.String |
getColorSpaceOut(boolean fillNotStroke) |
Get the PDF command for setting to this pattern.
|
java.lang.String |
getName() |
Get the name of the pattern
|
int |
output(java.io.OutputStream stream) |
represent as PDF.
|
void |
setName(java.lang.String name) |
Sets the name of the pattern.
|
byte[] |
toPDF() |
Output PDF bytes, not used.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
encode, encodeBinaryToHexString, encodeString, encodeText, formatObject, getChildren, getDocument, getDocumentSafely, getGeneration, getObjectID, getObjectNumber, getParent, hasObjectNumber, makeReference, outputInline, referencePDF, setDocument, setObjectNumber, setObjectNumber, setObjectNumber, setParent, toPDFString
getColorSpace, setColorSpace
protected PDFResources resources
protected int patternType
protected java.lang.String patternName
protected int paintType
protected int tilingType
protected java.util.List bBox
protected double xStep
protected double yStep
protected PDFShading shading
protected java.util.List xUID
protected java.lang.StringBuffer extGState
protected java.util.List matrix
protected java.lang.StringBuffer patternDataStream
public PDFPattern(PDFResources theResources, int thePatternType, int thePaintType, int theTilingType, java.util.List theBBox, double theXStep, double theYStep, java.util.List theMatrix, java.util.List theXUID, java.lang.StringBuffer thePatternDataStream)
theResources
- the resources associated with this patternthePatternType
- the type of pattern, which is 1 for tiling.thePaintType
- 1 or 2, colored or uncolored.theTilingType
- 1, 2, or 3, constant spacing, no distortion, or faster tilingtheBBox
- List of Doubles: The pattern cell bounding boxtheXStep
- horizontal spacingtheYStep
- vertical spacingtheMatrix
- Optional List of Doubles transformation matrixtheXUID
- Optional vector of Integers that uniquely identify the patternthePatternDataStream
- The stream of pattern data to be tiled.public PDFPattern(int thePatternType, PDFShading shading, java.util.List theXUID, java.lang.StringBuffer theExtGState, java.util.List theMatrix)
thePatternType
- the type of the pattern, which is 2, smooth shadingshading
- the Shading object that comprises this patterntheXUID
- optional:the extended unique Identifier if used.theExtGState
- optional: the extended graphics state, if used.theMatrix
- Optional:List of Doubles that specify the matrix.public java.lang.String getName()
public void setName(java.lang.String name)
name
- the name of the pattern. Can be anything
without spaces. "Pattern1" or "Pa1" are good examples.public java.lang.String getColorSpaceOut(boolean fillNotStroke)
getColorSpaceOut
in class PDFPathPaint
fillNotStroke
- if true fill otherwise strokepublic int output(java.io.OutputStream stream) throws java.io.IOException
public byte[] toPDF()
protected boolean contentEquals(PDFObject obj)
Note: This function has a contract which is less binding than
Object.equals(Object)
. Whereas equals would require all values to be
identical, this method is not required to check everything. In the case
of PDFObjects, this means that the overriding function does not have to
check for PDFObject.getObjectID()
.
contentEquals
in class PDFObject
obj
- object to compare to.Copyright 1999-2016 The Apache Software Foundation. All Rights Reserved.