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
A user agent implementation for
PrintTranscoder
.-
Field Summary
FieldsFields inherited from class org.apache.batik.bridge.UserAgentAdapter
ctx, extensions, FEATURES
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
Helper method.void
Displays the specified error using theErrorHandler
.void
displayError
(String message) Displays the specified error message using theErrorHandler
.void
displayMessage
(String message) Displays the specified message using theErrorHandler
.Returns this user agent's alternate style-sheet title.Returns the default font family.getExternalResourceSecurity
(ParsedURL resourceURL, ParsedURL docURL) Returns the security settings for the given resource url and document urlReturns the user language specified in theTranscodingHints
or "en" (english) if any.getMedia()
Returns this user agent's CSS media.float
Returns the pixel to millimeter conversion factor specified in theTranscodingHints
or 0.26458333 if not specified.getScriptSecurity
(String scriptType, ParsedURL scriptPURL, ParsedURL docPURL) Returns the security settings for the given script type, script url and document urlReturn the rendering transform.Returns the user stylesheet specified in theTranscodingHints
or null if any.Returns the default size of this user agent (400x400).Returns the XML parser to use from the TranscodingHints.boolean
boolean
Returns true if the XML parser must be in validation mode, false otherwise.void
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
-
Field Details
-
scripts
Vector containing the allowed script types
-
-
Constructor Details
-
SVGAbstractTranscoderUserAgent
public SVGAbstractTranscoderUserAgent()
-
-
Method Details
-
getTransform
Return the rendering transform.- Specified by:
getTransform
in interfaceUserAgent
- Overrides:
getTransform
in classUserAgentAdapter
-
setTransform
Return the rendering transform.- Specified by:
setTransform
in interfaceUserAgent
- Overrides:
setTransform
in classUserAgentAdapter
-
getViewportSize
Returns the default size of this user agent (400x400).- Specified by:
getViewportSize
in interfaceUserAgent
- Overrides:
getViewportSize
in classUserAgentAdapter
-
displayError
Displays the specified error message using theErrorHandler
.- Overrides:
displayError
in classUserAgentAdapter
-
displayError
Displays the specified error using theErrorHandler
.- Specified by:
displayError
in interfaceUserAgent
- Overrides:
displayError
in classUserAgentAdapter
-
displayMessage
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
Returns the user language specified in theTranscodingHints
or "en" (english) if any.- Specified by:
getLanguages
in interfaceUserAgent
- Overrides:
getLanguages
in classUserAgentAdapter
-
getMedia
Returns this user agent's CSS media.- Specified by:
getMedia
in interfaceUserAgent
- Overrides:
getMedia
in classUserAgentAdapter
-
getDefaultFontFamily
Returns the default font family.- Specified by:
getDefaultFontFamily
in interfaceUserAgent
- Overrides:
getDefaultFontFamily
in classUserAgentAdapter
-
getAlternateStyleSheet
Returns this user agent's alternate style-sheet title.- Specified by:
getAlternateStyleSheet
in interfaceUserAgent
- Overrides:
getAlternateStyleSheet
in classUserAgentAdapter
-
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
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
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()
-