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.ListscriptsVector 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 voidcomputeAllowedScripts()Helper method.voiddisplayError(java.lang.Exception e)Displays the specified error using theErrorHandler.voiddisplayError(java.lang.String message)Displays the specified error message using theErrorHandler.voiddisplayMessage(java.lang.String message)Displays the specified message using theErrorHandler.java.lang.StringgetAlternateStyleSheet()Returns this user agent's alternate style-sheet title.java.lang.StringgetDefaultFontFamily()Returns the default font family.ExternalResourceSecuritygetExternalResourceSecurity(ParsedURL resourceURL, ParsedURL docURL)Returns the security settings for the given resource url and document urljava.lang.StringgetLanguages()Returns the user language specified in theTranscodingHintsor "en" (english) if any.java.lang.StringgetMedia()Returns this user agent's CSS media.floatgetPixelUnitToMillimeter()Returns the pixel to millimeter conversion factor specified in theTranscodingHintsor 0.26458333 if not specified.ScriptSecuritygetScriptSecurity(java.lang.String scriptType, ParsedURL scriptPURL, ParsedURL docPURL)Returns the security settings for the given script type, script url and document urljava.awt.geom.AffineTransformgetTransform()Return the rendering transform.java.lang.StringgetUserStyleSheetURI()Returns the user stylesheet specified in theTranscodingHintsor null if any.java.awt.geom.Dimension2DgetViewportSize()Returns the default size of this user agent (400x400).java.lang.StringgetXMLParserClassName()Returns the XML parser to use from the TranscodingHints.booleanisAllowExternalResources()booleanisXMLParserValidating()Returns true if the XML parser must be in validation mode, false otherwise.voidsetTransform(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:
getTransformin interfaceUserAgent- Overrides:
getTransformin classUserAgentAdapter
-
setTransform
public void setTransform(java.awt.geom.AffineTransform at)
Return the rendering transform.- Specified by:
setTransformin interfaceUserAgent- Overrides:
setTransformin classUserAgentAdapter
-
getViewportSize
public java.awt.geom.Dimension2D getViewportSize()
Returns the default size of this user agent (400x400).- Specified by:
getViewportSizein interfaceUserAgent- Overrides:
getViewportSizein classUserAgentAdapter
-
displayError
public void displayError(java.lang.String message)
Displays the specified error message using theErrorHandler.- Overrides:
displayErrorin classUserAgentAdapter
-
displayError
public void displayError(java.lang.Exception e)
Displays the specified error using theErrorHandler.- Specified by:
displayErrorin interfaceUserAgent- Overrides:
displayErrorin classUserAgentAdapter
-
displayMessage
public void displayMessage(java.lang.String message)
Displays the specified message using theErrorHandler.- Specified by:
displayMessagein interfaceUserAgent- Overrides:
displayMessagein classUserAgentAdapter
-
getPixelUnitToMillimeter
public float getPixelUnitToMillimeter()
Returns the pixel to millimeter conversion factor specified in theTranscodingHintsor 0.26458333 if not specified.- Specified by:
getPixelUnitToMillimeterin interfaceUserAgent- Overrides:
getPixelUnitToMillimeterin classUserAgentAdapter
-
getLanguages
public java.lang.String getLanguages()
Returns the user language specified in theTranscodingHintsor "en" (english) if any.- Specified by:
getLanguagesin interfaceUserAgent- Overrides:
getLanguagesin classUserAgentAdapter
-
getMedia
public java.lang.String getMedia()
Returns this user agent's CSS media.- Specified by:
getMediain interfaceUserAgent- Overrides:
getMediain classUserAgentAdapter
-
getDefaultFontFamily
public java.lang.String getDefaultFontFamily()
Returns the default font family.- Specified by:
getDefaultFontFamilyin interfaceUserAgent- Overrides:
getDefaultFontFamilyin classUserAgentAdapter
-
getAlternateStyleSheet
public java.lang.String getAlternateStyleSheet()
Returns this user agent's alternate style-sheet title.- Specified by:
getAlternateStyleSheetin interfaceUserAgent- Overrides:
getAlternateStyleSheetin classUserAgentAdapter
-
getUserStyleSheetURI
public java.lang.String getUserStyleSheetURI()
Returns the user stylesheet specified in theTranscodingHintsor null if any.- Specified by:
getUserStyleSheetURIin interfaceUserAgent- Overrides:
getUserStyleSheetURIin 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:
getXMLParserClassNamein interfaceUserAgent- Overrides:
getXMLParserClassNamein classUserAgentAdapter
-
isXMLParserValidating
public boolean isXMLParserValidating()
Returns true if the XML parser must be in validation mode, false otherwise.- Specified by:
isXMLParserValidatingin interfaceUserAgent- Overrides:
isXMLParserValidatingin 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:
getScriptSecurityin interfaceUserAgent- Overrides:
getScriptSecurityin 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:UserAgentAdapterReturns the security settings for the given resource url and document url- Specified by:
getExternalResourceSecurityin interfaceUserAgent- Overrides:
getExternalResourceSecurityin 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()
-
-