public class PSTilingPattern extends Object
Modifier and Type | Field and Description |
---|---|
protected Rectangle2D |
bBox
An array of four numbers in the pattern coordinate system, giving
the coordinates of the left, bottom, right, and top edges, respectively, of the
pattern cell's bounding box
|
protected StringBuffer |
paintProc
A PostScript procedure for painting the pattern cell
|
protected int |
paintType
A code that determines how the color of the pattern cell is to be
specified: 1 for colored pattern, 2 for uncolored pattern
|
static int |
PATTERN_TYPE_SHADING
PostScript constant for a shading pattern (unsupported)
|
static int |
PATTERN_TYPE_TILING
A code identifying the pattern type that this dictionary describes;
must be 1 for a tiling pattern
|
protected String |
patternName
The name of the pattern (for example: "Pattern1" )
|
protected int |
patternType
the pattern type of this pattern
|
protected TexturePaint |
texture
A texture is used for filling shapes
|
protected int |
tilingType
A code that controls adjustments to the spacing of tiles relative to
the device pixel grid:
1 for constant spacing,
2 for no distortion
3 for constant spacing and faster tiling.
|
protected double |
xStep
The desired horizontal spacing between pattern cells, measured in
the pattern coordinate system
|
protected List |
xUID
The XUID is an extended unique ID -- an array of integers that provides for
distributed, hierarchical management of the space of unique ID numbers
(optional)
|
protected double |
yStep
The desired vertical spacing between pattern cells, measured in
the pattern coordinate system
|
Constructor and Description |
---|
PSTilingPattern(String patternName,
StringBuffer paintProc,
Rectangle bBox,
double xStep,
double yStep,
int paintType,
int tilingType,
List xUID)
Constructor for the creation of pattern with defined PaintProc
|
PSTilingPattern(String patternName,
TexturePaint texture,
double xStep,
double yStep,
int tilingType,
List xUID)
Constructor for the creation of pattern with defined texture
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object pattern)
Compares two patterns data (except their names).
|
Rectangle2D |
getBoundingBox()
Returns the bounding box.
|
String |
getName()
Gets the name of the pattern
|
StringBuffer |
getPaintProc()
Gets the postscript procedure PaintProc
|
int |
getPaintType()
Gets the code that determines how the color of the pattern cell is to be
specified: 1 for colored pattern, 2 for uncolored pattern
|
TexturePaint |
getTexturePaint()
Gets a texture which is used for filling shapes
|
int |
getTilingType()
Gets a code that controls adjustments to the spacing of tiles relative to
the device pixel grid: 1 for constant spacing, 2 for no distortion
3 for constant spacing and faster tiling
|
double |
getXStep()
Gets the horizontal spacing between pattern cells
|
List |
getXUID()
Gets an extended unique ID that uniquely identifies the pattern
|
double |
getYStep()
Gets the vertical spacing between pattern cells
|
int |
hashCode() |
void |
setBoundingBox(Rectangle2D bBox)
Sets the bounding box.
|
void |
setName(String name)
Sets the name of the pattern.
|
void |
setPaintProc(StringBuffer paintProc)
Sets the postscript procedure PaintProc
|
void |
setPaintType(int paintType)
Sets the code that determines how the color of the pattern cell is to be
specified: 1 for colored pattern, 2 for uncolored pattern
|
void |
setTexturePaint(TexturePaint texturePaint)
Sets a texture which is used for filling shapes
|
void |
setTilingType(int tilingType)
Sets a code that controls adjustments to the spacing of tiles relative to
the device pixel grid: 1 for constant spacing, 2 for no distortion
3 for constant spacing and faster tiling
|
void |
setXStep(double xStep)
Sets the horizontal spacing between pattern cells
|
void |
setXUID(List xUID)
Sets an extended unique ID that uniquely identifies the pattern
|
void |
setYStep(double yStep)
Sets the vertical spacing between pattern cells
|
String |
toString()
Generates postscript code for a pattern
|
public static final int PATTERN_TYPE_TILING
public static final int PATTERN_TYPE_SHADING
protected int patternType
protected String patternName
protected List xUID
protected StringBuffer paintProc
protected Rectangle2D bBox
protected double xStep
protected double yStep
protected int paintType
protected int tilingType
protected TexturePaint texture
public PSTilingPattern(String patternName, StringBuffer paintProc, Rectangle bBox, double xStep, double yStep, int paintType, int tilingType, List xUID)
patternName
- the name of the pattern (for example: "Pattern1" ), if
the name is null, the pattern should be stored in PSPatternStorage, where the pattern
gets a name (the pattern without name cannot be use in PS file)paintProc
- a postscript procedure for painting the pattern cellbBox
- a pattern cell's bounding boxxStep
- the desired horizontal spacing between pattern cellsyStep
- the desired vertical spacing between pattern cellspaintType
- 1 for colored pattern, 2 for uncolored patterntilingType
- adjustments to the spacing of tiles relative to
the device pixel grid (1,2 or 3)xUID
- an extended unique ID (optional)public PSTilingPattern(String patternName, TexturePaint texture, double xStep, double yStep, int tilingType, List xUID)
patternName
- the name of the pattern (for example: "Pattern1" ), if
the name is null, the pattern should be stored in PSPatternStorage, where the pattern
gets a name (a pattern without name cannot be use in PS file)texture
- a texture is used for filling a shapexStep
- the desired horizontal spacing between pattern cellsyStep
- yStep the desired vertical spacing between pattern cellstilingType
- adjustments to the spacing of tiles relative to
the device pixel grid (1,2 or 3)xUID
- xUID an extended unique ID (optional)public String getName()
public void setName(String name)
name
- the name of the pattern. Can be anything without spaces (for example "Pattern1").public Rectangle2D getBoundingBox()
public void setBoundingBox(Rectangle2D bBox)
bBox
- a pattern cell's bounding boxpublic StringBuffer getPaintProc()
public void setPaintProc(StringBuffer paintProc)
paintProc
- the postscript procedure PaintProcpublic double getXStep()
public void setXStep(double xStep)
xStep
- the horizontal spacing between pattern cellspublic double getYStep()
public void setYStep(double yStep)
yStep
- the vertical spacing between pattern cellspublic int getPaintType()
public void setPaintType(int paintType)
paintType
- the paint typepublic int getTilingType()
public void setTilingType(int tilingType)
tilingType
- the tiling typepublic TexturePaint getTexturePaint()
public void setTexturePaint(TexturePaint texturePaint)
texturePaint
- the texturepublic List getXUID()
public void setXUID(List xUID)
xUID
- the unique IDpublic String toString()
Copyright © 2022 Apache Software Foundation. All rights reserved.