diff options
author | Jeremias Maerki <jeremias@apache.org> | 2005-11-11 13:44:40 +0000 |
---|---|---|
committer | Jeremias Maerki <jeremias@apache.org> | 2005-11-11 13:44:40 +0000 |
commit | 82b916bf0d5dff2475e7b591e6ada7d45fa1b2b9 (patch) | |
tree | 299bd11ae1cb5d1f812fdf912ffc775bfafdb600 /src/java/org/apache/fop/area | |
parent | 97581a9081ec184b9755bdc07ce049df9419ca06 (diff) | |
download | xmlgraphics-fop-82b916bf0d5dff2475e7b591e6ada7d45fa1b2b9.tar.gz xmlgraphics-fop-82b916bf0d5dff2475e7b591e6ada7d45fa1b2b9.zip |
Fop.java gets two new constructors: Fop(String) and Fop(String, FOUserAgent) where the String is the MIME type for the desired output format.
MimeConstants provides a comprehensive list of MIME types used in Fop.java.
Non-standard, FOP-specific MIME types changed to a uniform pattern: application/X-fop-awt-preview, application/X-fop-print and application/X-fop-areatree.
RendererFactory now supports manual registration and dynamic discovery of Renderers and FOEventHandlers by their MIME types. Instantitation is done using MIME types everywhere.
The RENDER_* constants are mapped to MIME types in Fop.java.
RendererFactory is now an instantiable class whose reference is held by FOUserAgent just like it is done for the XLMHandlers.
Renderers and FOEventHandlers now each have a *Maker class which is a kind of factory class which is used to register a Renderer/FOEventHandler and additionally serves to provide additional information about the thing, such as the MIME types it supports and if the implementation requires an OutputStream.
The command-line gets a new option: -out application/pdf myfile.pdf is the generic way to create an output file. If someone created a WordML output handler and provided the right service resource file he could specify "-out text/xml+msword out.xml". ".out list" lists all MIME types that are available for output.
Renderers can now potionally expose a Graphics2DAdapter which in concert with Graphics2DImagePainter can be used by FOP extensions to paint their content directly using a Graphics2D instance. That makes it possible to avoid a detour via SVG/Batik in certain cases.
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@332549 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/fop/area')
-rw-r--r-- | src/java/org/apache/fop/area/AreaTreeHandler.java | 7 | ||||
-rw-r--r-- | src/java/org/apache/fop/area/CachedRenderPagesModel.java | 8 | ||||
-rw-r--r-- | src/java/org/apache/fop/area/RenderPagesModel.java | 8 |
3 files changed, 11 insertions, 12 deletions
diff --git a/src/java/org/apache/fop/area/AreaTreeHandler.java b/src/java/org/apache/fop/area/AreaTreeHandler.java index 183ca8896..df7b74fb3 100644 --- a/src/java/org/apache/fop/area/AreaTreeHandler.java +++ b/src/java/org/apache/fop/area/AreaTreeHandler.java @@ -103,16 +103,15 @@ public class AreaTreeHandler extends FOEventHandler { /** * Constructor. * @param userAgent FOUserAgent object for process - * @param renderType Desired fo.Constants output type (RENDER_PDF, - * RENDER_PS, etc.) + * @param outputFormat the MIME type of the output format to use (ex. "application/pdf"). * @param stream OutputStream * @throws FOPException if the RenderPagesModel cannot be created */ - public AreaTreeHandler (FOUserAgent userAgent, int renderType, + public AreaTreeHandler (FOUserAgent userAgent, String outputFormat, OutputStream stream) throws FOPException { super(userAgent); - model = new RenderPagesModel(userAgent, renderType, fontInfo, + model = new RenderPagesModel(userAgent, outputFormat, fontInfo, stream); lmMaker = userAgent.getLayoutManagerMakerOverride(); diff --git a/src/java/org/apache/fop/area/CachedRenderPagesModel.java b/src/java/org/apache/fop/area/CachedRenderPagesModel.java index d86e9913b..6737ccb5a 100644 --- a/src/java/org/apache/fop/area/CachedRenderPagesModel.java +++ b/src/java/org/apache/fop/area/CachedRenderPagesModel.java @@ -46,11 +46,11 @@ public class CachedRenderPagesModel extends RenderPagesModel { /** * Constructor - * @see org.apache.fop.area.RenderPagesModel#RenderPagesModel(FOUserAgent, int, FontInfo, OutputStream) + * @see org.apache.fop.area.RenderPagesModel#RenderPagesModel(FOUserAgent, String, FontInfo, OutputStream) */ - public CachedRenderPagesModel (FOUserAgent userAgent, int renderType, - FontInfo fontInfo, OutputStream stream) throws FOPException { - super(userAgent, renderType, fontInfo, stream); + public CachedRenderPagesModel (FOUserAgent userAgent, String outputFormat, + FontInfo fontInfo, OutputStream stream) throws FOPException { + super(userAgent, outputFormat, fontInfo, stream); } /** diff --git a/src/java/org/apache/fop/area/RenderPagesModel.java b/src/java/org/apache/fop/area/RenderPagesModel.java index 505902e33..a3c6eda27 100644 --- a/src/java/org/apache/fop/area/RenderPagesModel.java +++ b/src/java/org/apache/fop/area/RenderPagesModel.java @@ -58,17 +58,17 @@ public class RenderPagesModel extends AreaTreeModel { /** * Create a new render pages model with the given renderer. * @param userAgent FOUserAgent object for process - * @param renderType Desired fo.Constants output type (RENDER_PDF, - * RENDER_PS, etc.) + * @param outputFormat the MIME type of the output format to use (ex. "application/pdf"). * @param fontInfo FontInfo object * @param stream OutputStream * @throws FOPException if the renderer cannot be properly initialized */ - public RenderPagesModel (FOUserAgent userAgent, int renderType, + public RenderPagesModel (FOUserAgent userAgent, String outputFormat, FontInfo fontInfo, OutputStream stream) throws FOPException { super(); - renderer = RendererFactory.createRenderer(userAgent, renderType); + renderer = userAgent.getRendererFactory().createRenderer( + userAgent, outputFormat); try { renderer.setupFontInfo(fontInfo); |