fop 0.95

org.apache.fop.svg
Class SVGUserAgent

java.lang.Object
  extended by org.apache.batik.bridge.UserAgentAdapter
      extended by org.apache.fop.svg.SVGUserAgent
All Implemented Interfaces:
org.apache.batik.bridge.UserAgent

public class SVGUserAgent
extends org.apache.batik.bridge.UserAgentAdapter

The SVG user agent. This is an implementation of the batik svg user agent for handling errors and getting user agent values.


Field Summary
 
Fields inherited from class org.apache.batik.bridge.UserAgentAdapter
ctx, extensions, FEATURES
 
Constructor Summary
SVGUserAgent(float pixelUnitToMM, java.awt.geom.AffineTransform at)
          Creates a new SVGUserAgent.
 
Method Summary
 void displayError(java.lang.Exception ex)
          Displays an error resulting from the specified Exception.
 void displayError(java.lang.String message)
          Displays an error message.
 void displayMessage(java.lang.String message)
          Displays a message in the User Agent interface.
 java.lang.String getLanguages()
          Returns the language settings.
protected  org.apache.commons.logging.Log getLogger()
          Returns the logger associated with this user agent.
 java.lang.String getMedia()
          Returns the media type for this rendering.
 float getPixelUnitToMillimeter()
          Returns a customized the pixel to mm factor.
 java.awt.geom.AffineTransform getTransform()
          Get the transform of the svg document.
 java.lang.String getUserStyleSheetURI()
          Returns the user stylesheet uri.
 java.awt.geom.Dimension2D getViewportSize()
          Get the default viewport size for an svg document.
 java.lang.String getXMLParserClassName()
          Returns the class name of the XML parser.
 boolean isXMLParserValidating()
          Is the XML parser validating.
 void showAlert(java.lang.String message)
          Shows an alert dialog box.
 
Methods inherited from class org.apache.batik.bridge.UserAgentAdapter
addStdFeatures, checkLoadExternalResource, checkLoadScript, deselectAll, getAlternateStyleSheet, getBolderFontWeight, getBrokenLinkDocument, getClientAreaLocationOnScreen, getDefaultFontFamily, getEventDispatcher, getExternalResourceSecurity, getLighterFontWeight, getMediumFontSize, getPixelToMM, getScriptSecurity, getStandardBolderFontWeight, getStandardLighterFontWeight, handleElement, hasFeature, openLink, registerExtension, runThread, setBridgeContext, setSVGCursor, setTextSelection, setTransform, showConfirm, showPrompt, showPrompt, supportExtension
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SVGUserAgent

public SVGUserAgent(float pixelUnitToMM,
                    java.awt.geom.AffineTransform at)
Creates a new SVGUserAgent.

Parameters:
pixelUnitToMM - the pixel to millimeter conversion factor currently in effect
at - the current transform
Method Detail

getLogger

protected final org.apache.commons.logging.Log getLogger()
Returns the logger associated with this user agent.

Returns:
Logger the logger

displayError

public void displayError(java.lang.String message)
Displays an error message.

Overrides:
displayError in class org.apache.batik.bridge.UserAgentAdapter
Parameters:
message - the message to display

displayError

public void displayError(java.lang.Exception ex)
Displays an error resulting from the specified Exception.

Specified by:
displayError in interface org.apache.batik.bridge.UserAgent
Overrides:
displayError in class org.apache.batik.bridge.UserAgentAdapter
Parameters:
ex - the exception to display

displayMessage

public void displayMessage(java.lang.String message)
Displays a message in the User Agent interface. The given message is typically displayed in a status bar.

Specified by:
displayMessage in interface org.apache.batik.bridge.UserAgent
Overrides:
displayMessage in class org.apache.batik.bridge.UserAgentAdapter
Parameters:
message - the message to display

showAlert

public void showAlert(java.lang.String message)
Shows an alert dialog box.

Specified by:
showAlert in interface org.apache.batik.bridge.UserAgent
Overrides:
showAlert in class org.apache.batik.bridge.UserAgentAdapter
Parameters:
message - the message to display

getPixelUnitToMillimeter

public float getPixelUnitToMillimeter()
Returns a customized the pixel to mm factor.

Specified by:
getPixelUnitToMillimeter in interface org.apache.batik.bridge.UserAgent
Overrides:
getPixelUnitToMillimeter in class org.apache.batik.bridge.UserAgentAdapter
Returns:
the pixel unit to millimeter conversion factor

getLanguages

public java.lang.String getLanguages()
Returns the language settings.

Specified by:
getLanguages in interface org.apache.batik.bridge.UserAgent
Overrides:
getLanguages in class org.apache.batik.bridge.UserAgentAdapter
Returns:
the languages supported

getMedia

public java.lang.String getMedia()
Returns the media type for this rendering.

Specified by:
getMedia in interface org.apache.batik.bridge.UserAgent
Overrides:
getMedia in class org.apache.batik.bridge.UserAgentAdapter
Returns:
the media for fo documents is "print"

getUserStyleSheetURI

public java.lang.String getUserStyleSheetURI()
Returns the user stylesheet uri.

Specified by:
getUserStyleSheetURI in interface org.apache.batik.bridge.UserAgent
Overrides:
getUserStyleSheetURI in class org.apache.batik.bridge.UserAgentAdapter
Returns:
null if no user style sheet was specified.

getXMLParserClassName

public java.lang.String getXMLParserClassName()
Returns the class name of the XML parser.

Specified by:
getXMLParserClassName in interface org.apache.batik.bridge.UserAgent
Overrides:
getXMLParserClassName in class org.apache.batik.bridge.UserAgentAdapter
Returns:
the XML parser class name

isXMLParserValidating

public boolean isXMLParserValidating()
Is the XML parser validating.

Specified by:
isXMLParserValidating in interface org.apache.batik.bridge.UserAgent
Overrides:
isXMLParserValidating in class org.apache.batik.bridge.UserAgentAdapter
Returns:
true if the xml parser is validating

getTransform

public java.awt.geom.AffineTransform getTransform()
Get the transform of the svg document.

Specified by:
getTransform in interface org.apache.batik.bridge.UserAgent
Overrides:
getTransform in class org.apache.batik.bridge.UserAgentAdapter
Returns:
the transform

getViewportSize

public java.awt.geom.Dimension2D getViewportSize()
Get the default viewport size for an svg document. This returns a default value of 100x100.

Specified by:
getViewportSize in interface org.apache.batik.bridge.UserAgent
Overrides:
getViewportSize in class org.apache.batik.bridge.UserAgentAdapter
Returns:
the default viewport size

fop 0.95

Copyright 1999-2008 The Apache Software Foundation. All Rights Reserved.