tkormann 02/03/19 10:40:44 Modified: sources/org/apache/batik/dom/svg DefaultSVGContext.java SVGContext.java SVGOMDocument.java SVGOMElement.java sources/org/apache/batik/transcoder/image ImageTranscoder.java sources/org/apache/batik/transcoder/print PrintTranscoder.java Log: prepare implementation support for SVGLocatable Revision Changes Path 1.9 +2 -20 xml-batik/sources/org/apache/batik/dom/svg/DefaultSVGContext.java Index: DefaultSVGContext.java =================================================================== RCS file: /home/cvs/xml-batik/sources/org/apache/batik/dom/svg/DefaultSVGContext.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- DefaultSVGContext.java 18 Mar 2002 10:28:26 -0000 1.8 +++ DefaultSVGContext.java 19 Mar 2002 18:40:44 -0000 1.9 @@ -12,26 +12,8 @@ * This class is the placeholder for SVG application informations. * * @author <a href="mailto:[EMAIL PROTECTED]">Stephane Hillion</a> - * @version $Id: DefaultSVGContext.java,v 1.8 2002/03/18 10:28:26 hillion Exp $ + * @version $Id: DefaultSVGContext.java,v 1.9 2002/03/19 18:40:44 tkormann Exp $ */ -public class DefaultSVGContext implements SVGContext { +public class DefaultSVGContext { - /** - * The pixel to mm conversion factor. - */ - protected float pixelToMM; - - /** - * Return the pixel to millimeters factor. - */ - public float getPixelToMM() { - return pixelToMM; - } - - /** - * Sets the pixel to millimeters factor. - */ - public void setPixelToMM(float f) { - pixelToMM = f; - } } 1.6 +19 -1 xml-batik/sources/org/apache/batik/dom/svg/SVGContext.java Index: SVGContext.java =================================================================== RCS file: /home/cvs/xml-batik/sources/org/apache/batik/dom/svg/SVGContext.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- SVGContext.java 18 Mar 2002 10:28:26 -0000 1.5 +++ SVGContext.java 19 Mar 2002 18:40:44 -0000 1.6 @@ -8,11 +8,14 @@ package org.apache.batik.dom.svg; +import java.awt.geom.AffineTransform; +import java.awt.geom.Rectangle2D; + /** * This interface is the placeholder for SVG application informations. * * @author <a href="mailto:[EMAIL PROTECTED]">Stephane Hillion</a> - * @version $Id: SVGContext.java,v 1.5 2002/03/18 10:28:26 hillion Exp $ + * @version $Id: SVGContext.java,v 1.6 2002/03/19 18:40:44 tkormann Exp $ */ public interface SVGContext { @@ -20,4 +23,19 @@ * Return the pixel to millimeters factor. */ float getPixelToMM(); + + /** + * Returns the tight bounding box in current user space (i.e., + * after application of the transform attribute, if any) on the + * geometry of all contained graphics elements, exclusive of + * stroke-width and filter effects). + */ + Rectangle2D getBBox(); + + /** + * Returns the transformation matrix from current user units + * (i.e., after application of the transform attribute, if any) to + * the viewport coordinate system for the nearestViewportElement. + */ + AffineTransform getCTM(); } 1.46 +1 -23 xml-batik/sources/org/apache/batik/dom/svg/SVGOMDocument.java Index: SVGOMDocument.java =================================================================== RCS file: /home/cvs/xml-batik/sources/org/apache/batik/dom/svg/SVGOMDocument.java,v retrieving revision 1.45 retrieving revision 1.46 diff -u -r1.45 -r1.46 --- SVGOMDocument.java 18 Mar 2002 10:28:26 -0000 1.45 +++ SVGOMDocument.java 19 Mar 2002 18:40:44 -0000 1.46 @@ -72,7 +72,7 @@ * This class implements {@link SVGDocument}. * * @author <a href="mailto:[EMAIL PROTECTED]">Stephane Hillion</a> - * @version $Id: SVGOMDocument.java,v 1.45 2002/03/18 10:28:26 hillion Exp $ + * @version $Id: SVGOMDocument.java,v 1.46 2002/03/19 18:40:44 tkormann Exp $ */ public class SVGOMDocument extends AbstractDocument @@ -114,11 +114,6 @@ protected transient AbstractView defaultView; /** - * The document context. - */ - protected transient SVGContext context; - - /** * The CSS engine. */ protected transient CSSEngine cssEngine; @@ -137,23 +132,6 @@ if (dt != null) { appendChild(dt); } - } - - /** - * Returns this document context. - */ - public SVGContext getSVGContext() { - if (context == null) { - context = new DefaultSVGContext(); - } - return context; - } - - /** - * Sets the document context. - */ - public void setSVGContext(SVGContext ctx) { - context = ctx; } /** 1.11 +24 -1 xml-batik/sources/org/apache/batik/dom/svg/SVGOMElement.java Index: SVGOMElement.java =================================================================== RCS file: /home/cvs/xml-batik/sources/org/apache/batik/dom/svg/SVGOMElement.java,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- SVGOMElement.java 18 Mar 2002 10:28:26 -0000 1.10 +++ SVGOMElement.java 19 Mar 2002 18:40:44 -0000 1.11 @@ -29,7 +29,7 @@ * This class implements the {@link SVGElement} interface. * * @author <a href="mailto:[EMAIL PROTECTED]">Stephane Hillion</a> - * @version $Id: SVGOMElement.java,v 1.10 2002/03/18 10:28:26 hillion Exp $ + * @version $Id: SVGOMElement.java,v 1.11 2002/03/19 18:40:44 tkormann Exp $ */ public abstract class SVGOMElement extends AbstractElement @@ -47,6 +47,11 @@ protected String prefix; /** + * The SVG context to get SVG specific informations. + */ + protected transient SVGContext svgContext; + + /** * Creates a new Element object. */ protected SVGOMElement() { @@ -157,6 +162,24 @@ prefix }); } this.prefix = prefix; + } + + // SVGContext //////////////////////////////////////////////////// + + /** + * Sets the SVG context to use to get SVG specific informations. + * + * @param ctx the SVG context + */ + public void setSVGContext(SVGContext ctx) { + svgContext = ctx; + } + + /** + * Returns the SVG context used to get SVG specific informations. + */ + public SVGContext getSVGContext() { + return svgContext; } // ExtendedNode ////////////////////////////////////////////////// 1.40 +1 -7 xml-batik/sources/org/apache/batik/transcoder/image/ImageTranscoder.java Index: ImageTranscoder.java =================================================================== RCS file: /home/cvs/xml-batik/sources/org/apache/batik/transcoder/image/ImageTranscoder.java,v retrieving revision 1.39 retrieving revision 1.40 diff -u -r1.39 -r1.40 --- ImageTranscoder.java 18 Mar 2002 10:28:27 -0000 1.39 +++ ImageTranscoder.java 19 Mar 2002 18:40:44 -0000 1.40 @@ -39,7 +39,6 @@ import org.apache.batik.css.engine.CSSEngine; -import org.apache.batik.dom.svg.DefaultSVGContext; import org.apache.batik.dom.svg.SAXSVGDocumentFactory; import org.apache.batik.dom.svg.ExtensibleSVGDOMImplementation; import org.apache.batik.dom.svg.SVGDOMImplementation; @@ -104,7 +103,7 @@ * millimeter conversion factor. * * @author <a href="mailto:[EMAIL PROTECTED]">Thierry Kormann</a> - * @version $Id: ImageTranscoder.java,v 1.39 2002/03/18 10:28:27 hillion Exp $ + * @version $Id: ImageTranscoder.java,v 1.40 2002/03/19 18:40:44 tkormann Exp $ */ public abstract class ImageTranscoder extends XMLAbstractTranscoder { @@ -147,12 +146,7 @@ BridgeContext ctx = new BridgeContext(userAgent); SVGOMDocument svgDoc = (SVGOMDocument)document; - SVGSVGElement root = svgDoc.getRootElement(); - // initialize the SVG document with the appropriate context - DefaultSVGContext svgCtx = new DefaultSVGContext(); - svgCtx.setPixelToMM(userAgent.getPixelToMM()); - svgDoc.setSVGContext(svgCtx); // build the GVT tree GVTBuilder builder = new GVTBuilder(); 1.21 +1 -6 xml-batik/sources/org/apache/batik/transcoder/print/PrintTranscoder.java Index: PrintTranscoder.java =================================================================== RCS file: /home/cvs/xml-batik/sources/org/apache/batik/transcoder/print/PrintTranscoder.java,v retrieving revision 1.20 retrieving revision 1.21 diff -u -r1.20 -r1.21 --- PrintTranscoder.java 18 Mar 2002 10:28:27 -0000 1.20 +++ PrintTranscoder.java 19 Mar 2002 18:40:44 -0000 1.21 @@ -42,7 +42,6 @@ import java.util.StringTokenizer; import java.util.Vector; -import org.apache.batik.dom.svg.DefaultSVGContext; import org.apache.batik.dom.svg.SAXSVGDocumentFactory; import org.apache.batik.dom.svg.ExtensibleSVGDOMImplementation; import org.apache.batik.dom.svg.SVGOMDocument; @@ -110,7 +109,7 @@ * </ul> * * @author <a href="mailto:[EMAIL PROTECTED]">Vincent Hardy</a> - * @version $Id: PrintTranscoder.java,v 1.20 2002/03/18 10:28:27 hillion Exp $ + * @version $Id: PrintTranscoder.java,v 1.21 2002/03/19 18:40:44 tkormann Exp $ */ public class PrintTranscoder extends XMLAbstractTranscoder implements Printable { @@ -443,10 +442,6 @@ } SVGDocument svgDoc = (SVGDocument)document; SVGSVGElement root = svgDoc.getRootElement(); - // initialize the SVG document with the appropriate context - DefaultSVGContext svgCtx = new DefaultSVGContext(); - svgCtx.setPixelToMM(userAgent.getPixelToMM()); - ((SVGOMDocument)document).setSVGContext(svgCtx); // build the GVT tree GVTBuilder builder = new GVTBuilder();
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]