diff options
author | Simon Pepping <spepping@apache.org> | 2004-07-09 20:05:41 +0000 |
---|---|---|
committer | Simon Pepping <spepping@apache.org> | 2004-07-09 20:05:41 +0000 |
commit | 0e3b8e7d4dbbb263c4a60844ee5c055e8f359bf2 (patch) | |
tree | ea9c1ac6d03acb0efc024ff49a51a9d6d7e5aab0 | |
parent | d04908a05ef64a2850289f6817125bd8a02c9088 (diff) | |
download | xmlgraphics-fop-0e3b8e7d4dbbb263c4a60844ee5c055e8f359bf2.tar.gz xmlgraphics-fop-0e3b8e7d4dbbb263c4a60844ee5c055e8f359bf2.zip |
Adding reporting of mime type to renderers.
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@197775 13f79535-47bb-0310-9956-ffa450edef68
5 files changed, 36 insertions, 0 deletions
diff --git a/src/java/org/apache/fop/render/awt/AWTRenderer.java b/src/java/org/apache/fop/render/awt/AWTRenderer.java index 57b94ea0a..975f631f4 100644 --- a/src/java/org/apache/fop/render/awt/AWTRenderer.java +++ b/src/java/org/apache/fop/render/awt/AWTRenderer.java @@ -69,6 +69,9 @@ import org.apache.fop.render.awt.viewer.Translator; */ public class AWTRenderer extends AbstractRenderer implements Printable, Pageable { + /** The MIME type for PostScript */ + public static final String MIME_TYPE = "application/awt"; + protected double scaleFactor = 100.0; protected int pageNumber = 0; private int pageWidth = 0; @@ -458,4 +461,10 @@ public class AWTRenderer extends AbstractRenderer implements Printable, Pageable // TODO: render text decorations currentBlockIPPosition += text.getWidth(); } + + /** @see org.apache.fop.render.AbstractRenderer */ + public String getMimeType() { + return MIME_TYPE; + } + } diff --git a/src/java/org/apache/fop/render/pcl/PCLRenderer.java b/src/java/org/apache/fop/render/pcl/PCLRenderer.java index 3be4ac45b..77fc15a8d 100644 --- a/src/java/org/apache/fop/render/pcl/PCLRenderer.java +++ b/src/java/org/apache/fop/render/pcl/PCLRenderer.java @@ -32,6 +32,9 @@ import java.io.OutputStream; */ public class PCLRenderer extends PrintRenderer { + /** The MIME type for PCL */ + public static final String MIME_TYPE = "application/vnd.hp-PCL"; + /** * the current stream to add PCL commands to */ @@ -174,4 +177,9 @@ public class PCLRenderer extends PrintRenderer { public void stopRenderer() throws IOException { } + /** @see org.apache.fop.render.AbstractRenderer */ + public String getMimeType() { + return MIME_TYPE; + } + } diff --git a/src/java/org/apache/fop/render/svg/SVGRenderer.java b/src/java/org/apache/fop/render/svg/SVGRenderer.java index fd7c855cf..55c34dd1a 100644 --- a/src/java/org/apache/fop/render/svg/SVGRenderer.java +++ b/src/java/org/apache/fop/render/svg/SVGRenderer.java @@ -414,5 +414,11 @@ public class SVGRenderer extends AbstractRenderer implements XMLHandler { super.renderCharacter(ch); } + + /** @see org.apache.fop.render.AbstractRenderer */ + public String getMimeType() { + return SVG_MIME_TYPE; + } + } diff --git a/src/java/org/apache/fop/render/txt/TXTRenderer.java b/src/java/org/apache/fop/render/txt/TXTRenderer.java index 4f743d673..c24cb1866 100644 --- a/src/java/org/apache/fop/render/txt/TXTRenderer.java +++ b/src/java/org/apache/fop/render/txt/TXTRenderer.java @@ -31,6 +31,9 @@ import org.apache.fop.render.pcl.PCLStream; */ public class TXTRenderer extends PrintRenderer { + /** The MIME type for PostScript */ + public static final String MIME_TYPE = "text/plain"; + /** * the current stream to add Text commands to */ @@ -128,4 +131,9 @@ public class TXTRenderer extends PrintRenderer { } } + /** @see org.apache.fop.render.AbstractRenderer */ + public String getMimeType() { + return MIME_TYPE; + } + } diff --git a/src/java/org/apache/fop/render/xml/XMLRenderer.java b/src/java/org/apache/fop/render/xml/XMLRenderer.java index d73e32556..a3d38897d 100644 --- a/src/java/org/apache/fop/render/xml/XMLRenderer.java +++ b/src/java/org/apache/fop/render/xml/XMLRenderer.java @@ -495,5 +495,10 @@ public class XMLRenderer extends AbstractRenderer { return strbuf.toString(); } + /** @see org.apache.fop.render.AbstractRenderer */ + public String getMimeType() { + return XML_MIME_TYPE; + } + } |