From 4f2657162ea5f8e2a0251401b58615ebaff2d469 Mon Sep 17 00:00:00 2001 From: Keiron Liddle Date: Tue, 10 Sep 2002 15:07:13 +0000 Subject: fixed some more style violations git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@195166 13f79535-47bb-0310-9956-ffa450edef68 --- src/org/apache/fop/svg/SVGUserAgent.java | 58 ++++++++++++++++++++------------ 1 file changed, 37 insertions(+), 21 deletions(-) (limited to 'src/org/apache/fop/svg/SVGUserAgent.java') diff --git a/src/org/apache/fop/svg/SVGUserAgent.java b/src/org/apache/fop/svg/SVGUserAgent.java index a3b458588..10a584e9c 100644 --- a/src/org/apache/fop/svg/SVGUserAgent.java +++ b/src/org/apache/fop/svg/SVGUserAgent.java @@ -1,6 +1,6 @@ /* * $Id$ - * Copyright (C) 2001 The Apache Software Foundation. All rights reserved. + * Copyright (C) 2001-2002 The Apache Software Foundation. All rights reserved. * For details on use and redistribution please refer to the * LICENSE file included with these sources. */ @@ -9,37 +9,29 @@ package org.apache.fop.svg; import org.apache.fop.fo.FOUserAgent; -import org.apache.batik.bridge.*; -import org.apache.batik.swing.svg.*; -import org.apache.batik.swing.gvt.*; -import org.apache.batik.gvt.*; -import org.apache.batik.gvt.renderer.*; -import org.apache.batik.gvt.filter.*; -import org.apache.batik.gvt.event.*; +import org.apache.batik.bridge.UserAgentAdapter; import org.apache.avalon.framework.logger.Logger; -import org.w3c.dom.*; -import org.w3c.dom.svg.*; -import org.w3c.dom.css.*; -import org.w3c.dom.svg.SVGLength; - // Java -import java.io.IOException; -import java.io.OutputStream; import java.awt.geom.AffineTransform; import java.awt.geom.Dimension2D; -import java.awt.Point; -import java.awt.RenderingHints; import java.awt.Dimension; +/** + * The SVG user agent. + * This is an implementation of the batik svg user agent + * for handling errors and getting user agent values. + */ public class SVGUserAgent extends UserAgentAdapter { - AffineTransform currentTransform = null; - Logger log; - FOUserAgent userAgent; + private AffineTransform currentTransform = null; + private Logger log; + private FOUserAgent userAgent; /** * Creates a new SVGUserAgent. + * @param ua the FO user agent + * @param at the current transform */ public SVGUserAgent(FOUserAgent ua, AffineTransform at) { currentTransform = at; @@ -49,6 +41,7 @@ public class SVGUserAgent extends UserAgentAdapter { /** * Displays an error message. + * @param message the message to display */ public void displayError(String message) { log.error(message); @@ -56,6 +49,7 @@ public class SVGUserAgent extends UserAgentAdapter { /** * Displays an error resulting from the specified Exception. + * @param ex the exception to display */ public void displayError(Exception ex) { log.error("SVG Error" + ex.getMessage(), ex); @@ -64,6 +58,7 @@ public class SVGUserAgent extends UserAgentAdapter { /** * Displays a message in the User Agent interface. * The given message is typically displayed in a status bar. + * @param message the message to display */ public void displayMessage(String message) { log.info(message); @@ -71,6 +66,7 @@ public class SVGUserAgent extends UserAgentAdapter { /** * Shows an alert dialog box. + * @param message the message to display */ public void showAlert(String message) { log.warn(message); @@ -78,18 +74,24 @@ public class SVGUserAgent extends UserAgentAdapter { /** * Returns a customized the pixel to mm factor. + * @return the pixel unit to millimeter conversion factor */ - public float getPixelUnitToMillimter() { + public float getPixelUnitToMillimeter() { return userAgent.getPixelUnitToMillimeter(); } /** * Returns the language settings. + * @return the languages supported */ public String getLanguages() { return "en"; // userLanguages; } + /** + * Returns the media type for this rendering. + * @return the media for fo documents is "print" + */ public String getMedia() { return "print"; } @@ -104,19 +106,33 @@ public class SVGUserAgent extends UserAgentAdapter { /** * Returns the class name of the XML parser. + * @return the XML parser class name */ public String getXMLParserClassName() { return org.apache.fop.apps.Driver.getParserClassName(); } + /** + * Is the XML parser validating. + * @return true if the xml parser is validating + */ public boolean isXMLParserValidating() { return false; } + /** + * Get the transform of the svg document. + * @return the transform + */ public AffineTransform getTransform() { return currentTransform; } + /** + * Get the default viewport size for an svg document. + * This returns a default value of 100x100. + * @return the default viewport size + */ public Dimension2D getViewportSize() { return new Dimension(100, 100); } -- cgit v1.2.3