Package org.apache.xmlgraphics.ps
Class PSState
java.lang.Object
org.apache.xmlgraphics.ps.PSState
- All Implemented Interfaces:
Serializable
This class holds the current state of the PostScript interpreter.
- Version:
- $Id$
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
Check the current transform.void
concatMatrix
(AffineTransform transform) Concats the given transformation matrix with the current one.Returns the transform.void
reestablish
(PSGenerator gen) Reestablishes the graphics state represented by this instance by issueing the necessary commands.boolean
Establishes the specified color (RGB).boolean
Establishes the specified dash.boolean
Establishes the specified font and size.boolean
useLineCap
(int value) Establishes the specified line cap.boolean
useLineJoin
(int value) Establishes the specified line join.boolean
useLineWidth
(double value) Establishes the specified line width.boolean
useMiterLimit
(float value) Establishes the specified miter limit.
-
Field Details
-
DEFAULT_DASH
Default for setdash- See Also:
-
DEFAULT_RGB_COLOR
Default color in PostScript
-
-
Constructor Details
-
PSState
public PSState()Default constructor -
PSState
Copy constructor- Parameters:
org
- the original to copy fromcopyTransforms
- true if the list of matrix concats should be cloned, too
-
-
Method Details
-
getTransform
Returns the transform.- Returns:
- the current transformation matrix
-
checkTransform
Check the current transform. The transform for the current state is the combination of all transforms in the current state. The parameter is compared against this current transform.- Parameters:
tf
- the transform the check against- Returns:
- true if the new transform is different then the current transform
-
concatMatrix
Concats the given transformation matrix with the current one.- Parameters:
transform
- The new transformation matrix
-
useLineCap
public boolean useLineCap(int value) Establishes the specified line cap.- Parameters:
value
- line cap (0, 1 or 2) as defined by the setlinecap command- Returns:
- true if the line cap changed compared to the previous setting
-
useLineJoin
public boolean useLineJoin(int value) Establishes the specified line join.- Parameters:
value
- line join (0, 1 or 2) as defined by the setlinejoin command- Returns:
- true if the line join changed compared to the previous setting
-
useMiterLimit
public boolean useMiterLimit(float value) Establishes the specified miter limit.- Parameters:
value
- the miter limit as defined by the setmiterlimit command- Returns:
- true if the miter limit changed compared to the previous setting
-
useLineWidth
public boolean useLineWidth(double value) Establishes the specified line width.- Parameters:
value
- line width as defined by the setlinewidth command- Returns:
- true if the line width changed compared to the previous setting
-
useDash
Establishes the specified dash.- Parameters:
pattern
- dash pattern as defined by the setdash command- Returns:
- true if the dash pattern changed compared to the previous setting
-
useColor
Establishes the specified color (RGB).- Parameters:
value
- color as defined by the setrgbcolor command- Returns:
- true if the color changed compared to the previous setting
-
useFont
Establishes the specified font and size.- Parameters:
name
- name of the font for the "F" command (see FOP Std Proc Set)size
- size of the font- Returns:
- true if the font changed compared to the previous setting
-
reestablish
Reestablishes the graphics state represented by this instance by issueing the necessary commands.- Parameters:
gen
- The generator to use for output- Throws:
IOException
- In case of an I/O problem
-