Package org.apache.batik.transcoder
Class SVGAbstractTranscoder.SVGAbstractTranscoderUserAgent
- java.lang.Object
-
- org.apache.batik.bridge.UserAgentAdapter
-
- org.apache.batik.transcoder.SVGAbstractTranscoder.SVGAbstractTranscoderUserAgent
-
- All Implemented Interfaces:
UserAgent
- Enclosing class:
- SVGAbstractTranscoder
protected class SVGAbstractTranscoder.SVGAbstractTranscoderUserAgent extends UserAgentAdapter
A user agent implementation forPrintTranscoder
.
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.List
scripts
Vector containing the allowed script types-
Fields inherited from class org.apache.batik.bridge.UserAgentAdapter
ctx, extensions, FEATURES
-
-
Constructor Summary
Constructors Constructor Description SVGAbstractTranscoderUserAgent()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
computeAllowedScripts()
Helper method.void
displayError(java.lang.Exception e)
Displays the specified error using theErrorHandler
.void
displayError(java.lang.String message)
Displays the specified error message using theErrorHandler
.void
displayMessage(java.lang.String message)
Displays the specified message using theErrorHandler
.java.lang.String
getAlternateStyleSheet()
Returns this user agent's alternate style-sheet title.java.lang.String
getDefaultFontFamily()
Returns the default font family.ExternalResourceSecurity
getExternalResourceSecurity(ParsedURL resourceURL, ParsedURL docURL)
Returns the security settings for the given resource url and document urljava.lang.String
getLanguages()
Returns the user language specified in theTranscodingHints
or "en" (english) if any.java.lang.String
getMedia()
Returns this user agent's CSS media.float
getPixelUnitToMillimeter()
Returns the pixel to millimeter conversion factor specified in theTranscodingHints
or 0.26458333 if not specified.ScriptSecurity
getScriptSecurity(java.lang.String scriptType, ParsedURL scriptPURL, ParsedURL docPURL)
Returns the security settings for the given script type, script url and document urljava.awt.geom.AffineTransform
getTransform()
Return the rendering transform.java.lang.String
getUserStyleSheetURI()
Returns the user stylesheet specified in theTranscodingHints
or null if any.java.awt.geom.Dimension2D
getViewportSize()
Returns the default size of this user agent (400x400).java.lang.String
getXMLParserClassName()
Returns the XML parser to use from the TranscodingHints.boolean
isAllowExternalResources()
boolean
isXMLParserValidating()
Returns true if the XML parser must be in validation mode, false otherwise.void
setTransform(java.awt.geom.AffineTransform at)
Return the rendering transform.-
Methods inherited from class org.apache.batik.bridge.UserAgentAdapter
addStdFeatures, checkLoadExternalResource, checkLoadScript, deselectAll, getBolderFontWeight, getBrokenLinkDocument, getClientAreaLocationOnScreen, getEventDispatcher, getFontFamilyResolver, getLighterFontWeight, getMediumFontSize, getPixelToMM, getStandardBolderFontWeight, getStandardLighterFontWeight, handleElement, hasFeature, loadDocument, openLink, registerExtension, runThread, setBridgeContext, setSVGCursor, setTextSelection, showAlert, showConfirm, showPrompt, showPrompt, supportExtension
-
-
-
-
Method Detail
-
getTransform
public java.awt.geom.AffineTransform getTransform()
Return the rendering transform.- Specified by:
getTransform
in interfaceUserAgent
- Overrides:
getTransform
in classUserAgentAdapter
-
setTransform
public void setTransform(java.awt.geom.AffineTransform at)
Return the rendering transform.- Specified by:
setTransform
in interfaceUserAgent
- Overrides:
setTransform
in classUserAgentAdapter
-
getViewportSize
public java.awt.geom.Dimension2D getViewportSize()
Returns the default size of this user agent (400x400).- Specified by:
getViewportSize
in interfaceUserAgent
- Overrides:
getViewportSize
in classUserAgentAdapter
-
displayError
public void displayError(java.lang.String message)
Displays the specified error message using theErrorHandler
.- Overrides:
displayError
in classUserAgentAdapter
-
displayError
public void displayError(java.lang.Exception e)
Displays the specified error using theErrorHandler
.- Specified by:
displayError
in interfaceUserAgent
- Overrides:
displayError
in classUserAgentAdapter
-
displayMessage
public void displayMessage(java.lang.String message)
Displays the specified message using theErrorHandler
.- Specified by:
displayMessage
in interfaceUserAgent
- Overrides:
displayMessage
in classUserAgentAdapter
-
getPixelUnitToMillimeter
public float getPixelUnitToMillimeter()
Returns the pixel to millimeter conversion factor specified in theTranscodingHints
or 0.26458333 if not specified.- Specified by:
getPixelUnitToMillimeter
in interfaceUserAgent
- Overrides:
getPixelUnitToMillimeter
in classUserAgentAdapter
-
getLanguages
public java.lang.String getLanguages()
Returns the user language specified in theTranscodingHints
or "en" (english) if any.- Specified by:
getLanguages
in interfaceUserAgent
- Overrides:
getLanguages
in classUserAgentAdapter
-
getMedia
public java.lang.String getMedia()
Returns this user agent's CSS media.- Specified by:
getMedia
in interfaceUserAgent
- Overrides:
getMedia
in classUserAgentAdapter
-
getDefaultFontFamily
public java.lang.String getDefaultFontFamily()
Returns the default font family.- Specified by:
getDefaultFontFamily
in interfaceUserAgent
- Overrides:
getDefaultFontFamily
in classUserAgentAdapter
-
getAlternateStyleSheet
public java.lang.String getAlternateStyleSheet()
Returns this user agent's alternate style-sheet title.- Specified by:
getAlternateStyleSheet
in interfaceUserAgent
- Overrides:
getAlternateStyleSheet
in classUserAgentAdapter
-
getUserStyleSheetURI
public java.lang.String getUserStyleSheetURI()
Returns the user stylesheet specified in theTranscodingHints
or null if any.- Specified by:
getUserStyleSheetURI
in interfaceUserAgent
- Overrides:
getUserStyleSheetURI
in classUserAgentAdapter
- Returns:
- null if no user style sheet was specified.
-
getXMLParserClassName
public java.lang.String getXMLParserClassName()
Returns the XML parser to use from the TranscodingHints.- Specified by:
getXMLParserClassName
in interfaceUserAgent
- Overrides:
getXMLParserClassName
in classUserAgentAdapter
-
isXMLParserValidating
public boolean isXMLParserValidating()
Returns true if the XML parser must be in validation mode, false otherwise.- Specified by:
isXMLParserValidating
in interfaceUserAgent
- Overrides:
isXMLParserValidating
in classUserAgentAdapter
-
getScriptSecurity
public ScriptSecurity getScriptSecurity(java.lang.String scriptType, ParsedURL scriptPURL, ParsedURL docPURL)
Returns the security settings for the given script type, script url and document url- Specified by:
getScriptSecurity
in interfaceUserAgent
- Overrides:
getScriptSecurity
in classUserAgentAdapter
- Parameters:
scriptType
- type of script, as found in the type attribute of the <script> element.scriptPURL
- url for the script, as defined in the script's xlink:href attribute. If that attribute was empty, then this parameter should be nulldocPURL
- url for the document into which the script was found.
-
computeAllowedScripts
protected void computeAllowedScripts()
Helper method. Builds a Vector containing the allowed values for the <script> element's type attribute.
-
getExternalResourceSecurity
public ExternalResourceSecurity getExternalResourceSecurity(ParsedURL resourceURL, ParsedURL docURL)
Description copied from class:UserAgentAdapter
Returns the security settings for the given resource url and document url- Specified by:
getExternalResourceSecurity
in interfaceUserAgent
- Overrides:
getExternalResourceSecurity
in classUserAgentAdapter
- Parameters:
resourceURL
- url for the resource, as defined in the resource's xlink:href attribute. If that attribute was empty, then this parameter should be nulldocURL
- url for the document into which the resource was found.
-
isAllowExternalResources
public boolean isAllowExternalResources()
-
-