1 51 package org.apache.fop.svg; 52 53 import org.apache.batik.bridge.*; 54 55 import org.apache.avalon.framework.logger.Logger; 56 57 import java.awt.geom.AffineTransform ; 59 import java.awt.geom.Dimension2D ; 60 import java.awt.Dimension ; 61 62 public class SVGUserAgent extends UserAgentAdapter { 63 AffineTransform currentTransform = null; 64 Logger log; 65 66 69 public SVGUserAgent(AffineTransform at) { 70 currentTransform = at; 71 } 72 73 public void setLogger(Logger logger) { 74 log = logger; 75 } 76 77 80 public void displayError(String message) { 81 log.error(message); 82 } 83 84 87 public void displayError(Exception ex) { 88 log.error("SVG Error" + ex.getMessage(), ex); 89 } 90 91 95 public void displayMessage(String message) { 96 log.info(message); 97 } 98 99 102 public float getPixelToMM() { 103 return 0.35277777777777777778f; } 107 108 public float getPixelUnitToMillimeter() { 109 return 0.35277777777777777778f; } 113 114 117 public String getLanguages() { 118 return "en"; } 120 121 public String getMedia() { 122 return "print"; 123 } 124 125 129 public String getUserStyleSheetURI() { 130 return null; } 132 133 136 public String getXMLParserClassName() { 137 return org.apache.fop.apps.Driver.getParserClassName(); 138 } 139 140 public AffineTransform getTransform() { 141 return currentTransform; 142 } 143 144 public Dimension2D getViewportSize() { 145 return new Dimension (100, 100); 146 } 147 148 public boolean isXMLParserValidating() { 149 return true; 150 } 151 152 } 153 154 | Popular Tags |