xmlgraphics-batik-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dewe...@apache.org
Subject cvs commit: xml-batik/sources/org/apache/batik/dom/svg SAXSVGDocumentFactory.java SVGDocumentFactory.java
Date Wed, 24 Jul 2002 11:50:26 GMT
deweese     2002/07/24 04:50:26

  Modified:    samples/tests/spec/scripting use.svg
               sources/org/apache/batik/apps/svgbrowser
                        XMLInputHandler.java
               sources/org/apache/batik/bridge DocumentLoader.java
               sources/org/apache/batik/dom/svg SAXSVGDocumentFactory.java
                        SVGDocumentFactory.java
  Log:
  1) Resolved method name conflicts between SAXDocumentFactor
     and SVGDocumentFactory.
  
  Revision  Changes    Path
  1.2       +3 -3      xml-batik/samples/tests/spec/scripting/use.svg
  
  Index: use.svg
  ===================================================================
  RCS file: /home/cvs/xml-batik/samples/tests/spec/scripting/use.svg,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- use.svg	21 Jun 2002 14:20:40 -0000	1.1
  +++ use.svg	24 Jul 2002 11:50:25 -0000	1.2
  @@ -147,10 +147,10 @@
   
           </g>
   
  -        <a onclick="runTest()">
  +        <g onclick="runTest()">
               <use class="button" xlink:href="#button" x="60" y="200" />
               <text class="button" x="60" y="200">Run Test</text>
  -        </a>
  +        </g>
       </g>
    
   <!--
  
  
  
  1.3       +3 -3      xml-batik/sources/org/apache/batik/apps/svgbrowser/XMLInputHandler.java
  
  Index: XMLInputHandler.java
  ===================================================================
  RCS file: /home/cvs/xml-batik/sources/org/apache/batik/apps/svgbrowser/XMLInputHandler.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- XMLInputHandler.java	12 Jul 2002 16:01:33 -0000	1.2
  +++ XMLInputHandler.java	24 Jul 2002 11:50:25 -0000	1.3
  @@ -217,8 +217,8 @@
           SVGDocument outDoc = null;
   
           try {
  -            outDoc = f.createDocument(uri, 
  -                                      new StringReader(sw.toString()));
  +            outDoc = f.createSVGDocument
  +                (uri, new StringReader(sw.toString()));
           } catch (Exception e) {
               System.err.println("======================================");
               System.err.println(sw.toString());
  
  
  
  1.15      +2 -2      xml-batik/sources/org/apache/batik/bridge/DocumentLoader.java
  
  Index: DocumentLoader.java
  ===================================================================
  RCS file: /home/cvs/xml-batik/sources/org/apache/batik/bridge/DocumentLoader.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- DocumentLoader.java	13 Jun 2002 11:19:37 -0000	1.14
  +++ DocumentLoader.java	24 Jul 2002 11:50:25 -0000	1.15
  @@ -89,7 +89,7 @@
           }
           DocumentState state = (DocumentState)cacheMap.get(uri);
           if (state == null) {
  -            Document document = documentFactory.createDocument(uri);
  +            SVGDocument document = documentFactory.createSVGDocument(uri);
               if (bridgeContext != null) {
                   bridgeContext.initializeDocument(document);
               }
  
  
  
  1.17      +43 -16    xml-batik/sources/org/apache/batik/dom/svg/SAXSVGDocumentFactory.java
  
  Index: SAXSVGDocumentFactory.java
  ===================================================================
  RCS file: /home/cvs/xml-batik/sources/org/apache/batik/dom/svg/SAXSVGDocumentFactory.java,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- SAXSVGDocumentFactory.java	10 May 2002 11:06:10 -0000	1.16
  +++ SAXSVGDocumentFactory.java	24 Jul 2002 11:50:25 -0000	1.17
  @@ -29,6 +29,7 @@
   
   import org.w3c.dom.Document;
   import org.w3c.dom.DOMException;
  +import org.w3c.dom.svg.SVGDocument;
   
   import org.xml.sax.InputSource;
   import org.xml.sax.SAXException;
  @@ -78,13 +79,39 @@
                 parser, dd);
       }
   
  +    public SVGDocument createSVGDocument(String uri) throws IOException {
  +        return (SVGDocument)createDocument(uri);
  +    }
  +
  +    /**
  +     * Creates a SVG Document instance.
  +     * @param uri The document URI.
  +     * @param inp The document input stream.
  +     * @exception IOException if an error occured while reading the document.
  +     */
  +    public SVGDocument createSVGDocument(String uri, InputStream inp) 
  +        throws IOException {
  +        return (SVGDocument)createDocument(uri, inp);
  +    }
  +
  +    /**
  +     * Creates a SVG Document instance.
  +     * @param uri The document URI.
  +     * @param r The document reader.
  +     * @exception IOException if an error occured while reading the document.
  +     */
  +    public SVGDocument createSVGDocument(String uri, Reader r)
  +        throws IOException {
  +        return (SVGDocument)createDocument(uri, r);
  +    }
  +
       /**
  -     * Creates a SVGOMDocument instance.<br>
  +     * Creates a SVG Document instance.<br>
        * This method supports gzipped sources.
        * @param uri The document URI.
        * @exception IOException if an error occured while reading the document.
        */
  -    public SVGOMDocument createDocument(String uri) throws IOException {
  +    public Document createDocument(String uri) throws IOException {
           ParsedURL purl = new ParsedURL(uri);
   
           InputStream is = purl.openStream(MimeTypeConstants.MIME_TYPES_SVG);
  @@ -128,10 +155,10 @@
   
           isrc.setSystemId(uri);
   
  -        SVGOMDocument doc = (SVGOMDocument)super.createDocument
  +        Document doc = super.createDocument
               (SVGDOMImplementation.SVG_NAMESPACE_URI, "svg", uri, isrc);
           try {
  -            doc.setURLObject(new URL(purl.toString()));
  +            ((SVGOMDocument)doc).setURLObject(new URL(purl.toString()));
           } catch (MalformedURLException mue) {
               // Not very likely to happen given we already opened the stream.
               throw new IOException("Malformed URL: " + uri);
  @@ -141,22 +168,22 @@
       }
   
       /**
  -     * Creates a SVGOMDocument instance.
  +     * Creates a SVG Document instance.
        * @param uri The document URI.
  -     * @param is The document input stream.
  +     * @param inp The document input stream.
        * @exception IOException if an error occured while reading the document.
        */
  -    public SVGOMDocument createDocument(String uri, InputStream inp)
  +    public Document createDocument(String uri, InputStream inp)
           throws IOException {
  -        SVGOMDocument doc;
  +        Document doc;
           InputSource is = new InputSource(inp);
           is.setSystemId(uri);
   
           try {
  -            doc = (SVGOMDocument)super.createDocument
  +            doc = super.createDocument
                   (SVGDOMImplementation.SVG_NAMESPACE_URI, "svg", uri, is);
               if (uri != null) {
  -                doc.setURLObject(new URL(uri));
  +                ((SVGOMDocument)doc).setURLObject(new URL(uri));
               }
           } catch (MalformedURLException e) {
               throw new IOException(e.getMessage());
  @@ -165,22 +192,22 @@
       }
   
       /**
  -     * Creates a SVGOMDocument instance.
  +     * Creates a SVG Document instance.
        * @param uri The document URI.
        * @param r The document reader.
        * @exception IOException if an error occured while reading the document.
        */
  -    public SVGOMDocument createDocument(String uri, Reader r)
  +    public Document createDocument(String uri, Reader r)
           throws IOException {
  -        SVGOMDocument doc;
  +        Document doc;
           InputSource is = new InputSource(r);
           is.setSystemId(uri);
   
           try {
  -            doc = (SVGOMDocument)super.createDocument
  +            doc = super.createDocument
                   (SVGDOMImplementation.SVG_NAMESPACE_URI, "svg", uri, is);
               if (uri != null) {
  -                doc.setURLObject(new URL(uri));
  +                ((SVGOMDocument)doc).setURLObject(new URL(uri));
               }
           } catch (MalformedURLException e) {
               throw new IOException(e.getMessage());
  
  
  
  1.7       +10 -7     xml-batik/sources/org/apache/batik/dom/svg/SVGDocumentFactory.java
  
  Index: SVGDocumentFactory.java
  ===================================================================
  RCS file: /home/cvs/xml-batik/sources/org/apache/batik/dom/svg/SVGDocumentFactory.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- SVGDocumentFactory.java	13 Feb 2001 19:45:11 -0000	1.6
  +++ SVGDocumentFactory.java	24 Jul 2002 11:50:25 -0000	1.7
  @@ -12,6 +12,8 @@
   import java.io.IOException;
   import java.io.Reader;
   
  +import org.w3c.dom.svg.SVGDocument;
  +
   import org.apache.batik.dom.util.DocumentFactory;
   
   /**
  @@ -23,26 +25,27 @@
   public interface SVGDocumentFactory extends DocumentFactory {
   
       /**
  -     * Creates a SVGOMDocument instance.
  +     * Creates a SVG Document instance.
        * @param uri The document URI.
        * @exception IOException if an error occured while reading the document.
        */
  -    SVGOMDocument createDocument(String uri) throws IOException;
  +    SVGDocument createSVGDocument(String uri) throws IOException;
   
       /**
  -     * Creates a SVGOMDocument instance.
  +     * Creates a SVG Document instance.
        * @param uri The document URI.
        * @param is The document input stream.
        * @exception IOException if an error occured while reading the document.
        */
  -    SVGOMDocument createDocument(String uri, InputStream is) throws IOException;
  +    SVGDocument createSVGDocument(String uri, InputStream is) 
  +        throws IOException;
   
       /**
  -     * Creates a SVGOMDocument instance.
  +     * Creates a SVG Document instance.
        * @param uri The document URI.
        * @param r The document reader.
        * @exception IOException if an error occured while reading the document.
        */
  -    SVGOMDocument createDocument(String uri, Reader r) throws IOException;
  +    SVGDocument createSVGDocument(String uri, Reader r) throws IOException;
   
   }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: batik-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-dev-help@xml.apache.org


Mime
View raw message