|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.extex.backend.documentWriter.postscript.AbstractPostscriptWriter
public abstract class AbstractPostscriptWriter
This is the abstract base class for document writers producing PostScript code. Here some utility methods of general nature are collected.
| Field Summary | |
|---|---|
protected static byte[] |
COMMENT
The constant COMMENT contains two percent signs as start of a comment. |
protected static java.text.DateFormat |
DF
The field DF contains the formatter for the date. |
| Constructor Summary | |
|---|---|
AbstractPostscriptWriter(java.lang.String extension)
Creates a new object. |
|
| Method Summary | |
|---|---|
void |
configure(Configuration config)
Configure an object according to a given Configuration. |
protected PsConverter |
getConverter()
Create a PostScript converter. |
java.lang.String |
getExtension()
Getter for the extension associated with this kind of output. |
CoreFontFactory |
getFontFactory()
Getter for fontFactory. |
protected FontManager |
getFontManager()
Getter for fontManager. |
protected java.lang.String |
getParameter(java.lang.String name)
Getter for a named parameter. |
protected java.io.PrintStream |
newOutputStream(java.lang.String type)
Acquire a new output stream. |
void |
setColorConverter(ColorConverter converter)
Setter for the color converter. |
protected void |
setExtension(java.lang.String extension)
Setter for extension. |
void |
setFontFactory(CoreFontFactory factory)
Setter for the font factory. |
void |
setOutputStreamFactory(OutputStreamFactory factory)
Setter for the output stream. |
void |
setParameter(java.lang.String name,
java.lang.String value)
Setter for a named parameter. |
void |
setResourceFinder(ResourceFinder resourceFinder)
Setter for the resource finder. |
protected void |
startFile(java.io.PrintStream out,
java.lang.String magicVersion)
Fill the initial segment of a PostScript file. |
protected void |
writeBoundingBox(java.io.PrintStream stream,
FixedDimen width,
FixedDimen height)
Write a BoundingBox DSC to an output stream. |
protected void |
writeDsc(java.io.PrintStream stream,
java.lang.String name,
java.lang.String... values)
Write a meta comment according to the Document Structuring Conventions. |
protected void |
writeFonts(java.io.PrintStream stream,
FontManager fontManager)
Write a meta comment according to the Document Structuring Conventions containing the DocumentFonts. |
protected void |
writeHighResBoundingBox(java.io.PrintStream stream,
NodeList nodes)
Write a HiResBoundingBox DSC to an output stream. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.extex.backend.documentWriter.DocumentWriter |
|---|
close, shipout |
| Field Detail |
|---|
protected static final byte[] COMMENT
protected static final java.text.DateFormat DF
| Constructor Detail |
|---|
public AbstractPostscriptWriter(java.lang.String extension)
extension - the default extension| Method Detail |
|---|
public void configure(Configuration config)
throws ConfigurationException
config - the configuration object to consider
ConfigurationException - in case that something went wrongorg.extex.framework.configuration.Configurable#configure(
org.extex.framework.configuration.Configuration)
protected PsConverter getConverter()
throws java.io.IOException
java.io.IOException - in case of an IO errorpublic java.lang.String getExtension()
getExtension in interface DocumentWriterDocumentWriter.getExtension()public CoreFontFactory getFontFactory()
protected FontManager getFontManager()
protected java.lang.String getParameter(java.lang.String name)
name - the name of the parameter
null if none exists
protected java.io.PrintStream newOutputStream(java.lang.String type)
throws DocumentWriterException
type - the type for the reference to the configuration file
DocumentWriterException - in case of an errorpublic void setColorConverter(ColorConverter converter)
setColorConverter in interface ColorAwareconverter - the color converterColorAware.setColorConverter(
org.extex.color.ColorConverter)protected void setExtension(java.lang.String extension)
extension - the extension to setpublic void setFontFactory(CoreFontFactory factory)
setFontFactory in interface FontAwarefactory - the font factoryFontAware.setFontFactory(org.extex.font.CoreFontFactory)public void setOutputStreamFactory(OutputStreamFactory factory)
setOutputStreamFactory in interface MultipleDocumentStreamfactory - the output streamMultipleDocumentStream.setOutputStreamFactory(
org.extex.backend.outputStream.OutputStreamFactory)
public void setParameter(java.lang.String name,
java.lang.String value)
This document writer uses the following parameters:
setParameter in interface DocumentWritername - the name of the parametervalue - the value of the parameterDocumentWriter.setParameter(
java.lang.String, java.lang.String)public void setResourceFinder(ResourceFinder resourceFinder)
resourceFinder - the resource finderorg.extex.resource.ResourceAware#setResourceFinder(
org.extex.resource.ResourceFinder)
protected void startFile(java.io.PrintStream out,
java.lang.String magicVersion)
throws java.io.IOException
out - the output streammagicVersion - the version string
java.io.IOException - in case of an I/O error
protected void writeBoundingBox(java.io.PrintStream stream,
FixedDimen width,
FixedDimen height)
throws java.io.IOException
stream - the target stream to write towidth - the widthheight - the height (including the depth)
java.io.IOException - in case of an error during writing
protected void writeDsc(java.io.PrintStream stream,
java.lang.String name,
java.lang.String... values)
throws java.io.IOException
stream - the target stream to write toname - the name of the DSC commentvalues - the value of the DSC comment
java.io.IOException - in case of an error during writing
protected void writeFonts(java.io.PrintStream stream,
FontManager fontManager)
throws java.io.IOException
stream - the target stream to write tofontManager - the font manager to ask for the fonts
java.io.IOException - in case of an error during writing
protected void writeHighResBoundingBox(java.io.PrintStream stream,
NodeList nodes)
throws java.io.IOException
stream - the target stream to write tonodes - the nodes to extract the dimensions from
java.io.IOException - in case of an error during writing
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||