## 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 for `PrintTranscoder`.

Field Summary
`protected java.util.Vector` `scripts` Vector containing the allowed script types

Fields inherited from class org.apache.batik.bridge.UserAgentAdapter
`extensions, FEATURES`

Constructor Summary
`SVGAbstractTranscoder.SVGAbstractTranscoderUserAgent()`

Method Summary
`protected void` `computeAllowedScripts()` Helper method.
`void` `displayError(java.lang.Exception e)` Displays the specified error using the `ErrorHandler`.
`void` `displayError(java.lang.String message)` Displays the specified error message using the `ErrorHandler`.
`void` `displayMessage(java.lang.String message)` Displays the specified message using the `ErrorHandler`.
`java.lang.String` `getAlternateStyleSheet()` Returns this user agent's alternate style-sheet title.
`java.lang.String` `getDefaultFontFamily()` Returns the default font family.
`java.lang.String` `getLanguages()` Returns the user language specified in the `TranscodingHints` 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 the `TranscodingHints` 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 url
`java.awt.geom.AffineTransform` `getTransform()` Return the rendering transform.
`java.lang.String` `getUserStyleSheetURI()` Returns the user stylesheet specified in the `TranscodingHints` 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` `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, getBolderFontWeight, getClientAreaLocationOnScreen, getEventDispatcher, getExternalResourceSecurity, getLighterFontWeight, getMediumFontSize, getPixelToMM, getStandardBolderFontWeight, getStandardLighterFontWeight, handleElement, hasFeature, openLink, registerExtension, runThread, setSVGCursor, setTextSelection, showAlert, showConfirm, showPrompt, showPrompt, supportExtension`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### scripts

    protected java.util.Vector scripts

  Vector containing the allowed script types

Constructor Detail

### SVGAbstractTranscoder.SVGAbstractTranscoderUserAgent

    public SVGAbstractTranscoder.SVGAbstractTranscoderUserAgent()

Method Detail

### getTransform

    public java.awt.geom.AffineTransform getTransform()

  Return the rendering transform.

  Specified by:
    `getTransform` in interface `UserAgent`
  Overrides:
    `getTransform` in class `UserAgentAdapter`

### setTransform

    public void setTransform(java.awt.geom.AffineTransform at)

  Return the rendering transform.

  Specified by:
    `setTransform` in interface `UserAgent`
  Overrides:
    `setTransform` in class `UserAgentAdapter`

### getViewportSize

    public java.awt.geom.Dimension2D getViewportSize()

  Returns the default size of this user agent (400x400).

  Specified by:
    `getViewportSize` in interface `UserAgent`
  Overrides:
    `getViewportSize` in class `UserAgentAdapter`

### displayError

    public void displayError(java.lang.String message)

  Displays the specified error message using the `ErrorHandler`.

  Overrides:
    `displayError` in class `UserAgentAdapter`

### displayError

    public void displayError(java.lang.Exception e)

  Displays the specified error using the `ErrorHandler`.

  Specified by:
    `displayError` in interface `UserAgent`
  Overrides:
    `displayError` in class `UserAgentAdapter`

### displayMessage

    public void displayMessage(java.lang.String message)

  Displays the specified message using the `ErrorHandler`.

  Specified by:
    `displayMessage` in interface `UserAgent`
  Overrides:
    `displayMessage` in class `UserAgentAdapter`

### getPixelUnitToMillimeter

    public float getPixelUnitToMillimeter()

  Returns the pixel to millimeter conversion factor specified in the `TranscodingHints` or 0.26458333 if not specified.

  Specified by:
    `getPixelUnitToMillimeter` in interface `UserAgent`
  Overrides:
    `getPixelUnitToMillimeter` in class `UserAgentAdapter`

### getLanguages

    public java.lang.String getLanguages()

  Returns the user language specified in the `TranscodingHints` or "en" (english) if any.

  Specified by:
    `getLanguages` in interface `UserAgent`
  Overrides:
    `getLanguages` in class `UserAgentAdapter`

### getMedia

    public java.lang.String getMedia()

  Returns this user agent's CSS media.

  Specified by:
    `getMedia` in interface `UserAgent`
  Overrides:
    `getMedia` in class `UserAgentAdapter`

### getDefaultFontFamily

    public java.lang.String getDefaultFontFamily()

  Returns the default font family.

  Specified by:
    `getDefaultFontFamily` in interface `UserAgent`
  Overrides:
    `getDefaultFontFamily` in class `UserAgentAdapter`

### getAlternateStyleSheet

    public java.lang.String getAlternateStyleSheet()

  Returns this user agent's alternate style-sheet title.

  Specified by:
    `getAlternateStyleSheet` in interface `UserAgent`
  Overrides:
    `getAlternateStyleSheet` in class `UserAgentAdapter`

### getUserStyleSheetURI

    public java.lang.String getUserStyleSheetURI()

  Returns the user stylesheet specified in the `TranscodingHints` or null if any.

  Specified by:
    `getUserStyleSheetURI` in interface `UserAgent`
  Overrides:
    `getUserStyleSheetURI` in class `UserAgentAdapter`

### getXMLParserClassName

    public java.lang.String getXMLParserClassName()

  Returns the XML parser to use from the TranscodingHints.

  Specified by:
    `getXMLParserClassName` in interface `UserAgent`
  Overrides:
    `getXMLParserClassName` in class `UserAgentAdapter`

### isXMLParserValidating

    public boolean isXMLParserValidating()

  Returns true if the XML parser must be in validation mode, false otherwise.

  Specified by:
    `isXMLParserValidating` in interface `UserAgent`
  Overrides:
    `isXMLParserValidating` in class `UserAgentAdapter`

### 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 interface `UserAgent`
  Overrides:
    `getScriptSecurity` in class `UserAgentAdapter`
  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 null
    `docPURL` - 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.

Copyright © 2004 Apache Software Foundation. All Rights Reserved.