|
xmlgraphics-commons 1.0 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.xmlgraphics.ps.PSGenerator
This class is used to output PostScript code to an OutputStream.
Field Summary | |
static org.apache.xmlgraphics.ps.PSGenerator.AtendIndicator |
ATEND
Indicator for the PostScript interpreter that the value is provided later in the document (mostly in the %%Trailer section). |
static char |
LF
Line feed used by PostScript |
Constructor Summary | |
PSGenerator(java.io.OutputStream out)
|
Method Summary | |
void |
commentln(java.lang.String comment)
Writes a comment to the stream and ends the line. |
void |
concatMatrix(java.awt.geom.AffineTransform at)
Concats the transformations matric. |
void |
concatMatrix(double[] matrix)
Concats the transformations matrix. |
void |
concatMatrix(double a,
double b,
double c,
double d,
double e,
double f)
Concats the transformation matrix. |
static java.lang.String |
convertStringToDSC(java.lang.String text)
Converts text by applying escaping rules established in the DSC specs. |
static java.lang.String |
convertStringToDSC(java.lang.String text,
boolean forceParentheses)
Converts text by applying escaping rules established in the DSC specs. |
void |
defineRect(double x,
double y,
double w,
double h)
Adds a rectangle to the current path. |
static void |
escapeChar(char c,
java.lang.StringBuffer target)
Escapes a character conforming to the rules established in the PostScript Language Reference (Search for "Literal Text Strings"). |
void |
flush()
Flushes the OutputStream. |
java.lang.String |
formatDouble(double value)
Formats a double value for PostScript output. |
java.lang.String |
formatDouble5(double value)
Formats a double value for PostScript output (higher resolution). |
PSState |
getCurrentState()
Returns the current graphics state. |
java.io.OutputStream |
getOutputStream()
Returns the OutputStream the PSGenerator writes to. |
int |
getPSLevel()
Returns the selected PostScript level. |
boolean |
isResourceSupplied(PSResource res)
Indicates whether a particular resource is supplied, rather than needed. |
void |
newLine()
Writes a newline character to the OutputStream. |
void |
notifyResourceUsage(PSResource res,
boolean needed)
Notifies the generator about the usage of a resource on the current page. |
void |
notifyStartNewPage()
Notifies the generator that a new page has been started and that the page resource set can be cleared. |
javax.xml.transform.Source |
resolveURI(java.lang.String uri)
Attempts to resolve the given URI. |
boolean |
restoreGraphicsState()
Restores the last graphics state of the rendering engine. |
void |
saveGraphicsState()
Saves the graphics state of the rendering engine. |
void |
useDash(java.lang.String pattern)
Establishes the specified dash pattern. |
void |
useFont(java.lang.String name,
float size)
Establishes the specified font and size. |
void |
useLineCap(int linecap)
Establishes the specified line cap style. |
void |
useLineWidth(double width)
Establishes the specified line width. |
void |
useRGBColor(java.awt.Color col)
Establishes the specified color (RGB). |
void |
write(java.lang.String cmd)
Writes a PostScript command to the stream. |
void |
writeByteArr(byte[] cmd)
Writes encoded data to the PostScript stream. |
void |
writeDSCComment(java.lang.String name)
Writes a DSC comment to the output stream. |
void |
writeDSCComment(java.lang.String name,
java.lang.Object param)
Writes a DSC comment to the output stream. |
void |
writeDSCComment(java.lang.String name,
java.lang.Object[] params)
Writes a DSC comment to the output stream. |
void |
writeln(java.lang.String cmd)
Writes a PostScript command to the stream and ends the line. |
void |
writeResources(boolean pageLevel)
Writes a DSC comment for the accumulated used resources, either at page level or at document level. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final org.apache.xmlgraphics.ps.PSGenerator.AtendIndicator ATEND
public static final char LF
Constructor Detail |
public PSGenerator(java.io.OutputStream out)
FilterOutputStream
Method Detail |
public java.io.OutputStream getOutputStream()
public int getPSLevel()
public javax.xml.transform.Source resolveURI(java.lang.String uri)
uri
- URI to access
Source
object, or null if the URI
cannot be resolved.public final void newLine() throws java.io.IOException
java.io.IOException
- In case of an I/O problempublic java.lang.String formatDouble(double value)
value
- value to format
public java.lang.String formatDouble5(double value)
value
- value to format
public void write(java.lang.String cmd) throws java.io.IOException
cmd
- The PostScript code to be written.
java.io.IOException
- In case of an I/O problempublic void writeln(java.lang.String cmd) throws java.io.IOException
cmd
- The PostScript code to be written.
java.io.IOException
- In case of an I/O problempublic void commentln(java.lang.String comment) throws java.io.IOException
comment
- comment to write
java.io.IOException
- In case of an I/O problempublic void writeByteArr(byte[] cmd) throws java.io.IOException
cmd
- The encoded PostScript code to be written.
java.io.IOException
- In case of an I/O problempublic void flush() throws java.io.IOException
java.io.IOException
- In case of an I/O problempublic static final void escapeChar(char c, java.lang.StringBuffer target)
c
- character to escapetarget
- target StringBuffer to write the escaped character topublic static final java.lang.String convertStringToDSC(java.lang.String text)
text
- Text to convert
public static final java.lang.String convertStringToDSC(java.lang.String text, boolean forceParentheses)
text
- Text to convertforceParentheses
- Force the use of parentheses
public void writeDSCComment(java.lang.String name) throws java.io.IOException
name
- Name of the DSC comment
java.io.IOException
- In case of an I/O problemDSCConstants
public void writeDSCComment(java.lang.String name, java.lang.Object param) throws java.io.IOException
name
- Name of the DSC commentparam
- Single parameter to the DSC comment
java.io.IOException
- In case of an I/O problemDSCConstants
public void writeDSCComment(java.lang.String name, java.lang.Object[] params) throws java.io.IOException
name
- Name of the DSC commentparams
- Array of parameters to the DSC comment
java.io.IOException
- In case of an I/O problemDSCConstants
public void saveGraphicsState() throws java.io.IOException
java.io.IOException
- In case of an I/O problempublic boolean restoreGraphicsState() throws java.io.IOException
java.io.IOException
- In case of an I/O problempublic PSState getCurrentState()
public void concatMatrix(double a, double b, double c, double d, double e, double f) throws java.io.IOException
a
- A partb
- B partc
- C partd
- D parte
- E partf
- F part
java.io.IOException
- In case of an I/O problempublic void concatMatrix(double[] matrix) throws java.io.IOException
matrix
- Matrix to use
java.io.IOException
- In case of an I/O problempublic void concatMatrix(java.awt.geom.AffineTransform at) throws java.io.IOException
at
- the AffineTransform whose matrix to use
java.io.IOException
- In case of an I/O problempublic void defineRect(double x, double y, double w, double h) throws java.io.IOException
x
- upper left cornery
- upper left cornerw
- widthh
- height
java.io.IOException
- In case of an I/O problempublic void useLineCap(int linecap) throws java.io.IOException
linecap
- the line cap style (0, 1 or 2) as defined by the setlinecap command.
java.io.IOException
- In case of an I/O problempublic void useLineWidth(double width) throws java.io.IOException
width
- the line width as defined by the setlinewidth command.
java.io.IOException
- In case of an I/O problempublic void useDash(java.lang.String pattern) throws java.io.IOException
pattern
- the dash pattern as defined by the setdash command.
java.io.IOException
- In case of an I/O problempublic void useRGBColor(java.awt.Color col) throws java.io.IOException
col
- the color as defined by the setrgbcolor command.
java.io.IOException
- In case of an I/O problempublic void useFont(java.lang.String name, float size) throws java.io.IOException
name
- name of the font for the "F" command (see FOP Std Proc Set)size
- size of the font
java.io.IOException
- In case of an I/O problempublic void notifyStartNewPage()
public void notifyResourceUsage(PSResource res, boolean needed)
res
- the resource being usedneeded
- true if this is a needed resource, false for a supplied resourcepublic boolean isResourceSupplied(PSResource res)
res
- the resource
public void writeResources(boolean pageLevel) throws java.io.IOException
pageLevel
- true if the DSC comment for the page level should be generated,
false for the document level (in the trailer)
java.io.IOException
- In case of an I/O problem
|
xmlgraphics-commons 1.0 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |