public abstract class Renderer extends java.lang.Object implements java.lang.Comparable<Renderer>, java.lang.Cloneable
RendererFactory,
OutputFormat| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_PRIORITY |
static java.lang.String |
XML_ATTR_CLASS |
static java.lang.String |
XML_ATTR_CONFIG_EDITOR |
static java.lang.String |
XML_ATTR_CONFIG_FILE |
static java.lang.String |
XML_ATTR_NAME |
static java.lang.String |
XML_ATTR_PRIORTIY |
static java.lang.String |
XML_ATTR_RESET_IMAGE_CACHE |
static java.lang.String |
XML_ATTR_USE_JFO_LOGGING |
static java.lang.String |
XML_NODE_RENDERER |
| Modifier | Constructor and Description |
|---|---|
protected |
Renderer() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
afterRendering()
Invoked after rendering.
|
protected void |
beforeRendering()
Invoked before rendering starts.
|
boolean |
canRender(OutputFormat format)
Deprecated.
Use supportsFormat(OutputFormat) instead.
|
int |
compareTo(Renderer o) |
void |
configure(de.vc.config.Configuration config)
Configures this renderer.
|
Renderer |
copy()
Clones this renderer.
|
protected java.awt.print.PrinterJob |
createPrinterJob()
Creates a new print-job that subclasses could use to print a XSL-FO document.
|
protected void |
doRender(Document document,
java.io.OutputStream outStream,
OutputFormat format)
Renders the given document using this renderer.
|
protected abstract void |
doRender(java.io.InputStream foStream,
java.io.OutputStream outStream,
OutputFormat outputFormat)
Do render a FO-stream (Stream is in XML, not in XSL).
|
boolean |
equals(java.lang.Object o) |
java.lang.String |
getConfigFile()
Gets the location of the configuration file if there is any.
|
abstract java.lang.String |
getDisplayName()
Gets the display name of renderer that can be shown in GUIs.
|
RTF2FOCompatibilityMode |
getPreferredRTF2FOCompatibilityMode()
Gets the preferred compatibility mode for RTF to XSL-FO transformation
or null if there is no preferation.
|
PrinterJobFactory |
getPrinterJobFactory()
Gets the factory for creating print jobs.
|
int |
getPriority()
Gets the priority of this renderer.
|
abstract OutputFormat[] |
getSupportedOutputFormats()
Gets an array of all supported output formats.
|
boolean |
isReady()
Checks if this renderer has all needed resources (external classes,
configuration files etc) to renderer a document.
|
boolean |
isUseJFOLogging()
Returns
true if logs of renderers are written through
JFO's logger. |
protected void |
logUnsupportedFormat(OutputFormat format)
This methode is called, if this logger can't render into given format.
|
void |
reconfigure() |
void |
render(Document document,
java.io.File outputFile,
OutputFormat format)
Renders the given document using this renderer.
|
void |
render(Document document,
OutputFormat format)
Renders the given document into a non file (AWT, PRINT, TREE_VIEWER) format.
|
void |
render(Document document,
java.io.OutputStream outStream,
OutputFormat format)
Renders the given document using this renderer.
|
void |
render(java.io.InputStream foStream,
java.io.OutputStream outStream,
OutputFormat format)
Render an XSL-FO stream.
|
protected java.net.URL |
resolveConfig() |
void |
setConfigFile(java.lang.String configFile)
Sets the location of configuration file if this renderer uses a separate,
external file for intialization.
|
void |
setPrinterJobFactory(PrinterJobFactory fac)
Sets the factory that is used to create PrinterJobs if printer-output is
required.
|
void |
setPriority(int priority)
Sets the priority of this renderer.
|
void |
setUseJFOLogging(boolean jfoLogging) |
boolean |
supportsFormat(OutputFormat format)
Checks whether this renderer can generated a given output format.
|
public static final java.lang.String XML_NODE_RENDERER
public static final java.lang.String XML_ATTR_CONFIG_FILE
public static final java.lang.String XML_ATTR_CLASS
public static final java.lang.String XML_ATTR_NAME
public static final java.lang.String XML_ATTR_PRIORTIY
public static final java.lang.String XML_ATTR_CONFIG_EDITOR
public static final java.lang.String XML_ATTR_USE_JFO_LOGGING
public static final java.lang.String XML_ATTR_RESET_IMAGE_CACHE
public static final int DEFAULT_PRIORITY
public abstract java.lang.String getDisplayName()
public abstract OutputFormat[] getSupportedOutputFormats()
public final void render(Document document, OutputFormat format) throws java.lang.Exception
document - Document.format - Non-file output format (see OutputFormat.*).java.lang.Exception - This renderer may throw an exception.public final void render(Document document, java.io.OutputStream outStream, OutputFormat format) throws java.lang.Exception
document - Document.outStream - Output stream.format - Output format (see OutputFormat.*).java.lang.Exception - This renderer may throw an exception.public final void render(java.io.InputStream foStream,
java.io.OutputStream outStream,
OutputFormat format)
throws java.lang.Exception
foStream - FO-stream.outStream - Output stream, where rendered FO should be stored into.format - Outputformat (see OutputFormat.*).java.lang.Exception - Throw an exception in necessary.public final void render(Document document, java.io.File outputFile, OutputFormat format) throws java.lang.Exception
document - Document.outputFile - Output file.format - Output format (see OutputFormat.*).java.lang.Exception - This renderer may throw an exception.public boolean supportsFormat(OutputFormat format)
format - OutputFormat.public boolean canRender(OutputFormat format)
format - OutputFormat.supportsFormat(OutputFormat)public void configure(de.vc.config.Configuration config)
throws de.vc.config.ConfigurationException
config - Configurationde.vc.config.ConfigurationExceptionpublic boolean isReady()
public int getPriority()
public void setPriority(int priority)
priority - intpublic void reconfigure()
throws de.vc.config.ConfigurationException
de.vc.config.ConfigurationExceptionpublic RTF2FOCompatibilityMode getPreferredRTF2FOCompatibilityMode()
public void setUseJFOLogging(boolean jfoLogging)
jfoLogging - booleanpublic boolean isUseJFOLogging()
true if logs of renderers are written through
JFO's logger.JFOConfig.getLogger()public void setPrinterJobFactory(PrinterJobFactory fac)
fac - Factory for PrinterJobs.public PrinterJobFactory getPrinterJobFactory()
public java.lang.String getConfigFile()
public void setConfigFile(java.lang.String configFile)
configFile - Stringpublic Renderer copy()
public int compareTo(Renderer o)
compareTo in interface java.lang.Comparable<Renderer>public boolean equals(java.lang.Object o)
equals in class java.lang.Objectprotected abstract void doRender(java.io.InputStream foStream,
java.io.OutputStream outStream,
OutputFormat outputFormat)
throws java.lang.Exception
foStream - FO-stream.outStream - Output stream, where rendered FO should be stored into.outputFormat - Outputformat (see OUTPUT_*).java.lang.Exception - Throw an exception in necessary.protected void doRender(Document document, java.io.OutputStream outStream, OutputFormat format) throws java.lang.Exception
document - Document.outStream - Output.format - Output format.java.lang.Exception - This renderer may throw an exception.protected void logUnsupportedFormat(OutputFormat format)
format - Format that is not supported.protected void beforeRendering()
throws java.lang.Exception
java.lang.Exceptionprotected void afterRendering()
throws java.lang.Exception
java.lang.Exceptionprotected java.awt.print.PrinterJob createPrinterJob()
protected java.net.URL resolveConfig()
© 2003-2011 by Sascha Schmidt (vision-cloud.de). All Rights Reserved.