diff options
author | Jeremias Maerki <jeremias@apache.org> | 2003-11-07 21:54:32 +0000 |
---|---|---|
committer | Jeremias Maerki <jeremias@apache.org> | 2003-11-07 21:54:32 +0000 |
commit | a2da25b8b53ea2de45b105a142987a89d9d78537 (patch) | |
tree | a048b66d4d52eca189c5d6801ca743eca982c409 /src/java/org/apache/fop/svg/AbstractFOPTranscoder.java | |
parent | ddee324d2e8b091aceeb18d1abe01859cf4cb497 (diff) | |
download | xmlgraphics-fop-a2da25b8b53ea2de45b105a142987a89d9d78537.tar.gz xmlgraphics-fop-a2da25b8b53ea2de45b105a142987a89d9d78537.zip |
Use different base class for user agent.
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@196988 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/fop/svg/AbstractFOPTranscoder.java')
-rw-r--r-- | src/java/org/apache/fop/svg/AbstractFOPTranscoder.java | 80 |
1 files changed, 17 insertions, 63 deletions
diff --git a/src/java/org/apache/fop/svg/AbstractFOPTranscoder.java b/src/java/org/apache/fop/svg/AbstractFOPTranscoder.java index e4f17c6d4..00e1922d3 100644 --- a/src/java/org/apache/fop/svg/AbstractFOPTranscoder.java +++ b/src/java/org/apache/fop/svg/AbstractFOPTranscoder.java @@ -65,8 +65,10 @@ import org.apache.batik.dom.svg.SVGDOMImplementation; import org.apache.batik.dom.util.DocumentFactory; import org.apache.batik.transcoder.ErrorHandler; import org.apache.batik.transcoder.TranscoderException; +import org.apache.batik.transcoder.TranscodingHints; import org.apache.batik.transcoder.SVGAbstractTranscoder; import org.apache.batik.transcoder.image.ImageTranscoder; +import org.apache.batik.transcoder.keys.BooleanKey; import org.apache.batik.util.SVGConstants; import org.apache.batik.util.XMLResourceDescriptor; import org.w3c.dom.DOMImplementation; @@ -78,6 +80,18 @@ public abstract class AbstractFOPTranscoder extends SVGAbstractTranscoder implements LogEnabled { /** + * The key to specify whether to stroke text instead of using text + * operations. + */ + public static final TranscodingHints.Key KEY_STROKE_TEXT = new BooleanKey(); + + /** The value to turn on text stroking. */ + public static final Boolean VALUE_FORMAT_ON = Boolean.TRUE; + + /** The value to turn off text stroking. */ + public static final Boolean VALUE_FORMAT_OFF = Boolean.FALSE; + + /** * The user agent dedicated to this Transcoder. */ protected UserAgent userAgent = createUserAgent(); @@ -143,8 +157,8 @@ public abstract class AbstractFOPTranscoder extends SVGAbstractTranscoder */ protected DocumentFactory createDocumentFactory(DOMImplementation domImpl, String parserClassname) { - final FOPSAXSVGDocumentFactory factory = - new FOPSAXSVGDocumentFactory(parserClassname); + final FOPSAXSVGDocumentFactory factory + = new FOPSAXSVGDocumentFactory(parserClassname); if (this.resolver != null) { factory.setAdditionalEntityResolver(this.resolver); } @@ -195,15 +209,7 @@ public abstract class AbstractFOPTranscoder extends SVGAbstractTranscoder /** * A user agent implementation for FOP's Transcoders. */ - protected class FOPTranscoderUserAgent extends UserAgentAdapter { - - /** - * Returns the default size of this user agent (400x400). - * @return the default viewport size - */ - public Dimension2D getViewportSize() { - return new Dimension(400, 400); - } + protected class FOPTranscoderUserAgent extends SVGAbstractTranscoderUserAgent { /** * Displays the specified error message using the <tt>ErrorHandler</tt>. @@ -253,20 +259,6 @@ public abstract class AbstractFOPTranscoder extends SVGAbstractTranscoder } /** - * Returns the user language specified in the - * <tt>TranscodingHints</tt> or "en" (english) if any. - * @return the languages for the transcoder - */ - public String getLanguages() { - Object key = ImageTranscoder.KEY_LANGUAGE; - if (getTranscodingHints().containsKey(key)) { - return (String)getTranscodingHints().get(key); - } else { - return "en"; - } - } - - /** * Get the media for this transcoder. Which is always print. * @return PDF media is "print" */ @@ -274,44 +266,6 @@ public abstract class AbstractFOPTranscoder extends SVGAbstractTranscoder return "print"; } - /** - * Returns the user stylesheet specified in the - * <tt>TranscodingHints</tt> or null if any. - * @return the user style sheet URI specified in the hints - */ - public String getUserStyleSheetURI() { - return (String)getTranscodingHints() - .get(ImageTranscoder.KEY_USER_STYLESHEET_URI); - } - - /** - * Returns the XML parser to use from the TranscodingHints. - * @return the XML parser class name - */ - public String getXMLParserClassName() { - Object key = KEY_XML_PARSER_CLASSNAME; - if (getTranscodingHints().containsKey(key)) { - return (String)getTranscodingHints().get(key); - } else { - return XMLResourceDescriptor.getXMLParserClassName(); - } - } - - /** - * Check if the XML parser is validating. - * @return true if the XML parser is validating - */ - public boolean isXMLParserValidating() { - return false; - } - - /** - * Unsupported operation. - * @return null since this is unsupported - */ - public AffineTransform getTransform() { - return null; - } } } |