org.apache.fop.svg

Class SVGUserAgent


public class SVGUserAgent
extends UserAgentAdapter

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

Constructor Summary

SVGUserAgent(float pixelUnitToMM, AffineTransform at)
Creates a new SVGUserAgent.

Method Summary

void
displayError(Exception ex)
Displays an error resulting from the specified Exception.
void
displayError(String message)
Displays an error message.
void
displayMessage(String message)
Displays a message in the User Agent interface.
String
getLanguages()
Returns the language settings.
protected Log
getLogger()
Returns the logger associated with this user agent.
String
getMedia()
Returns the media type for this rendering.
float
getPixelUnitToMillimeter()
Returns a customized the pixel to mm factor.
AffineTransform
getTransform()
Get the transform of the svg document.
String
getUserStyleSheetURI()
Returns the user stylesheet uri.
Dimension2D
getViewportSize()
Get the default viewport size for an svg document.
String
getXMLParserClassName()
Returns the class name of the XML parser.
boolean
isXMLParserValidating()
Is the XML parser validating.
void
showAlert(String message)
Shows an alert dialog box.

Constructor Details

SVGUserAgent

public SVGUserAgent(float pixelUnitToMM,
                    AffineTransform at)
Creates a new SVGUserAgent.
Parameters:
pixelUnitToMM - the pixel to millimeter conversion factor currently in effect
at - the current transform

Method Details

displayError

public void displayError(Exception ex)
Displays an error resulting from the specified Exception.
Parameters:
ex - the exception to display

displayError

public void displayError(String message)
Displays an error message.
Parameters:
message - the message to display

displayMessage

public void displayMessage(String message)
Displays a message in the User Agent interface. The given message is typically displayed in a status bar.
Parameters:
message - the message to display

getLanguages

public String getLanguages()
Returns the language settings.
Returns:
the languages supported

getLogger

protected final Log getLogger()
Returns the logger associated with this user agent.
Returns:
Logger the logger

getMedia

public String getMedia()
Returns the media type for this rendering.
Returns:
the media for fo documents is "print"

getPixelUnitToMillimeter

public float getPixelUnitToMillimeter()
Returns a customized the pixel to mm factor.
Returns:
the pixel unit to millimeter conversion factor

getTransform

public AffineTransform getTransform()
Get the transform of the svg document.
Returns:
the transform

getUserStyleSheetURI

public String getUserStyleSheetURI()
Returns the user stylesheet uri.
Returns:
null if no user style sheet was specified.

getViewportSize

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

getXMLParserClassName

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

isXMLParserValidating

public boolean isXMLParserValidating()
Is the XML parser validating.
Returns:
true if the xml parser is validating

showAlert

public void showAlert(String message)
Shows an alert dialog box.
Parameters:
message - the message to display

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