You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-dev@xmlgraphics.apache.org by cj...@apache.org on 2001/03/19 10:26:51 UTC

cvs commit: xml-batik/sources/org/apache/batik/svggen DOMGroupManager.java DOMTreeManager.java ImageHandlerBase64Encoder.java ImageHandlerJPEGEncoder.java ImageHandlerPNGEncoder.java SVGAlphaComposite.java SVGBasicStroke.java SVGBufferedImageOp.java SVGCSSStyler.java SVGClip.java SVGColor.java SVGConvolveOp.java SVGEllipse.java SVGFont.java SVGGraphicContextConverter.java SVGLine.java SVGLinearGradient.java SVGLookupOp.java SVGPath.java SVGPolygon.java SVGRectangle.java SVGRenderingHints.java SVGRescaleOp.java SVGShape.java SVGTexturePaint.java SVGTransform.java XmlWriter.java TestUtil.java

cjolif      01/03/19 01:26:50

  Modified:    sources/org/apache/batik/svggen DOMGroupManager.java
                        DOMTreeManager.java ImageHandlerBase64Encoder.java
                        ImageHandlerJPEGEncoder.java
                        ImageHandlerPNGEncoder.java SVGAlphaComposite.java
                        SVGBasicStroke.java SVGBufferedImageOp.java
                        SVGCSSStyler.java SVGClip.java SVGColor.java
                        SVGConvolveOp.java SVGEllipse.java SVGFont.java
                        SVGGraphicContextConverter.java SVGLine.java
                        SVGLinearGradient.java SVGLookupOp.java
                        SVGPath.java SVGPolygon.java SVGRectangle.java
                        SVGRenderingHints.java SVGRescaleOp.java
                        SVGShape.java SVGTexturePaint.java
                        SVGTransform.java XmlWriter.java
  Removed:     sources/org/apache/batik/svggen TestUtil.java
  Log:
  Remove unit tests from SVG Generator classes source code.
  Put them in a new class SVGGraphics2UnitTester
  
  Revision  Changes    Path
  1.5       +2 -75     xml-batik/sources/org/apache/batik/svggen/DOMGroupManager.java
  
  Index: DOMGroupManager.java
  ===================================================================
  RCS file: /home/cvs/xml-batik/sources/org/apache/batik/svggen/DOMGroupManager.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- DOMGroupManager.java	2001/03/14 01:36:46	1.4
  +++ DOMGroupManager.java	2001/03/19 09:26:03	1.5
  @@ -47,9 +47,9 @@
    * DOMTreeManager handle group managers that would be used concurrently.
    *
    * @author <a href="mailto:vincent.hardy@eng.sun.com">Vincent Hardy</a>
  - * @version $Id: DOMGroupManager.java,v 1.4 2001/03/14 01:36:46 vhardy Exp $
  + * @version $Id: DOMGroupManager.java,v 1.5 2001/03/19 09:26:03 cjolif Exp $
    */
  -public class DOMGroupManager implements SVGSyntax{
  +public class DOMGroupManager implements SVGSyntax {
       static final String ERROR_GC_NULL = "gc should not be null";
       static final String ERROR_DOMTREEMANAGER_NULL = "domTreeManager should not be null";
   
  @@ -288,78 +288,5 @@
           }
   
           return mapDelta;
  -    }
  -
  -    /**
  -     * Unit testing
  -     */
  -    public static void main(String args[]) throws Exception {
  -        /*      Document domFactory = TestUtil.getDocumentPrototype();
  -
  -                GraphicContext gc = new GraphicContext(new AffineTransform());
  -                DOMGroupManager domTreeManager
  -                = new DOMGroupManager(gc,
  -                domFactory,
  -                new DefaultExtensionHandler(),
  -                new DefaultImageHandler(),
  -                2);
  -
  -                //
  -                // Do the following:
  -                // + Add one rect element
  -                // + Modify the Paint (modif 1)
  -                // + Add one ellipse element. Should be under the same group
  -                // + Modify the Composite (modif 2, ignored, as it does not apply to a group)
  -                // + Add one circle element. Should be under the same group
  -                // + Modify the Clip (modif 2bis)
  -                // + Modify the Transform (modif 3, over limit)
  -                // + Add one path element: Should be under a new group.
  -                // + Set the transform to a new transform (new group trigger)
  -                // + Add a polygon: should be under a new group
  -                //
  -
  -                Element rect = domFactory.createElementNS(SVG_NAMESPACE_URI, TAG_RECT);
  -                Element ellipse = domFactory.createElementNS(SVG_NAMESPACE_URI, TAG_ELLIPSE);
  -                Element circle = domFactory.createElementNS(SVG_NAMESPACE_URI, TAG_CIRCLE);
  -                Element path = domFactory.createElementNS(SVG_NAMESPACE_URI, TAG_PATH);
  -                Element polygon = domFactory.createElementNS(SVG_NAMESPACE_URI, TAG_POLYGON);
  -
  -                rect.setAttributeNS(null, ATTR_FILL, VALUE_NONE);
  -                polygon.setAttributeNS(null, ATTR_STROKE, VALUE_NONE);
  -
  -                domTreeManager.addElement(rect);
  -
  -                // Modif 1
  -                gc.setPaint(Color.red);
  -
  -                // Ellipse element
  -                domTreeManager.addElement(ellipse);
  -
  -                // Modif 2
  -                gc.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_IN, .5f));
  -
  -                // Circle element
  -                domTreeManager.addElement(circle);
  -
  -                // Modif 2bis
  -                gc.setClip(new Rectangle(30, 30, 60, 60));
  -
  -                // Modif 3
  -                gc.translate(45, 45);
  -
  -                // Path element (should be in a new group)
  -                domTreeManager.addElement(path);
  -
  -                // Modify transform
  -                gc.setTransform(AffineTransform.getScaleInstance(45, 50));
  -
  -                // Polygon element (should be in a new group as well).
  -                domTreeManager.addElement(polygon);
  -
  -                //
  -                // Now, trace the resulting tree
  -                //
  -                Element topLevelGroup = domTreeManager.getTopLevelGroup();
  -                TestUtil.trace(topLevelGroup, System.out);*/
       }
   }
  
  
  
  1.6       +2 -87     xml-batik/sources/org/apache/batik/svggen/DOMTreeManager.java
  
  Index: DOMTreeManager.java
  ===================================================================
  RCS file: /home/cvs/xml-batik/sources/org/apache/batik/svggen/DOMTreeManager.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- DOMTreeManager.java	2001/03/14 01:36:46	1.5
  +++ DOMTreeManager.java	2001/03/19 09:26:04	1.6
  @@ -44,9 +44,9 @@
    *        +-- [g]    Group n
    *
    * @author <a href="mailto:vincent.hardy@eng.sun.com">Vincent Hardy</a>
  - * @version $Id: DOMTreeManager.java,v 1.5 2001/03/14 01:36:46 vhardy Exp $
  + * @version $Id: DOMTreeManager.java,v 1.6 2001/03/19 09:26:04 cjolif Exp $
    */
  -public class DOMTreeManager implements SVGSyntax{
  +public class DOMTreeManager implements SVGSyntax {
       static final String ERROR_GC_NULL = "gc should not be null";
       static final String ERROR_FACTORY_NULL = "nodeFactory should not be null";
       static final String ERROR_MAXGCOVERRIDES_OUTOFRANGE = "maxGcOverrides should be greater than zero";
  @@ -378,90 +378,5 @@
           recycleTopLevelGroup(false);
   
           return topLevelGroup;
  -    }
  -
  -    /**
  -     * Unit testing
  -     */
  -    public static void main(String args[]) throws Exception {
  -        Document domFactory = TestUtil.getDocumentPrototype();
  -
  -        GraphicContext gc = new GraphicContext(new AffineTransform());
  -        DOMTreeManager domTreeManager
  -            = new DOMTreeManager(gc,
  -                                 domFactory,
  -                                 new DefaultExtensionHandler(),
  -                                 new DefaultImageHandler(),
  -                                 2);
  -
  -        DOMGroupManager domGroupManager
  -            = new DOMGroupManager(gc, domTreeManager);
  -
  -        //
  -        // Do the following:
  -        // + Add one rect element
  -        // + Modify the Paint (modif 1)
  -        // + Add one ellipse element. Should be under the same group
  -        // + Modify the Composite (modif 2, ignored, as it does not apply to a group)
  -        // + Add one circle element. Should be under the same group
  -        // + Modify the Clip (modif 2bis)
  -        // + Modify the Transform (modif 3, over limit)
  -        // + Add one path element: Should be under a new group.
  -        // + Set the transform to a new transform (new group trigger)
  -        // + Add a polygon: should be under a new group
  -        //
  -
  -        Element rect = domFactory.createElementNS(SVG_NAMESPACE_URI,
  -                                                  SVG_RECT_TAG);
  -        Element ellipse = domFactory.createElementNS(SVG_NAMESPACE_URI,
  -                                                     SVG_ELLIPSE_TAG);
  -        Element circle = domFactory.createElementNS(SVG_NAMESPACE_URI,
  -                                                    SVG_CIRCLE_TAG);
  -        Element path = domFactory.createElementNS(SVG_NAMESPACE_URI,
  -                                                  SVG_PATH_TAG);
  -        Element polygon = domFactory.createElementNS(SVG_NAMESPACE_URI,
  -                                                     SVG_POLYGON_TAG);
  -
  -        rect.setAttributeNS(null, SVG_FILL_ATTRIBUTE, SVG_NONE_VALUE);
  -        polygon.setAttributeNS(null, ATTR_STROKE, SVG_NONE_VALUE);
  -
  -        domGroupManager.addElement(rect);
  -
  -        // Modif 1
  -        gc.setPaint(Color.red);
  -
  -        // Ellipse element
  -        domGroupManager.addElement(ellipse);
  -
  -        // Modif 2
  -        gc.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_IN, .5f));
  -
  -        // Circle element
  -        domGroupManager.addElement(circle);
  -
  -        // Modif 2bis
  -        gc.setClip(new Rectangle(30, 30, 60, 60));
  -
  -        // Modif 3
  -        gc.translate(45, 45);
  -
  -        GraphicContext gc2 = (GraphicContext)gc.clone();
  -        DOMGroupManager domGroupManager2
  -            = new DOMGroupManager(gc2, domTreeManager);
  -
  -        // Path element (should be in a new group)
  -        domGroupManager2.addElement(path);
  -
  -        // Modify transform
  -        gc2.setTransform(AffineTransform.getScaleInstance(45, 50));
  -
  -        // Polygon element (should be in a new group as well).
  -        domGroupManager2.addElement(polygon);
  -
  -        //
  -        // Now, trace the resulting tree
  -        //
  -        Element topLevelGroup = domTreeManager.getTopLevelGroup();
  -        TestUtil.trace(topLevelGroup, System.out);
       }
   }
  
  
  
  1.8       +1 -58     xml-batik/sources/org/apache/batik/svggen/ImageHandlerBase64Encoder.java
  
  Index: ImageHandlerBase64Encoder.java
  ===================================================================
  RCS file: /home/cvs/xml-batik/sources/org/apache/batik/svggen/ImageHandlerBase64Encoder.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- ImageHandlerBase64Encoder.java	2001/02/15 02:27:29	1.7
  +++ ImageHandlerBase64Encoder.java	2001/03/19 09:26:05	1.8
  @@ -29,7 +29,7 @@
    * the data protocol.
    *
    * @author <a href="mailto:vincent.hardy@eng.sun.com">Vincent Hardy</a>
  - * @version $Id: ImageHandlerBase64Encoder.java,v 1.7 2001/02/15 02:27:29 vhardy Exp $
  + * @version $Id: ImageHandlerBase64Encoder.java,v 1.8 2001/03/19 09:26:05 cjolif Exp $
    * @see             org.apache.batik.svggen.SVGGraphics2D
    * @see             org.apache.batik.svggen.ImageHandler
    */
  @@ -146,62 +146,5 @@
        */
       public BufferedImage buildBufferedImage(Dimension size){
           return new BufferedImage(size.width, size.height, BufferedImage.TYPE_INT_ARGB);
  -    }
  -
  -    /**
  -     * Unit testing
  -     */
  -    public static final String USAGE = "java org.apache.batik.svggen.ImageHandlerBase64Encoder [<imageFile>]";
  -
  -    public static void main(String args[]) {
  -        BufferedImage buf = null;
  -
  -        if(args.length == 0){
  -            buf = new BufferedImage(100, 100, BufferedImage.TYPE_INT_ARGB);
  -            Graphics2D g = buf.createGraphics();
  -            g.setPaint(Color.red);
  -            g.fillRect(0, 0, 50, 50);
  -            g.fillRect(50, 50, 50, 50);
  -            g.dispose();
  -        }
  -        else{
  -            Component cmp = new Component(){};
  -            MediaTracker mediaTracker = new MediaTracker(cmp);
  -            Image img = Toolkit.getDefaultToolkit().createImage(args[0]);
  -            mediaTracker.addImage(img, 0);
  -            try{
  -                mediaTracker.waitForAll();
  -            }catch(InterruptedException e){
  -                img = null;
  -            }
  -
  -            if(img == null){
  -                System.err.println("Could not load : " + args[0]);
  -            }
  -
  -            buf = new BufferedImage(img.getWidth(null),
  -                                    img.getHeight(null),
  -                                    BufferedImage.TYPE_INT_ARGB);
  -            Graphics2D g = buf.createGraphics();
  -            g.drawImage(img, 0, 0, null);
  -            g.dispose();
  -        }
  -
  -        ImageHandler imageHandler = new ImageHandlerBase64Encoder();
  -        Document domFactory = TestUtil.getDocumentPrototype();
  -        Element imageElement = domFactory.createElementNS(SVG_NAMESPACE_URI, SVGSyntax.SVG_IMAGE_TAG);
  -
  -        imageHandler.handleImage((RenderedImage)buf, imageElement);
  -
  -        System.out.println("<?xml version=\"1.0\" standalone=\"no\"?>");
  -        System.out.println("<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 20000802//EN\"");
  -        System.out.println("\"http://www.w3.org/TR/2000/CR-SVG-20000802/DTD/svg-20000802.dtd\">");
  -        System.out.println();
  -        System.out.println("<svg width=\"450\" height=\"500\">");
  -        System.out.println("    <rect width=\"100%\" height=\"100%\" fill=\"yellow\" />");
  -        System.out.println("    <image width=\"" + buf.getWidth() + "\" height=\"" +
  -                           buf.getHeight() + "\" xlink:href=\"" + XLinkSupport.getXLinkHref(imageElement) + "\" />");
  -        System.out.println("</svg>");
  -        System.exit(0);
       }
   }
  
  
  
  1.4       +1 -34     xml-batik/sources/org/apache/batik/svggen/ImageHandlerJPEGEncoder.java
  
  Index: ImageHandlerJPEGEncoder.java
  ===================================================================
  RCS file: /home/cvs/xml-batik/sources/org/apache/batik/svggen/ImageHandlerJPEGEncoder.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ImageHandlerJPEGEncoder.java	2001/01/30 17:34:19	1.3
  +++ ImageHandlerJPEGEncoder.java	2001/03/19 09:26:06	1.4
  @@ -26,7 +26,7 @@
    * image elements it handles.
    *
    * @author <a href="mailto:vincent.hardy@eng.sun.com">Vincent Hardy</a>
  - * @version $Id: ImageHandlerJPEGEncoder.java,v 1.3 2001/01/30 17:34:19 vhardy Exp $
  + * @version $Id: ImageHandlerJPEGEncoder.java,v 1.4 2001/03/19 09:26:06 cjolif Exp $
    * @see             org.apache.batik.svggen.SVGGraphics2D
    * @see             org.apache.batik.svggen.ImageHandlerJPEGEncoder
    * @see             org.apache.batik.svggen.ImageHandlerPNGEncoder
  @@ -81,38 +81,5 @@
        */
       public BufferedImage buildBufferedImage(Dimension size){
           return new BufferedImage(size.width, size.height, BufferedImage.TYPE_INT_RGB);
  -    }
  -
  -    public static final String USAGE = "java org.apache.batik.svggen.ImageHandlerJPEGEncoder <imageDir> <urlRoot>";
  -
  -    /**
  -     * Unit testing
  -     */
  -    public static void main(String args[]) {
  -        if(args.length < 2){
  -            System.out.println(USAGE);
  -            System.exit(0);
  -        }
  -
  -        String imageDir = args[0];
  -        String urlRoot = args[1];
  -
  -        ImageHandler imageHandler = new ImageHandlerJPEGEncoder(imageDir, urlRoot);
  -        Document domFactory = TestUtil.getDocumentPrototype();
  -        Element imageElement = domFactory.createElementNS(SVG_NAMESPACE_URI, SVGSyntax.SVG_IMAGE_TAG);
  -
  -        BufferedImage testImage = new BufferedImage(60, 40, BufferedImage.TYPE_INT_ARGB);
  -        java.awt.Graphics2D g = testImage.createGraphics();
  -        g.setPaint(Color.white);
  -        g.fillRect(0, 0, 60, 40);
  -        g.setPaint(Color.green);
  -        g.fillRect(0, 0, 20, 40);
  -        g.setPaint(Color.red);
  -        g.fillRect(40, 0, 60, 40);
  -        g.dispose();
  -
  -        imageHandler.handleImage((RenderedImage)testImage, imageElement);
  -        System.out.println("Generated xlink:href is : " + imageElement.getAttributeNS(null, SVGSyntax.ATTR_XLINK_HREF));
  -        System.exit(0);
       }
   }
  
  
  
  1.4       +1 -32     xml-batik/sources/org/apache/batik/svggen/ImageHandlerPNGEncoder.java
  
  Index: ImageHandlerPNGEncoder.java
  ===================================================================
  RCS file: /home/cvs/xml-batik/sources/org/apache/batik/svggen/ImageHandlerPNGEncoder.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ImageHandlerPNGEncoder.java	2001/01/30 17:34:22	1.3
  +++ ImageHandlerPNGEncoder.java	2001/03/19 09:26:07	1.4
  @@ -27,7 +27,7 @@
    * image elements it handles.
    *
    * @author <a href="mailto:vincent.hardy@eng.sun.com">Vincent Hardy</a>
  - * @version $Id: ImageHandlerPNGEncoder.java,v 1.3 2001/01/30 17:34:22 vhardy Exp $
  + * @version $Id: ImageHandlerPNGEncoder.java,v 1.4 2001/03/19 09:26:07 cjolif Exp $
    * @see             org.apache.batik.svggen.SVGGraphics2D
    * @see             org.apache.batik.svggen.ImageHandlerJPEGEncoder
    * @see             org.apache.batik.svggen.ImageHandlerPNGEncoder
  @@ -80,36 +80,5 @@
        */
       public BufferedImage buildBufferedImage(Dimension size){
           return new BufferedImage(size.width, size.height, BufferedImage.TYPE_INT_ARGB);
  -    }
  -
  -    public static final String USAGE = "java org.apache.batik.svggen.ImageHandlerPNGEncoder <imageDir> <urlRoot>";
  -
  -    /**
  -     * Unit testing
  -     */
  -    public static void main(String args[]) {
  -        if(args.length < 2){
  -            System.out.println(USAGE);
  -            System.exit(0);
  -        }
  -
  -        String imageDir = args[0];
  -        String urlRoot = args[1];
  -
  -        ImageHandler imageHandler = new ImageHandlerPNGEncoder(imageDir, urlRoot);
  -        Document domFactory = TestUtil.getDocumentPrototype();
  -        Element imageElement = domFactory.createElementNS(SVG_NAMESPACE_URI, SVGSyntax.SVG_IMAGE_TAG);
  -
  -        BufferedImage testImage = new BufferedImage(60, 40, BufferedImage.TYPE_INT_ARGB);
  -        java.awt.Graphics2D g = testImage.createGraphics();
  -        g.setPaint(Color.green);
  -        g.fillRect(0, 0, 20, 40);
  -        g.setPaint(Color.red);
  -        g.fillRect(40, 0, 60, 40);
  -        g.dispose();
  -
  -        imageHandler.handleImage((RenderedImage)testImage, imageElement);
  -        System.out.println("Generated xlink:href is : " + imageElement.getAttributeNS(null, SVGSyntax.ATTR_XLINK_HREF));
  -        System.exit(0);
       }
   }
  
  
  
  1.6       +1 -80     xml-batik/sources/org/apache/batik/svggen/SVGAlphaComposite.java
  
  Index: SVGAlphaComposite.java
  ===================================================================
  RCS file: /home/cvs/xml-batik/sources/org/apache/batik/svggen/SVGAlphaComposite.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- SVGAlphaComposite.java	2001/03/14 01:36:46	1.5
  +++ SVGAlphaComposite.java	2001/03/19 09:26:08	1.6
  @@ -36,7 +36,7 @@
    * opacity property on the nodes to be composited.
    *
    * @author <a href="mailto:vincent.hardy@eng.sun.com">Vincent Hardy</a>
  - * @version $Id: SVGAlphaComposite.java,v 1.5 2001/03/14 01:36:46 vhardy Exp $
  + * @version $Id: SVGAlphaComposite.java,v 1.6 2001/03/19 09:26:08 cjolif Exp $
    * @see                org.apache.batik.svggen.SVGAlphaComposite
    */
   public class SVGAlphaComposite extends AbstractSVGConverter{
  @@ -259,84 +259,5 @@
           compositeFilter.appendChild(feMerge);
   
           return compositeFilter;
  -    }
  -
  -    /**
  -     * Unit testing
  -     */
  -    public static void main(String args[]) throws Exception {
  -        AlphaComposite ac = AlphaComposite.Src;
  -        AlphaComposite composites[] = { ac.SrcOver,
  -                                        ac.Src,
  -                                        ac.SrcIn,
  -                                        ac.SrcOut,
  -                                        ac.DstIn,
  -                                        ac.DstOut,
  -                                        ac.Clear,
  -                                        ac.getInstance(ac.SRC_OVER, .5f),
  -                                        ac.getInstance(ac.SRC, .5f),
  -                                        ac.getInstance(ac.SRC_IN, .5f),
  -                                        ac.getInstance(ac.SRC_OUT, .5f),
  -                                        ac.getInstance(ac.DST_IN, .5f),
  -                                        ac.getInstance(ac.DST_OUT, .5f),
  -                                        ac.getInstance(ac.CLEAR, .5f) };
  -
  -        Document domFactory = TestUtil.getDocumentPrototype();
  -        SVGAlphaComposite converter = new SVGAlphaComposite(domFactory);
  -
  -        Element groupOne = domFactory.createElementNS(SVG_NAMESPACE_URI, SVG_G_TAG);
  -        groupOne.setAttributeNS(null, ATTR_ID, "groupOne");
  -        buildTestGroup(groupOne, composites, converter);
  -
  -        Element groupTwo = domFactory.createElementNS(SVG_NAMESPACE_URI, SVG_G_TAG);
  -        groupTwo.setAttributeNS(null, ATTR_ID, "group2");
  -        buildTestGroup(groupTwo, composites, converter);
  -
  -        Element defs = domFactory.createElementNS(SVG_NAMESPACE_URI, SVG_DEFS_TAG);
  -        Iterator iter = converter.getAlphaCompositeFilterSet().iterator();
  -        while(iter.hasNext()){
  -            Element filter = (Element)iter.next();
  -            defs.appendChild(filter);
  -        }
  -
  -        Element groupThree = domFactory.createElementNS(SVG_NAMESPACE_URI, SVG_G_TAG);
  -        groupThree.setAttributeNS(null, ATTR_ID, "groupThree");
  -        SVGAlphaComposite newConverter = new SVGAlphaComposite(domFactory);
  -        buildTestGroup(groupThree, new AlphaComposite[]{ ac.SrcIn, ac.DstOut },
  -        newConverter);
  -        Element newDefs = domFactory.createElementNS(SVG_NAMESPACE_URI, SVG_DEFS_TAG);
  -        newDefs.setAttributeNS(null, ATTR_ID, "alphaCompositeSubset");
  -        Iterator newIter = newConverter.getDefinitionSet().iterator();
  -        while(newIter.hasNext()){
  -            Element filter = (Element)newIter.next();
  -            newDefs.appendChild(filter);
  -        }
  -
  -        groupThree.insertBefore(newDefs, groupThree.getFirstChild());
  -
  -        Element group = domFactory.createElementNS(SVG_NAMESPACE_URI, SVG_G_TAG);
  -        group.appendChild(defs);
  -        group.appendChild(groupOne);
  -        group.appendChild(groupTwo);
  -        group.appendChild(groupThree);
  -
  -        TestUtil.trace(group, System.out);
  -
  -    }
  -
  -    /**
  -     * For test purpose only
  -     */
  -    private static void buildTestGroup(Element group, AlphaComposite composites[], SVGAlphaComposite converter){
  -        Document domFactory = group.getOwnerDocument();
  -
  -        for(int i=0; i<composites.length; i++){
  -            SVGCompositeDescriptor compositeDesc = converter.toSVG(composites[i]);
  -            Element rect = domFactory.createElementNS(SVG_NAMESPACE_URI, SVG_RECT_TAG);
  -            rect.setAttributeNS(null, ATTR_OPACITY, compositeDesc.getOpacityValue());
  -            if(compositeDesc.getDef() != null)
  -                rect.setAttributeNS(null, SVG_FILTER_ATTRIBUTE, compositeDesc.getFilterValue());
  -            group.appendChild(rect);
  -        }
       }
   }
  
  
  
  1.7       +1 -48     xml-batik/sources/org/apache/batik/svggen/SVGBasicStroke.java
  
  Index: SVGBasicStroke.java
  ===================================================================
  RCS file: /home/cvs/xml-batik/sources/org/apache/batik/svggen/SVGBasicStroke.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- SVGBasicStroke.java	2001/03/14 01:36:46	1.6
  +++ SVGBasicStroke.java	2001/03/19 09:26:09	1.7
  @@ -19,7 +19,7 @@
    * a set of SVG style attributes
    *
    * @author <a href="mailto:vincent.hardy@eng.sun.com">Vincent Hardy</a>
  - * @version $Id: SVGBasicStroke.java,v 1.6 2001/03/14 01:36:46 vhardy Exp $
  + * @version $Id: SVGBasicStroke.java,v 1.7 2001/03/19 09:26:09 cjolif Exp $
    */
   public class SVGBasicStroke extends AbstractSVGConverter{
       /**
  @@ -117,52 +117,5 @@
           case BasicStroke.CAP_SQUARE:
               return VALUE_LINE_CAP_SQUARE;
           }
  -    }
  -
  -    /**
  -     * Unit testing
  -     */
  -    public static void main(String args[]) throws Exception {
  -        Document domFactory = TestUtil.getDocumentPrototype();
  -
  -        BasicStroke strokes[] = { new BasicStroke(),
  -                                  new BasicStroke(2),
  -                                  new BasicStroke(4.5f),
  -                                  new BasicStroke(10, BasicStroke.CAP_BUTT,
  -                                                  BasicStroke.JOIN_MITER),
  -                                  new BasicStroke(10, BasicStroke.CAP_SQUARE,
  -                                                  BasicStroke.JOIN_MITER),
  -                                  new BasicStroke(10, BasicStroke.CAP_ROUND,
  -                                                  BasicStroke.JOIN_MITER),
  -                                  new BasicStroke(10, BasicStroke.CAP_BUTT,
  -                                                  BasicStroke.JOIN_BEVEL),
  -                                  new BasicStroke(10, BasicStroke.CAP_BUTT,
  -                                                  BasicStroke.JOIN_ROUND),
  -                                  new BasicStroke(50, BasicStroke.CAP_ROUND,
  -                                                  BasicStroke.JOIN_MITER, 100),
  -                                  new BasicStroke(75, BasicStroke.CAP_ROUND,
  -                                                  BasicStroke.JOIN_ROUND, 50,
  -                                                  new float[]{1, 2, 3, 4}, 0.5f),
  -                                  new BasicStroke(75, BasicStroke.CAP_ROUND,
  -                                                  BasicStroke.JOIN_ROUND, 60,
  -                                                  new float[]{10.1f, 2.4f, 3.5f, 4.2f},
  -                                                  10)
  -        };
  -
  -        Element rectGroup = domFactory.createElementNS(SVG_NAMESPACE_URI, SVG_G_TAG);
  -
  -        for(int i=0; i<strokes.length; i++){
  -            BasicStroke stroke = strokes[i];
  -            Map attrMap = SVGBasicStroke.toSVG(stroke).getAttributeMap(null);
  -            Element rectElement = domFactory.createElementNS(SVG_NAMESPACE_URI, SVG_RECT_TAG);
  -            Iterator iter = attrMap.keySet().iterator();
  -            while(iter.hasNext()){
  -                String attrName = (String)iter.next();
  -                String attrValue = (String)attrMap.get(attrName);
  -                rectElement.setAttributeNS(null, attrName, attrValue);
  -            }
  -            rectGroup.appendChild(rectElement);
  -        }
  -        TestUtil.trace(rectGroup, System.out);
       }
   }
  
  
  
  1.5       +1 -66     xml-batik/sources/org/apache/batik/svggen/SVGBufferedImageOp.java
  
  Index: SVGBufferedImageOp.java
  ===================================================================
  RCS file: /home/cvs/xml-batik/sources/org/apache/batik/svggen/SVGBufferedImageOp.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- SVGBufferedImageOp.java	2001/02/05 10:56:13	1.4
  +++ SVGBufferedImageOp.java	2001/03/19 09:26:10	1.5
  @@ -25,7 +25,7 @@
    * an SVG filter.
    *
    * @author <a href="mailto:vincent.hardy@eng.sun.com">Vincent Hardy</a>
  - * @version $Id: SVGBufferedImageOp.java,v 1.4 2001/02/05 10:56:13 tkormann Exp $
  + * @version $Id: SVGBufferedImageOp.java,v 1.5 2001/03/19 09:26:10 cjolif Exp $
    * @see                org.apache.batik.svggen.SVGCustomBufferedImageOp
    * @see                org.apache.batik.svggen.SVGLookupOp
    * @see                org.apache.batik.svggen.SVGRescaleOp
  @@ -124,70 +124,5 @@
           }
   
           return filterDesc;
  -    }
  -
  -    /**
  -     * Unit testing
  -     */
  -    public static void main(String args[]) throws Exception {
  -        byte bi[] = new byte[256];
  -        for(int i=0; i<=255; i++)
  -            bi[i] = (byte)(0xff & (255-i));
  -
  -        float kernelData[] = { 1, 1, 1,
  -                               2, 2, 2,
  -                               3, 3, 3 };
  -        Kernel kernel = new Kernel(3, 3, kernelData);
  -
  -        BufferedImageOp ops[] = { new LookupOp(new ByteLookupTable(0, bi), null),
  -                                  new RescaleOp(4, 0, null),
  -                                  new ConvolveOp(kernel),
  -                                  new NullOp(),
  -        };
  -
  -        Document domFactory = TestUtil.getDocumentPrototype();
  -        SVGBufferedImageOp converter = new SVGBufferedImageOp(domFactory,
  -                                                              new DefaultExtensionHandler());
  -
  -        Element group = domFactory.createElementNS(SVG_NAMESPACE_URI,
  -                                                   SVG_G_TAG);
  -        Element defs = domFactory.createElementNS(SVG_NAMESPACE_URI,
  -                                                  SVG_DEFS_TAG);
  -        Element rectGroupOne = domFactory.createElementNS(SVG_NAMESPACE_URI,
  -                                                          SVG_G_TAG);
  -        Element rectGroupTwo = domFactory.createElementNS(SVG_NAMESPACE_URI,
  -                                                          SVG_G_TAG);
  -
  -        for(int i=0; i<ops.length; i++){
  -            SVGFilterDescriptor filterDesc = converter.toSVG(ops[i], null);
  -            if(filterDesc != null){
  -                Element rect = domFactory.createElementNS(SVG_NAMESPACE_URI,
  -                                                          SVG_RECT_TAG);
  -                rect.setAttributeNS(null, SVG_FILTER_ATTRIBUTE, filterDesc.getFilterValue());
  -                rectGroupOne.appendChild(rect);
  -            }
  -        }
  -
  -        for(int i=0; i<ops.length; i++){
  -            SVGFilterDescriptor filterDesc = converter.toSVG(ops[i], null);
  -            if(filterDesc != null){
  -                Element rect = domFactory.createElementNS(SVG_NAMESPACE_URI,
  -                                                          SVG_RECT_TAG);
  -                rect.setAttributeNS(null, SVG_FILTER_ATTRIBUTE, filterDesc.getFilterValue());
  -                rectGroupTwo.appendChild(rect);
  -            }
  -        }
  -
  -        Iterator iter = converter.getDefinitionSet().iterator();
  -        while(iter.hasNext()){
  -            Element filterDef = (Element)iter.next();
  -            defs.appendChild(filterDef);
  -        }
  -
  -        group.appendChild(defs);
  -        group.appendChild(rectGroupOne);
  -        group.appendChild(rectGroupTwo);
  -
  -        TestUtil.trace(group, System.out);
       }
   }
  
  
  
  1.5       +1 -19     xml-batik/sources/org/apache/batik/svggen/SVGCSSStyler.java
  
  Index: SVGCSSStyler.java
  ===================================================================
  RCS file: /home/cvs/xml-batik/sources/org/apache/batik/svggen/SVGCSSStyler.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- SVGCSSStyler.java	2001/03/14 01:36:46	1.4
  +++ SVGCSSStyler.java	2001/03/19 09:26:10	1.5
  @@ -17,7 +17,7 @@
    * attribute into one that uses the CSS style attribute instead
    *
    * @author <a href="mailto:vincent.hardy@eng.sun.com">Vincent Hardy</a>
  - * @version $Id: SVGCSSStyler.java,v 1.4 2001/03/14 01:36:46 vhardy Exp $
  + * @version $Id: SVGCSSStyler.java,v 1.5 2001/03/19 09:26:10 cjolif Exp $
    */
   public class SVGCSSStyler implements SVGSyntax{
       static private String CSS_PROPERTY_VALUE_SEPARATOR = ":";
  @@ -75,23 +75,5 @@
               style(child);
           }
   
  -    }
  -
  -    /**
  -     * Unit testing
  -     */
  -    public static void main(String args[]) throws Exception{
  -        SVGGraphics2D g = new SVGGraphics2D(TestUtil.getDocumentPrototype());
  -        g.setRenderingHint(java.awt.RenderingHints.KEY_ANTIALIASING,
  -                           java.awt.RenderingHints.VALUE_ANTIALIAS_ON);
  -
  -        // Text
  -        g.setPaint(new java.awt.Color(103, 103, 152));
  -        g.fillRect(10, 10, 200, 50);
  -        g.setPaint(java.awt.Color.white);
  -        g.setFont(new java.awt.Font("SunSansCondensed-Heavy", java.awt.Font.PLAIN, 20));
  -        g.drawString("Hello Java 2D to SVG", 40f, 40f);
  -
  -        g.stream(new java.io.OutputStreamWriter(System.out));
       }
   }
  
  
  
  1.6       +30 -135   xml-batik/sources/org/apache/batik/svggen/SVGClip.java
  
  Index: SVGClip.java
  ===================================================================
  RCS file: /home/cvs/xml-batik/sources/org/apache/batik/svggen/SVGClip.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- SVGClip.java	2001/03/14 01:36:46	1.5
  +++ SVGClip.java	2001/03/19 09:26:11	1.6
  @@ -25,7 +25,7 @@
    * Utility class that converts a Path object into an SVG clip
    *
    * @author <a href="mailto:vincent.hardy@eng.sun.com">Vincent Hardy</a>
  - * @version $Id: SVGClip.java,v 1.5 2001/03/14 01:36:46 vhardy Exp $
  + * @version $Id: SVGClip.java,v 1.6 2001/03/19 09:26:11 cjolif Exp $
    */
   public class SVGClip extends AbstractSVGConverter{
       /**
  @@ -115,111 +115,6 @@
           clipDef.appendChild(clipPath);
           return clipDef;
       }
  -
  -    /**
  -     * Unit testing
  -     */
  -    public static void main(String args[]) throws Exception {
  -        Polygon polygon = new Polygon();
  -        polygon.addPoint(1, 1);
  -        polygon.addPoint(2, 1);
  -        polygon.addPoint(3, 2);
  -        polygon.addPoint(3, 3);
  -        polygon.addPoint(2, 4);
  -        polygon.addPoint(1, 3);
  -        polygon.addPoint(1, 2);
  -
  -        GeneralPath square = new GeneralPath();
  -        square.moveTo(0, 0);
  -        square.lineTo(1, 0);
  -        square.lineTo(1, 1);
  -        square.lineTo(0, 1);
  -        square.closePath();
  -
  -        Ellipse2D hole = new Ellipse2D.Double(0, 0, 1, 1);
  -        Area area = new Area(square);
  -        area.subtract(new Area(hole));
  -
  -        ClipKey key1 = new ClipKey(new GeneralPath(polygon));
  -        ClipKey key2 = new ClipKey(new GeneralPath(polygon));
  -
  -        System.out.println("key1.equals(key2) = " + key1.equals(key2));
  -
  -        int hash1 = key1.hashCode();
  -        int hash2 = key2.hashCode();
  -
  -        System.out.println("hash1 = " + hash1);
  -        System.out.println("hash2 = " + hash2);
  -
  -        Shape clips[] = {
  -            // polygon
  -            polygon,
  -
  -            // rect
  -            new Rectangle(10, 20, 30, 40),
  -            new Rectangle2D.Double(100., 200., 300., 400.),
  -            new Rectangle2D.Float(1000f, 2000f, 3000f, 4000f),
  -            new RoundRectangle2D.Double(15., 16., 17., 18., 30., 20.),
  -            new RoundRectangle2D.Float(35f, 45f, 55f, 65f, 25f, 45f),
  -
  -            // Circle
  -            new Ellipse2D.Float(0, 0, 100, 100),
  -            new Ellipse2D.Double(40, 40, 240, 240),
  -
  -            // Ellipse
  -            new Ellipse2D.Float(0, 0, 100, 200),
  -            new Ellipse2D.Float(40, 100, 240, 200),
  -
  -            // line
  -            new Line2D.Double(1, 2, 3, 4),
  -            new Line2D.Double(10, 20, 30, 40),
  -
  -            // path
  -            new QuadCurve2D.Float(20, 30, 40, 50, 60, 70),
  -            new CubicCurve2D.Float(15, 25, 35, 45, 55, 65, 75, 85),
  -            new Arc2D.Double(0, 0, 100, 100, 0, 90, Arc2D.OPEN),
  -            square,
  -            area
  -        };
  -
  -        Document domFactory = TestUtil.getDocumentPrototype();
  -        SVGClip converter = new SVGClip(domFactory);
  -
  -        Element topLevelGroup = domFactory.createElementNS(SVG_NAMESPACE_URI, SVG_G_TAG);
  -        Element defs = domFactory.createElementNS(SVG_NAMESPACE_URI, SVG_DEFS_TAG);
  -
  -        Element groupOne = domFactory.createElementNS(SVG_NAMESPACE_URI, SVG_G_TAG);
  -        for(int i=0; i<clips.length; i++){
  -            Element rect = domFactory.createElementNS(SVG_NAMESPACE_URI, SVG_RECT_TAG);
  -            rect.setAttributeNS(null, ATTR_ID, clips[i].getClass().getName());
  -            rect.setAttributeNS(null, SVG_CLIP_PATH_ATTRIBUTE, (String)converter.toSVG(clips[i]).getAttributeMap(null).get(SVG_CLIP_PATH_ATTRIBUTE));
  -            groupOne.appendChild(rect);
  -        }
  -
  -        // Elements in groupTwo should have the same clip reference as
  -        // corresponding elements in groupOne, as the clip definition
  -        // has already be done and put in clipDefsMap.
  -        Element groupTwo = domFactory.createElementNS(SVG_NAMESPACE_URI, SVG_G_TAG);
  -        for(int i=0; i<clips.length; i++){
  -            Element rect = domFactory.createElementNS(SVG_NAMESPACE_URI, SVG_RECT_TAG);
  -            rect.setAttributeNS(null, ATTR_ID, clips[i].getClass().getName());
  -            rect.setAttributeNS(null, SVG_CLIP_PATH_ATTRIBUTE, (String)converter.toSVG(clips[i]).getAttributeMap(null).get(SVG_CLIP_PATH_ATTRIBUTE));
  -            groupTwo.appendChild(rect);
  -        }
  -
  -        Iterator defValuesIter = converter.getDefinitionSet().iterator();
  -        while(defValuesIter.hasNext()){
  -            Element clipPathElement = (Element)defValuesIter.next();
  -            defs.appendChild(clipPathElement);
  -        }
  -
  -        topLevelGroup.appendChild(defs);
  -        topLevelGroup.appendChild(groupOne);
  -        topLevelGroup.appendChild(groupTwo);
  -
  -        TestUtil.trace(topLevelGroup, System.out);
  -    }
  -
   }
   
   /**
  @@ -228,37 +123,37 @@
    * on the value of GeneralPath and GeneralPath's equal
    * method does not implement that behavior.
    */
  -class ClipKey{
  -/**
  -* This clip hash code. Based on the serialized path
  -* data
  -*/
  -int hashCodeValue = 0;
  +class ClipKey {
  +    /**
  +     * This clip hash code. Based on the serialized path
  +     * data
  +     */
  +    int hashCodeValue = 0;
   
  -/**
  -* @param proxiedPath path used as an index in the Map
  -*/
  -public ClipKey(GeneralPath proxiedPath){
  -String pathData = SVGPath.toSVGPathData(proxiedPath);
  -hashCodeValue = pathData.hashCode();
  -}
  +    /**
  +     * @param proxiedPath path used as an index in the Map
  +     */
  +    public ClipKey(GeneralPath proxiedPath ){
  +        String pathData = SVGPath.toSVGPathData(proxiedPath);
  +        hashCodeValue = pathData.hashCode();
  +    }
   
  -/**
  -* @return this object's hashcode
  -*/
  - public int hashCode(){
  -     return hashCodeValue;
  - }
  +    /**
  +     * @return this object's hashcode
  +     */
  +    public int hashCode() {
  +        return hashCodeValue;
  +    }
   
  -/**
  - * @param object to compare
  - * @return true if equal, false otherwise
  - */
  -public boolean equals(Object clipKey){
  -    boolean isEqual = false;
  -    if((clipKey != null) &&clipKey instanceof ClipKey)
  -        isEqual = (hashCodeValue == ((ClipKey)clipKey).hashCodeValue);
  +    /**
  +     * @param object to compare
  +     * @return true if equal, false otherwise
  +     */
  +    public boolean equals(Object clipKey){
  +        boolean isEqual = false;
  +        if((clipKey != null) &&clipKey instanceof ClipKey)
  +            isEqual = (hashCodeValue == ((ClipKey)clipKey).hashCodeValue);
   
  -    return isEqual;
  -}
  +        return isEqual;
  +    }
   }
  
  
  
  1.6       +1 -43     xml-batik/sources/org/apache/batik/svggen/SVGColor.java
  
  Index: SVGColor.java
  ===================================================================
  RCS file: /home/cvs/xml-batik/sources/org/apache/batik/svggen/SVGColor.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- SVGColor.java	2001/03/14 01:36:46	1.5
  +++ SVGColor.java	2001/03/19 09:26:12	1.6
  @@ -23,7 +23,7 @@
    * corresponding SVG attributes.
    *
    * @author <a href="mailto:vincent.hardy@eng.sun.com">Vincent Hardy</a>
  - * @version $Id: SVGColor.java,v 1.5 2001/03/14 01:36:46 vhardy Exp $
  + * @version $Id: SVGColor.java,v 1.6 2001/03/19 09:26:12 cjolif Exp $
    * @see                 org.apache.batik.svggen.DOMTreeManager
    */
   public class SVGColor extends AbstractSVGConverter{
  @@ -116,47 +116,5 @@
           String alphaString = doubleString(alpha);
   
           return new SVGPaintDescriptor(cssColor, alphaString);
  -    }
  -
  -    /**
  -     * Unit testing
  -     */
  -    public static void main(String args[]) throws Exception{
  -
  -        Color  testColors[] = {
  -            new Color(0x00, 0xff, 0xff), // aqua
  -            new Color(0x00, 0x00, 0x00), // black
  -            new Color(0x00, 0x00, 0xff), // blue
  -            new Color(0xff, 0x00, 0xff), // fuchsia
  -            new Color(0x80, 0x80, 0x80), // gray
  -            new Color(0x00, 0x80, 0x00), // green
  -            new Color(0x00, 0xff, 0x00), // lime
  -            new Color(0x80, 0x00, 0x00), // maroon
  -            new Color(0x00, 0x00, 0x80), // navy
  -            new Color(0x80, 0x80, 00),   // olive
  -            new Color(0x80, 0x00, 0x80), // purple
  -            new Color(0xff, 0x00, 0x00), // red
  -            new Color(0xc0, 0xc0, 0xc0), // silver
  -            new Color(0x00, 0x80, 0x80), // teal
  -            new Color(0xff, 0xff, 0xff), // white
  -            new Color(0xff, 0xff, 0x00), // yellow
  -            new Color(30, 40, 50),       // arbitrary 1
  -            new Color(255, 30, 200),     // arbitraty 2
  -            new Color(0, 0, 0, 128),     // arbitrary with alpha
  -            new Color(255, 255, 255, 64),// arbitrary with alpha
  -        };
  -
  -        Document domFactory = TestUtil.getDocumentPrototype();
  -        Element group = domFactory.createElementNS(SVG_NAMESPACE_URI, SVG_G_TAG);
  -        for(int i=0; i<testColors.length; i++){
  -            SVGPaintDescriptor paintDesc = toSVG(testColors[i]);
  -            Element rect = domFactory.createElementNS(SVG_NAMESPACE_URI,
  -                                                      SVG_RECT_TAG);
  -            rect.setAttributeNS(null, SVG_FILL_ATTRIBUTE, paintDesc.getPaintValue());
  -            rect.setAttributeNS(null, SVG_FILL_OPACITY_ATTRIBUTE, paintDesc.getOpacityValue());
  -            group.appendChild(rect);
  -        }
  -
  -        TestUtil.trace(group, System.out);
       }
   }
  
  
  
  1.5       +1 -49     xml-batik/sources/org/apache/batik/svggen/SVGConvolveOp.java
  
  Index: SVGConvolveOp.java
  ===================================================================
  RCS file: /home/cvs/xml-batik/sources/org/apache/batik/svggen/SVGConvolveOp.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- SVGConvolveOp.java	2001/02/05 10:56:14	1.4
  +++ SVGConvolveOp.java	2001/03/19 09:26:13	1.5
  @@ -24,7 +24,7 @@
    * an SVG filter descriptor.
    *
    * @author <a href="mailto:vincent.hardy@eng.sun.com">Vincent Hardy</a>
  - * @version $Id: SVGConvolveOp.java,v 1.4 2001/02/05 10:56:14 tkormann Exp $
  + * @version $Id: SVGConvolveOp.java,v 1.5 2001/03/19 09:26:13 cjolif Exp $
    * @see                org.apache.batik.svggen.SVGBufferedImageOp
    */
   public class SVGConvolveOp extends AbstractSVGFilterConverter{
  @@ -119,53 +119,5 @@
           }
   
           return filterDesc;
  -    }
  -
  -    /**
  -     * Unit testing
  -     */
  -    public static void main(String args[]) throws Exception{
  -        Document domFactory = TestUtil.getDocumentPrototype();
  -
  -        Kernel k = new Kernel(5, 3, new float[] { 1, 1, 1, 1, 1,
  -                                                      2, 2, 2, 2, 2,
  -                                                      3, 3, 3, 3, 3 });
  -        ConvolveOp convolveOps[] = { new ConvolveOp(k),
  -                                     new ConvolveOp(k, ConvolveOp.EDGE_NO_OP, null),
  -                                     new ConvolveOp(k, ConvolveOp.EDGE_ZERO_FILL, null) };
  -
  -
  -        SVGConvolveOp converter = new SVGConvolveOp(domFactory);
  -
  -        Element group = domFactory.createElementNS(SVG_NAMESPACE_URI, SVG_G_TAG);
  -        Element defs = domFactory.createElementNS(SVG_NAMESPACE_URI, SVG_DEFS_TAG);
  -        Element rectGroupOne = domFactory.createElementNS(SVG_NAMESPACE_URI, SVG_G_TAG);
  -        Element rectGroupTwo = domFactory.createElementNS(SVG_NAMESPACE_URI, SVG_G_TAG);
  -
  -        for(int i=0; i<convolveOps.length; i++){
  -            SVGFilterDescriptor filterDesc = converter.toSVG(convolveOps[i]);
  -            Element rect = domFactory.createElementNS(SVG_NAMESPACE_URI, SVG_RECT_TAG);
  -            rect.setAttributeNS(null, SVG_FILTER_ATTRIBUTE, filterDesc.getFilterValue());
  -            rectGroupOne.appendChild(rect);
  -        }
  -
  -        for(int i=0; i<convolveOps.length; i++){
  -            SVGFilterDescriptor filterDesc = converter.toSVG(convolveOps[i]);
  -            Element rect = domFactory.createElementNS(SVG_NAMESPACE_URI, SVG_RECT_TAG);
  -            rect.setAttributeNS(null, SVG_FILTER_ATTRIBUTE, filterDesc.getFilterValue());
  -            rectGroupTwo.appendChild(rect);
  -        }
  -
  -        Iterator iter = converter.getDefinitionSet().iterator();
  -        while(iter.hasNext()){
  -            Element feConvolveMatrixDef = (Element)iter.next();
  -            defs.appendChild(feConvolveMatrixDef);
  -        }
  -
  -        group.appendChild(defs);
  -        group.appendChild(rectGroupOne);
  -        group.appendChild(rectGroupTwo);
  -
  -        TestUtil.trace(group, System.out);
       }
   }
  
  
  
  1.4       +1 -19     xml-batik/sources/org/apache/batik/svggen/SVGEllipse.java
  
  Index: SVGEllipse.java
  ===================================================================
  RCS file: /home/cvs/xml-batik/sources/org/apache/batik/svggen/SVGEllipse.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- SVGEllipse.java	2001/01/30 17:34:51	1.3
  +++ SVGEllipse.java	2001/03/19 09:26:14	1.4
  @@ -19,7 +19,7 @@
    * a corresponding SVG element, i.e., a circle or an ellipse.
    *
    * @author <a href="mailto:vincent.hardy@eng.sun.com">Vincent Hardy</a>
  - * @version $Id: SVGEllipse.java,v 1.3 2001/01/30 17:34:51 vhardy Exp $
  + * @version $Id: SVGEllipse.java,v 1.4 2001/03/19 09:26:14 cjolif Exp $
    */
   public class SVGEllipse extends SVGGraphicObjectConverter{
       /**
  @@ -66,23 +66,5 @@
           svgCircle.setAttributeNS(null, SVG_RY_ATTRIBUTE,
                                  doubleString(ellipse.getHeight()/2));
           return svgCircle;
  -    }
  -
  -    /**
  -     * Unit testing
  -     */
  -    public static void main(String args[]) throws Exception {
  -        Ellipse2D ellipses [] = { new Ellipse2D.Float(0, 0, 100, 100),
  -                                  new Ellipse2D.Double(40, 40, 240, 240),
  -                                  new Ellipse2D.Float(0, 0, 100, 200),
  -                                  new Ellipse2D.Float(40, 100, 240, 200) };
  -
  -        Document domFactory = TestUtil.getDocumentPrototype();
  -        SVGEllipse converter = new SVGEllipse(domFactory);
  -        Element group = domFactory.createElementNS(SVG_NAMESPACE_URI, SVG_G_TAG);
  -        for(int i=0; i<ellipses.length; i++)
  -            group.appendChild(converter.toSVG(ellipses[i]));
  -
  -        TestUtil.trace(group, System.out);
       }
   }
  
  
  
  1.5       +1 -81     xml-batik/sources/org/apache/batik/svggen/SVGFont.java
  
  Index: SVGFont.java
  ===================================================================
  RCS file: /home/cvs/xml-batik/sources/org/apache/batik/svggen/SVGFont.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- SVGFont.java	2001/03/14 01:36:47	1.4
  +++ SVGFont.java	2001/03/19 09:26:15	1.5
  @@ -21,7 +21,7 @@
    * font attributes
    *
    * @author <a href="mailto:vincent.hardy@eng.sun.com">Vincent Hardy</a>
  - * @version $Id: SVGFont.java,v 1.4 2001/03/14 01:36:47 vhardy Exp $
  + * @version $Id: SVGFont.java,v 1.5 2001/03/19 09:26:15 cjolif Exp $
    */
   public class SVGFont extends AbstractSVGConverter{
       public static final float EXTRA_LIGHT = TextAttribute.WEIGHT_EXTRA_LIGHT.floatValue();
  @@ -192,85 +192,5 @@
           }
   
           return svgWeights[i];
  -    }
  -
  -    /**
  -     * Unit testing
  -     */
  -    public static void main(String args[]) throws Exception{
  -        Font fonts[] = GraphicsEnvironment.getLocalGraphicsEnvironment().getAllFonts();
  -        // traceFonts(fonts);
  -
  -        Object customFontAttributes[][] = {
  -            { TextAttribute.WEIGHT, TextAttribute.WEIGHT_EXTRA_LIGHT},
  -            { TextAttribute.WEIGHT, TextAttribute.WEIGHT_LIGHT },
  -            { TextAttribute.WEIGHT, TextAttribute.WEIGHT_DEMILIGHT },
  -            { TextAttribute.WEIGHT, TextAttribute.WEIGHT_REGULAR },
  -            { TextAttribute.WEIGHT, TextAttribute.WEIGHT_SEMIBOLD },
  -            { TextAttribute.WEIGHT, TextAttribute.WEIGHT_MEDIUM },
  -            { TextAttribute.WEIGHT, TextAttribute.WEIGHT_DEMIBOLD },
  -            { TextAttribute.WEIGHT, TextAttribute.WEIGHT_BOLD },
  -            { TextAttribute.WEIGHT, TextAttribute.WEIGHT_HEAVY },
  -            { TextAttribute.WEIGHT, TextAttribute.WEIGHT_EXTRABOLD },
  -            { TextAttribute.WEIGHT, TextAttribute.WEIGHT_ULTRABOLD },
  -            { TextAttribute.POSTURE, TextAttribute.POSTURE_REGULAR },
  -            { TextAttribute.POSTURE, TextAttribute.POSTURE_OBLIQUE }
  -        };
  -
  -        Map defaultAttrMap = new Hashtable();
  -        defaultAttrMap.put(TextAttribute.SIZE, new Float(45));
  -        defaultAttrMap.put(TextAttribute.FAMILY, "Serif");
  -        defaultAttrMap.put(TextAttribute.WEIGHT, TextAttribute.WEIGHT_BOLD);
  -        defaultAttrMap.put(TextAttribute.POSTURE, TextAttribute.POSTURE_OBLIQUE);
  -
  -        Font customFonts[] = new Font[customFontAttributes.length];
  -        for(int i=0; i<customFonts.length; i++){
  -            Map fontAttrMap = new Hashtable(defaultAttrMap);
  -            fontAttrMap.put(customFontAttributes[i][0],
  -                            customFontAttributes[i][1]);
  -
  -            customFonts[i] = new Font(fontAttrMap);
  -        }
  -
  -        // traceFonts(customFonts);
  -
  -        Font logicalFonts[] = { new Font("dialog", Font.PLAIN, 12),
  -                                new Font("dialoginput", Font.PLAIN, 12),
  -                                new Font("monospaced", Font.PLAIN, 12),
  -                                new Font("serif", Font.PLAIN, 12),
  -                                new Font("sansserif", Font.PLAIN, 12),
  -                                new Font("symbol", Font.PLAIN, 12) };
  -
  -        traceFonts(logicalFonts);
  -
  -    }
  -
  -    /**
  -     * For Unit testing only
  -     */
  -    public static void traceFonts(Font fonts[]) throws Exception{
  -        Document domFactory = TestUtil.getDocumentPrototype();
  -        Element group = domFactory.createElementNS(SVG_NAMESPACE_URI, SVG_G_TAG);
  -        SVGFont converter = new SVGFont();
  -
  -        for(int i=0; i<fonts.length; i++){
  -            Font font = fonts[i];
  -            Map attrMap = converter.toSVG(font).getAttributeMap(null);
  -            Element textElement = domFactory.createElementNS(SVG_NAMESPACE_URI, SVG_TEXT_TAG);
  -            Iterator iter = attrMap.keySet().iterator();
  -            while(iter.hasNext()){
  -                String attrName = (String)iter.next();
  -                String attrValue = (String)attrMap.get(attrName);
  -                textElement.setAttributeNS(null, attrName, attrValue);
  -            }
  -            textElement.setAttributeNS(null, SVG_FONT_SIZE_ATTRIBUTE, "30");
  -            textElement.setAttributeNS(null, SVG_X_ATTRIBUTE, "30");
  -            textElement.setAttributeNS(null, SVG_Y_ATTRIBUTE, "" + (40*(i+1)));
  -            textElement.appendChild(domFactory.createTextNode(font.getFamily()));
  -            group.appendChild(textElement);
  -        }
  -
  -        SVGCSSStyler.style(group);
  -        TestUtil.trace(group, System.out);
       }
   }
  
  
  
  1.4       +1 -88     xml-batik/sources/org/apache/batik/svggen/SVGGraphicContextConverter.java
  
  Index: SVGGraphicContextConverter.java
  ===================================================================
  RCS file: /home/cvs/xml-batik/sources/org/apache/batik/svggen/SVGGraphicContextConverter.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- SVGGraphicContextConverter.java	2001/03/14 01:36:47	1.3
  +++ SVGGraphicContextConverter.java	2001/03/19 09:26:16	1.4
  @@ -25,7 +25,7 @@
    * SVG attributes.
    *
    * @author <a href="mailto:vincent.hardy@eng.sun.com">Vincent Hardy</a>
  - * @version $Id: SVGGraphicContextConverter.java,v 1.3 2001/03/14 01:36:47 vhardy Exp $
  + * @version $Id: SVGGraphicContextConverter.java,v 1.4 2001/03/19 09:26:16 cjolif Exp $
    */
   public class SVGGraphicContextConverter implements SVGSyntax{
       public static final String ERROR_NULL_INPUT = "domFactory, extensionHandler and imageHandler should not be null";
  @@ -142,92 +142,5 @@
               defSet.addAll(converters[i].getDefinitionSet());
   
           return defSet;
  -    }
  -
  -    /**
  -     * Unit testing
  -     */
  -    public static void main(String args[]) throws Exception {
  -        Document domFactory = TestUtil.getDocumentPrototype();
  -
  -        //
  -        // Create a GraphicContext and do the following:
  -        // a. Dump list of default SVG attributes
  -        // b. Modify the value of each of the context attributes
  -        // c. Dump new list of SVG attributes
  -        // d. Dump list of defs
  -        //
  -
  -        GraphicContext gc = new GraphicContext(new AffineTransform());
  -        SVGGraphicContextConverter converter = new SVGGraphicContextConverter(domFactory,
  -                                                                              new DefaultExtensionHandler(),
  -                                                                              new DefaultImageHandler());
  -        SVGGraphicContext defaultSVGGC = converter.toSVG(gc);
  -        traceSVGGC(defaultSVGGC, converter);
  -
  -        // Transform
  -        gc.translate(40, 40);
  -
  -        // Paint
  -        gc.setPaint(new GradientPaint(0, 0, Color.yellow, 200, 200, Color.red));
  -
  -        // Stroke
  -        gc.setStroke(new BasicStroke(4, BasicStroke.CAP_ROUND, BasicStroke.JOIN_BEVEL, 40, new float[]{ 4, 5, 6, 7 }, 3));
  -
  -        // Composite
  -        gc.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_IN, .25f));
  -
  -        // Clip
  -        gc.setClip(new Ellipse2D.Double(20, 30, 40, 50));
  -
  -        // Hints
  -        gc.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
  -
  -        // Font
  -        gc.setFont(new Font("French Script MT", Font.BOLD, 45));
  -
  -        SVGGraphicContext modifiedSVGGC = converter.toSVG(gc);
  -
  -        traceSVGGC(modifiedSVGGC, converter);
  -
  -        Set defSet = converter.getDefinitionSet();
  -        Iterator iter = defSet.iterator();
  -        Element defs = domFactory.createElementNS(SVG_NAMESPACE_URI, SVG_DEFS_TAG);
  -        while(iter.hasNext()){
  -            Element def = (Element)iter.next();
  -            defs.appendChild(def);
  -        }
  -
  -        TestUtil.trace(defs, System.out);
  -    }
  -
  -    /**
  -     * For unit testing only
  -     */
  -    static void traceSVGGC(SVGGraphicContext svgGC, SVGGraphicContextConverter converter){
  -        System.out.println("=============================================");
  -        Map groupAttrMap = svgGC.getGroupContext();
  -        Iterator iter = groupAttrMap.keySet().iterator();
  -        while(iter.hasNext()){
  -            String attrName = (String)iter.next();
  -            String attrValue = (String)groupAttrMap.get(attrName);
  -            System.out.println(attrName + " = " + attrValue);
  -        }
  -
  -        System.out.println("++++++++++++++++++");
  -
  -        Map geAttrMap = svgGC.getGraphicElementContext();
  -        iter = geAttrMap.keySet().iterator();
  -        while(iter.hasNext()){
  -            String attrName = (String)iter.next();
  -            String attrValue = (String)geAttrMap.get(attrName);
  -            System.out.println(attrName + " = " + attrValue);
  -        }
  -
  -        System.out.println("++++++++++++++++++");
  -        System.out.println("transform: " + converter.toSVG(svgGC.getTransformStack()));
  -
  -        System.out.println("=============================================");
  -
       }
   }
  
  
  
  1.5       +1 -18     xml-batik/sources/org/apache/batik/svggen/SVGLine.java
  
  Index: SVGLine.java
  ===================================================================
  RCS file: /home/cvs/xml-batik/sources/org/apache/batik/svggen/SVGLine.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- SVGLine.java	2001/02/05 10:56:15	1.4
  +++ SVGLine.java	2001/03/19 09:26:17	1.5
  @@ -19,7 +19,7 @@
    * a corresponding SVG line element.
    *
    * @author <a href="mailto:vincent.hardy@eng.sun.com">Vincent Hardy</a>
  - * @version $Id: SVGLine.java,v 1.4 2001/02/05 10:56:15 tkormann Exp $
  + * @version $Id: SVGLine.java,v 1.5 2001/03/19 09:26:17 cjolif Exp $
    */
   public class SVGLine extends SVGGraphicObjectConverter{
       /**
  @@ -40,22 +40,5 @@
           svgLine.setAttributeNS(null, ATTR_X2, doubleString(line.getX2()));
           svgLine.setAttributeNS(null, ATTR_Y2, doubleString(line.getY2()));
           return svgLine;
  -    }
  -
  -    /**
  -     * Unit testing
  -     */
  -    public static final void main(String args[]) throws Exception{
  -        Line2D lines [] = { new Line2D.Double(1, 2, 3, 4),
  -                            new Line2D.Double(10, 20, 30, 40) };
  -
  -        Document domFactory = TestUtil.getDocumentPrototype();
  -        SVGLine converter = new SVGLine(domFactory);
  -        Element group = domFactory.createElementNS(SVG_NAMESPACE_URI,
  -                                                   SVG_G_TAG);
  -        for(int i=0; i<lines.length; i++)
  -            group.appendChild(converter.toSVG(lines[i]));
  -
  -        TestUtil.trace(group, System.out);
       }
   }
  
  
  
  1.6       +1 -36     xml-batik/sources/org/apache/batik/svggen/SVGLinearGradient.java
  
  Index: SVGLinearGradient.java
  ===================================================================
  RCS file: /home/cvs/xml-batik/sources/org/apache/batik/svggen/SVGLinearGradient.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- SVGLinearGradient.java	2001/03/14 01:36:47	1.5
  +++ SVGLinearGradient.java	2001/03/19 09:26:18	1.6
  @@ -28,7 +28,7 @@
    * SVG linear gradient element
    *
    * @author <a href="mailto:vincent.hardy@eng.sun.com">Vincent Hardy</a>
  - * @version $Id: SVGLinearGradient.java,v 1.5 2001/03/14 01:36:47 vhardy Exp $
  + * @version $Id: SVGLinearGradient.java,v 1.6 2001/03/19 09:26:18 cjolif Exp $
    */
   public class SVGLinearGradient extends AbstractSVGConverter{
       /**
  @@ -141,40 +141,5 @@
           }
   
           return gradientDesc;
  -    }
  -
  -    /**
  -     * Unit testing
  -     */
  -    public static void main(String args[]) throws Exception{
  -        Document domFactory = TestUtil.getDocumentPrototype();
  -
  -        GradientPaint gradient = new GradientPaint(20, 20,
  -                                                   Color.black,
  -                                                   300, 300,
  -                                                   new Color(220, 230, 240),
  -                                                   true);
  -
  -        SVGLinearGradient converter = new SVGLinearGradient(domFactory);
  -
  -        Element group = domFactory.createElementNS(SVG_NAMESPACE_URI, SVG_G_TAG);
  -        Element defs = domFactory.createElementNS(SVG_NAMESPACE_URI, SVG_DEFS_TAG);
  -
  -        SVGPaintDescriptor gradientDesc = converter.toSVG(gradient);
  -
  -        Iterator iter = converter.getDefinitionSet().iterator();
  -        while(iter.hasNext()){
  -            Element linearGradientDef = (Element)iter.next();
  -            defs.appendChild(linearGradientDef);
  -        }
  -
  -        Element rect = domFactory.createElementNS(SVG_NAMESPACE_URI, SVG_RECT_TAG);
  -        rect.setAttributeNS(null, SVG_FILL_ATTRIBUTE, gradientDesc.getPaintValue());
  -        rect.setAttributeNS(null, SVG_FILL_OPACITY_ATTRIBUTE, gradientDesc.getOpacityValue());
  -
  -        group.appendChild(defs);
  -        group.appendChild(rect);
  -
  -        TestUtil.trace(group, System.out);
       }
   }
  
  
  
  1.6       +2 -76     xml-batik/sources/org/apache/batik/svggen/SVGLookupOp.java
  
  Index: SVGLookupOp.java
  ===================================================================
  RCS file: /home/cvs/xml-batik/sources/org/apache/batik/svggen/SVGLookupOp.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- SVGLookupOp.java	2001/02/05 10:56:16	1.5
  +++ SVGLookupOp.java	2001/03/19 09:26:19	1.6
  @@ -27,7 +27,7 @@
    * of the lookup table.
    *
    * @author <a href="mailto:vincent.hardy@eng.sun.com">Vincent Hardy</a>
  - * @version $Id: SVGLookupOp.java,v 1.5 2001/02/05 10:56:16 tkormann Exp $
  + * @version $Id: SVGLookupOp.java,v 1.6 2001/03/19 09:26:19 cjolif Exp $
    * @see                org.apache.batik.svggen.SVGBufferedImageOp
    */
   public class SVGLookupOp extends AbstractSVGFilterConverter{
  @@ -104,7 +104,7 @@
        *         lookupOp. The definition of the feComponentTransfer
        *         filter in put in feComponentTransferDefSet
        */
  -    public SVGFilterDescriptor toSVG(LookupOp lookupOp){
  +    public SVGFilterDescriptor toSVG(LookupOp lookupOp) {
           // Reuse definition if lookupOp has already been converted
           SVGFilterDescriptor filterDesc = (SVGFilterDescriptor)descMap.get(lookupOp);
   
  @@ -279,79 +279,5 @@
               }*/
   
           return lookupTables;
  -    }
  -
  -    /**
  -     * Unit testing
  -     */
  -    public static void main(String args[]) throws Exception{
  -        Document domFactory = TestUtil.getDocumentPrototype();
  -
  -        byte bs[] = new byte[256];
  -        short s[] = new short[256];
  -        byte bi[] = new byte[256];
  -        short si[] = new short[256];
  -
  -        for(int i=0; i<=255; i++){
  -            bi[i] = (byte)(0xff & (255-i));
  -            bs[i] = (byte)(0xff & i);
  -            si[i] = (short)(0xffff & (255-i));
  -            s[i] = (short)(0xffff & i);
  -        }
  -
  -        byte incompleteByteArray[] = new byte[128];
  -        short incompleteShortArray[] = new short[128];
  -
  -        for(int i=0; i<128; i++){
  -            incompleteByteArray[i] = (byte)(255-i);
  -            incompleteShortArray[i] = (short)(255-i);
  -        }
  -
  -        LookupTable tables[] = { new ByteLookupTable(0, bs),
  -                                 new ByteLookupTable(0, new byte[][]{bi, bs, bi}),
  -                                 new ByteLookupTable(0, new byte[][]{bs, bi, bs, bi}),
  -                                 new ByteLookupTable(128, incompleteByteArray),
  -                                 new ShortLookupTable(0, s),
  -                                 new ShortLookupTable(0, new short[][]{si, s, si}),
  -                                 new ShortLookupTable(0, new short[][]{s, si, s, si}),
  -                                 new ShortLookupTable(128, incompleteShortArray),
  -        };
  -
  -        LookupOp lookupOps[] = new LookupOp[tables.length];
  -        for(int i=0; i<tables.length; i++)
  -            lookupOps[i] = new LookupOp(tables[i], null);
  -
  -        SVGLookupOp converter = new SVGLookupOp(domFactory);
  -
  -        Element group = domFactory.createElementNS(SVG_NAMESPACE_URI, SVG_G_TAG);
  -        Element defs = domFactory.createElementNS(SVG_NAMESPACE_URI, SVG_DEFS_TAG);
  -        Element rectGroupOne = domFactory.createElementNS(SVG_NAMESPACE_URI, SVG_G_TAG);
  -        Element rectGroupTwo = domFactory.createElementNS(SVG_NAMESPACE_URI, SVG_G_TAG);
  -
  -        for(int i=0; i<lookupOps.length; i++){
  -            SVGFilterDescriptor filterDesc = converter.toSVG(lookupOps[i]);
  -            Element rect = domFactory.createElementNS(SVG_NAMESPACE_URI, SVG_RECT_TAG);
  -            rect.setAttributeNS(null, SVG_FILTER_ATTRIBUTE, filterDesc.getFilterValue());
  -            rectGroupOne.appendChild(rect);
  -        }
  -
  -        for(int i=0; i<lookupOps.length; i++){
  -            SVGFilterDescriptor filterDesc = converter.toSVG(lookupOps[i]);
  -            Element rect = domFactory.createElementNS(SVG_NAMESPACE_URI, SVG_RECT_TAG);
  -            rect.setAttributeNS(null, SVG_FILTER_ATTRIBUTE, filterDesc.getFilterValue());
  -            rectGroupTwo.appendChild(rect);
  -        }
  -
  -        Iterator iter = converter.getDefinitionSet().iterator();
  -        while(iter.hasNext()){
  -            Element feComponentTransferDef = (Element)iter.next();
  -            defs.appendChild(feComponentTransferDef);
  -        }
  -
  -        group.appendChild(defs);
  -        group.appendChild(rectGroupOne);
  -        group.appendChild(rectGroupTwo);
  -
  -        TestUtil.trace(group, System.out);
       }
   }
  
  
  
  1.5       +10 -41    xml-batik/sources/org/apache/batik/svggen/SVGPath.java
  
  Index: SVGPath.java
  ===================================================================
  RCS file: /home/cvs/xml-batik/sources/org/apache/batik/svggen/SVGPath.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- SVGPath.java	2001/02/05 10:56:16	1.4
  +++ SVGPath.java	2001/03/19 09:26:19	1.5
  @@ -31,13 +31,13 @@
    * to be specified in the majority of path elements.
    *
    * @author <a href="mailto:vincent.hardy@eng.sun.com">Vincent Hardy</a>
  - * @version $Id: SVGPath.java,v 1.4 2001/02/05 10:56:16 tkormann Exp $
  + * @version $Id: SVGPath.java,v 1.5 2001/03/19 09:26:19 cjolif Exp $
    */
   public class SVGPath extends SVGGraphicObjectConverter{
       /**
        * @param domFactory used to build Elements
        */
  -    public SVGPath(Document domFactory){
  +    public SVGPath(Document domFactory) {
           super(domFactory);
       }
   
  @@ -49,7 +49,7 @@
       public Element toSVG(Shape path){
           // Convert input path to GeneralPath if necessary
           GeneralPath shape = null;
  -        if(path instanceof GeneralPath)
  +        if (path instanceof GeneralPath)
               shape = (GeneralPath)path;
           else
               shape = new GeneralPath(path);
  @@ -57,7 +57,9 @@
           // Create the path element and process its
           // d attribute.
           String dAttr = toSVGPathData(shape);
  -        if(dAttr==null || dAttr.trim().length() == 0){
  +        if (dAttr==null || dAttr.trim().length() == 0){
  +            // be careful not to append null to the DOM tree
  +            // because it will crash
               return null;
           }
   
  @@ -76,14 +78,14 @@
        * @param path the GeneralPath to convert
        * @return the value of the corresponding d attribute
        */
  -    static String toSVGPathData(GeneralPath path){
  +    static String toSVGPathData(GeneralPath path) {
           StringBuffer d = new StringBuffer("");
           PathIterator pi = path.getPathIterator(null);
           float seg[] = new float[6];
           int segType = 0;
  -        while(!pi.isDone()){
  +        while (!pi.isDone()) {
               segType = pi.currentSegment(seg);
  -            switch(segType){
  +            switch(segType) {
               case PathIterator.SEG_MOVETO:
                   d.append(PATH_MOVE);
                   appendPoint(d, seg[0], seg[1]);
  @@ -92,39 +94,32 @@
                   d.append(PATH_LINE_TO);
                   appendPoint(d, seg[0], seg[1]);
                   break;
  -
               case PathIterator.SEG_CLOSE:
                   d.append(PATH_CLOSE);
                   break;
  -
               case PathIterator.SEG_QUADTO:
                   d.append(PATH_QUAD_TO);
                   appendPoint(d, seg[0], seg[1]);
                   appendPoint(d, seg[2], seg[3]);
                   break;
  -
               case PathIterator.SEG_CUBICTO:
                   d.append(PATH_CUBIC_TO);
                   appendPoint(d, seg[0], seg[1]);
                   appendPoint(d, seg[2], seg[3]);
                   appendPoint(d, seg[4], seg[5]);
                   break;
  -
               default:
                   throw new Error();
               }
               pi.next();
           } // while !isDone
   
  -        if(d.length()>0)
  +        if (d.length() > 0)
               return d.substring(0, d.length() - 1);
           else
               return "";
  -
       }
   
  -
  -
       /**
        * Appends a coordinate to the path data
        */
  @@ -133,31 +128,5 @@
           d.append(SPACE);
           d.append(doubleString(y));
           d.append(SPACE);
  -    }
  -
  -    /**
  -     * Unit testing
  -     */
  -    public static void main(String args[]) throws Exception{
  -        GeneralPath generalPath = new GeneralPath(GeneralPath.WIND_EVEN_ODD);
  -        Shape shapes[] = { generalPath,
  -                           new Rectangle2D.Float(20, 30, 40, 50),
  -                           new Ellipse2D.Float(25, 35, 80, 60),
  -                           new Line2D.Float(30, 40, 50, 60),
  -                           new QuadCurve2D.Float(20, 30, 40, 50, 60, 70),
  -                           new CubicCurve2D.Float(15, 25, 35, 45, 55, 65, 75, 85)
  -        };
  -
  -        Document domFactory = TestUtil.getDocumentPrototype();
  -        SVGPath converter = new SVGPath(domFactory);
  -
  -        Element group = domFactory.createElementNS(SVG_NAMESPACE_URI, SVG_G_TAG);
  -        for(int i=0; i<shapes.length; i++){
  -            Shape shape = shapes[i];
  -            Element path = converter.toSVG(shape);
  -            group.appendChild(path);
  -        }
  -
  -        TestUtil.trace(group, System.out);
       }
   }
  
  
  
  1.5       +1 -25     xml-batik/sources/org/apache/batik/svggen/SVGPolygon.java
  
  Index: SVGPolygon.java
  ===================================================================
  RCS file: /home/cvs/xml-batik/sources/org/apache/batik/svggen/SVGPolygon.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- SVGPolygon.java	2001/02/05 10:56:16	1.4
  +++ SVGPolygon.java	2001/03/19 09:26:20	1.5
  @@ -19,7 +19,7 @@
    * an SVG element.
    *
    * @author <a href="mailto:vincent.hardy@eng.sun.com">Vincent Hardy</a>
  - * @version $Id: SVGPolygon.java,v 1.4 2001/02/05 10:56:16 tkormann Exp $
  + * @version $Id: SVGPolygon.java,v 1.5 2001/03/19 09:26:20 cjolif Exp $
    */
   public class SVGPolygon extends SVGGraphicObjectConverter{
       /**
  @@ -74,29 +74,5 @@
           points.append(SPACE);
           points.append(doubleString(y));
           points.append(SPACE);
  -    }
  -
  -    /**
  -     * Unit testing
  -     */
  -    public static void main(String args[]) throws Exception {
  -        Document domFactory = TestUtil.getDocumentPrototype();
  -
  -        Polygon polygon = new Polygon();
  -        polygon.addPoint(350, 75);
  -        polygon.addPoint(379, 161);
  -        polygon.addPoint(469, 161);
  -        polygon.addPoint(397, 215);
  -        polygon.addPoint(423, 301);
  -        polygon.addPoint(350, 250);
  -        polygon.addPoint(277, 301);
  -        polygon.addPoint(303, 215);
  -        polygon.addPoint(231, 161);
  -        polygon.addPoint(321, 161);
  -
  -        SVGPolygon converter = new SVGPolygon(domFactory);
  -        Element svgPolygon = converter.toSVG(polygon);
  -        TestUtil.trace(svgPolygon, System.out);
  -        System.out.println();
       }
   }
  
  
  
  1.5       +1 -23     xml-batik/sources/org/apache/batik/svggen/SVGRectangle.java
  
  Index: SVGRectangle.java
  ===================================================================
  RCS file: /home/cvs/xml-batik/sources/org/apache/batik/svggen/SVGRectangle.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- SVGRectangle.java	2001/02/05 10:56:17	1.4
  +++ SVGRectangle.java	2001/03/19 09:26:21	1.5
  @@ -19,7 +19,7 @@
    * object into an SVG element.
    *
    * @author <a href="mailto:vincent.hardy@eng.sun.com">Vincent Hardy</a>
  - * @version $Id: SVGRectangle.java,v 1.4 2001/02/05 10:56:17 tkormann Exp $
  + * @version $Id: SVGRectangle.java,v 1.5 2001/03/19 09:26:21 cjolif Exp $
    */
   public class SVGRectangle extends SVGGraphicObjectConverter{
       /**
  @@ -60,27 +60,5 @@
           svgRect.setAttributeNS(null, SVG_HEIGHT_ATTRIBUTE, doubleString(rect.getHeight()));
   
           return svgRect;
  -    }
  -
  -    /**
  -     * Unit testing
  -     */
  -    public static void main(String args[]) throws Exception{
  -        Document domFactory = TestUtil.getDocumentPrototype();
  -        SVGRectangle converter = new SVGRectangle(domFactory);
  -
  -        Element rects[] = {
  -            converter.toSVG(new Rectangle(10, 20, 30, 40)),
  -            converter.toSVG(new Rectangle2D.Double(100., 200., 300., 400.)),
  -            converter.toSVG(new Rectangle2D.Float(1000f, 2000f, 3000f, 4000f)),
  -            converter.toSVG(new RoundRectangle2D.Double(15., 16., 17., 18., 30., 20.)),
  -            converter.toSVG(new RoundRectangle2D.Float(35f, 45f, 55f, 65f, 25f, 45f))
  -        };
  -
  -        Element group = domFactory.createElementNS(SVG_NAMESPACE_URI, SVG_G_TAG);
  -        for(int i=0; i<rects.length; i++)
  -            group.appendChild(rects[i]);
  -
  -        TestUtil.trace(group, System.out);
       }
   }
  
  
  
  1.6       +1 -90     xml-batik/sources/org/apache/batik/svggen/SVGRenderingHints.java
  
  Index: SVGRenderingHints.java
  ===================================================================
  RCS file: /home/cvs/xml-batik/sources/org/apache/batik/svggen/SVGRenderingHints.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- SVGRenderingHints.java	2001/03/14 01:36:47	1.5
  +++ SVGRenderingHints.java	2001/03/19 09:26:21	1.6
  @@ -35,7 +35,7 @@
    * + TEXT_ANTIALIASING -> text-rendering
    *
    * @author <a href="mailto:vincent.hardy@eng.sun.com">Vincent Hardy</a>
  - * @version $Id: SVGRenderingHints.java,v 1.5 2001/03/14 01:36:47 vhardy Exp $
  + * @version $Id: SVGRenderingHints.java,v 1.6 2001/03/19 09:26:21 cjolif Exp $
    */
   public class SVGRenderingHints extends AbstractSVGConverter{
       /**
  @@ -164,94 +164,5 @@
                                         textRendering,
                                         shapeRendering,
                                         imageRendering);
  -    }
  -
  -    /**
  -     * Unit testing
  -     */
  -    public static void main(String args[]) throws Exception {
  -        Document domFactory = TestUtil.getDocumentPrototype();
  -        Element group = domFactory.createElementNS(SVG_NAMESPACE_URI, SVG_G_TAG);
  -        Map testMap = new Hashtable();
  -
  -        // Various RENDERING values
  -        RenderingHints rh = new RenderingHints(null);
  -        RenderingHints renderingValues[] = {
  -            new RenderingHints(rh.KEY_RENDERING, rh.VALUE_RENDER_DEFAULT),
  -            new RenderingHints(rh.KEY_RENDERING, rh.VALUE_RENDER_QUALITY),
  -            new RenderingHints(rh.KEY_RENDERING, rh.VALUE_RENDER_SPEED),
  -        };
  -        testMap.put("rendering", renderingValues);
  -
  -        // Various FRACTIONAL_METRICS
  -        RenderingHints fractionalMetricsValues[] = {
  -            new RenderingHints(rh.KEY_FRACTIONALMETRICS, rh.VALUE_FRACTIONALMETRICS_DEFAULT),
  -            new RenderingHints(rh.KEY_FRACTIONALMETRICS, rh.VALUE_FRACTIONALMETRICS_ON),
  -            new RenderingHints(rh.KEY_FRACTIONALMETRICS, rh.VALUE_FRACTIONALMETRICS_OFF),
  -        };
  -        testMap.put("fractionalMetrics", fractionalMetricsValues);
  -
  -        // Various ANTIALIASING
  -        RenderingHints antialiasingValues[] = {
  -            new RenderingHints(rh.KEY_ANTIALIASING, rh.VALUE_ANTIALIAS_DEFAULT),
  -            new RenderingHints(rh.KEY_ANTIALIASING, rh.VALUE_ANTIALIAS_ON),
  -            new RenderingHints(rh.KEY_ANTIALIASING, rh.VALUE_ANTIALIAS_OFF),
  -        };
  -        testMap.put("antialiasing", antialiasingValues);
  -
  -        // Various COLOR_RENDERING
  -        RenderingHints colorRenderingValues[] = {
  -            new RenderingHints(rh.KEY_COLOR_RENDERING, rh.VALUE_COLOR_RENDER_DEFAULT),
  -            new RenderingHints(rh.KEY_COLOR_RENDERING, rh.VALUE_COLOR_RENDER_SPEED),
  -            new RenderingHints(rh.KEY_COLOR_RENDERING, rh.VALUE_COLOR_RENDER_QUALITY),
  -        };
  -        testMap.put("colorRendering", colorRenderingValues);
  -
  -        // Various INTERPOLATION
  -        RenderingHints interpolationValues[] = {
  -            new RenderingHints(rh.KEY_INTERPOLATION, rh.VALUE_INTERPOLATION_NEAREST_NEIGHBOR),
  -            new RenderingHints(rh.KEY_INTERPOLATION, rh.VALUE_INTERPOLATION_BILINEAR),
  -            new RenderingHints(rh.KEY_INTERPOLATION, rh.VALUE_INTERPOLATION_BICUBIC),
  -        };
  -        testMap.put("interpolation", interpolationValues);
  -
  -        // Various TEST_ANTIALIASING
  -        RenderingHints textAntialiasingValues[] = {
  -            new RenderingHints(rh.KEY_TEXT_ANTIALIASING, rh.VALUE_TEXT_ANTIALIAS_DEFAULT),
  -            new RenderingHints(rh.KEY_TEXT_ANTIALIASING, rh.VALUE_TEXT_ANTIALIAS_OFF),
  -            new RenderingHints(rh.KEY_TEXT_ANTIALIASING, rh.VALUE_TEXT_ANTIALIAS_ON),
  -        };
  -        testMap.put("textAntialiasing", textAntialiasingValues);
  -
  -        // Mixed settings. The second hint to take precedence over the first one.
  -        RenderingHints mixedA = new RenderingHints(rh.KEY_RENDERING, rh.VALUE_RENDER_DEFAULT);
  -        mixedA.put(rh.KEY_ANTIALIASING, rh.VALUE_ANTIALIAS_ON);
  -        RenderingHints mixedB = new RenderingHints(rh.KEY_ANTIALIASING, rh.VALUE_ANTIALIAS_ON);
  -        mixedB.put(rh.KEY_TEXT_ANTIALIASING, rh.VALUE_TEXT_ANTIALIAS_OFF);
  -        RenderingHints mixedValues[] = { mixedA, mixedB };
  -        testMap.put("mixed", mixedValues);
  -
  -        Iterator iter = testMap.keySet().iterator();
  -        SVGRenderingHints converter = new SVGRenderingHints();
  -
  -        while(iter.hasNext()){
  -            String testName = (String)iter.next();
  -            RenderingHints hints[] = (RenderingHints[])testMap.get(testName);
  -            Element testGroup = domFactory.createElementNS(SVG_NAMESPACE_URI, SVG_G_TAG);
  -            testGroup.setAttributeNS(null, ATTR_ID, testName);
  -            for(int i=0; i<hints.length; i++){
  -                Element testRect = domFactory.createElementNS(SVG_NAMESPACE_URI, SVG_RECT_TAG);
  -                Map attrMap = converter.toSVG(hints[i]).getAttributeMap(null);
  -                Iterator attrIter = attrMap.keySet().iterator();
  -                while(attrIter.hasNext()){
  -                    String attrName = (String)attrIter.next();
  -                    testRect.setAttributeNS(null, attrName, (String)attrMap.get(attrName));
  -                }
  -                testGroup.appendChild(testRect);
  -            }
  -            group.appendChild(testGroup);
  -        }
  -
  -        TestUtil.trace(group, System.out);
       }
   }
  
  
  
  1.5       +1 -46     xml-batik/sources/org/apache/batik/svggen/SVGRescaleOp.java
  
  Index: SVGRescaleOp.java
  ===================================================================
  RCS file: /home/cvs/xml-batik/sources/org/apache/batik/svggen/SVGRescaleOp.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- SVGRescaleOp.java	2001/02/05 10:56:17	1.4
  +++ SVGRescaleOp.java	2001/03/19 09:26:22	1.5
  @@ -28,7 +28,7 @@
    * offsets.
    *
    * @author <a href="mailto:vincent.hardy@eng.sun.com">Vincent Hardy</a>
  - * @version $Id: SVGRescaleOp.java,v 1.4 2001/02/05 10:56:17 tkormann Exp $
  + * @version $Id: SVGRescaleOp.java,v 1.5 2001/03/19 09:26:22 cjolif Exp $
    * @see                org.apache.batik.svggen.SVGBufferedImageOp
    */
   public class SVGRescaleOp extends AbstractSVGFilterConverter{
  @@ -169,50 +169,5 @@
           }
   
           return filterDesc;
  -    }
  -
  -    /**
  -     * Unit testing
  -     */
  -    public static void main(String args[]) throws Exception{
  -        Document domFactory = TestUtil.getDocumentPrototype();
  -
  -        RescaleOp rescaleOps[] = { new RescaleOp(3, 25, null),
  -                                   new RescaleOp(new float[]{ 1, 2, 3 }, new float[]{10, 20, 30}, null),
  -                                   new RescaleOp(new float[]{ 1, 2, 3, 4 }, new float[]{10, 20, 30, 40}, null),
  -        };
  -
  -        SVGRescaleOp converter = new SVGRescaleOp(domFactory);
  -
  -        Element group = domFactory.createElementNS(SVG_NAMESPACE_URI, SVG_G_TAG);
  -        Element defs = domFactory.createElementNS(SVG_NAMESPACE_URI, SVG_DEFS_TAG);
  -        Element rectGroupOne = domFactory.createElementNS(SVG_NAMESPACE_URI, SVG_G_TAG);
  -        Element rectGroupTwo = domFactory.createElementNS(SVG_NAMESPACE_URI, SVG_G_TAG);
  -
  -        for(int i=0; i<rescaleOps.length; i++){
  -            SVGFilterDescriptor filterDesc = converter.toSVG(rescaleOps[i]);
  -            Element rect = domFactory.createElementNS(SVG_NAMESPACE_URI, SVG_RECT_TAG);
  -            rect.setAttributeNS(null, SVG_FILTER_ATTRIBUTE, filterDesc.getFilterValue());
  -            rectGroupOne.appendChild(rect);
  -        }
  -
  -        for(int i=0; i<rescaleOps.length; i++){
  -            SVGFilterDescriptor filterDesc = converter.toSVG(rescaleOps[i]);
  -            Element rect = domFactory.createElementNS(SVG_NAMESPACE_URI, SVG_RECT_TAG);
  -            rect.setAttributeNS(null, SVG_FILTER_ATTRIBUTE, filterDesc.getFilterValue());
  -            rectGroupTwo.appendChild(rect);
  -        }
  -
  -        Iterator iter = converter.getDefinitionSet().iterator();
  -        while(iter.hasNext()){
  -            Element feComponentTransferDef = (Element)iter.next();
  -            defs.appendChild(feComponentTransferDef);
  -        }
  -
  -        group.appendChild(defs);
  -        group.appendChild(rectGroupOne);
  -        group.appendChild(rectGroupTwo);
  -
  -        TestUtil.trace(group, System.out);
       }
   }
  
  
  
  1.3       +1 -66     xml-batik/sources/org/apache/batik/svggen/SVGShape.java
  
  Index: SVGShape.java
  ===================================================================
  RCS file: /home/cvs/xml-batik/sources/org/apache/batik/svggen/SVGShape.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- SVGShape.java	2001/01/30 17:35:28	1.2
  +++ SVGShape.java	2001/03/19 09:26:23	1.3
  @@ -30,7 +30,7 @@
    * + Any custom Shape implementation is mapped to path as well.
    *
    * @author <a href="mailto:vincent.hardy@eng.sun.com">Vincent Hardy</a>
  - * @version $Id: SVGShape.java,v 1.2 2001/01/30 17:35:28 vhardy Exp $
  + * @version $Id: SVGShape.java,v 1.3 2001/03/19 09:26:23 cjolif Exp $
    */
   public class SVGShape extends SVGGraphicObjectConverter{
       /*
  @@ -70,70 +70,5 @@
               return svgLine.toSVG((Line2D)shape);
           else
               return svgPath.toSVG(shape);
  -    }
  -
  -    /**
  -     * Unit testing
  -     */
  -    public static void main(String args[]) throws Exception {
  -        Polygon polygon = new Polygon();
  -        polygon.addPoint(1, 1);
  -        polygon.addPoint(2, 1);
  -        polygon.addPoint(3, 2);
  -        polygon.addPoint(3, 3);
  -        polygon.addPoint(2, 4);
  -        polygon.addPoint(1, 3);
  -        polygon.addPoint(1, 2);
  -
  -        GeneralPath square = new GeneralPath();
  -        square.moveTo(0, 0);
  -        square.lineTo(1, 0);
  -        square.lineTo(1, 1);
  -        square.lineTo(0, 1);
  -        square.closePath();
  -
  -        Ellipse2D hole = new Ellipse2D.Double(0, 0, 1, 1);
  -        Area area = new Area(square);
  -        area.subtract(new Area(hole));
  -
  -        Shape shapes[] = {
  -            // polygon
  -            polygon,
  -
  -            // rect
  -            new Rectangle(10, 20, 30, 40),
  -            new Rectangle2D.Double(100., 200., 300., 400.),
  -            new Rectangle2D.Float(1000f, 2000f, 3000f, 4000f),
  -            new RoundRectangle2D.Double(15., 16., 17., 18., 30., 20.),
  -            new RoundRectangle2D.Float(35f, 45f, 55f, 65f, 25f, 45f),
  -
  -            // Circle
  -            new Ellipse2D.Float(0, 0, 100, 100),
  -            new Ellipse2D.Double(40, 40, 240, 240),
  -
  -            // Ellipse
  -            new Ellipse2D.Float(0, 0, 100, 200),
  -            new Ellipse2D.Float(40, 100, 240, 200),
  -
  -            // line
  -            new Line2D.Double(1, 2, 3, 4),
  -            new Line2D.Double(10, 20, 30, 40),
  -
  -            // path
  -            new QuadCurve2D.Float(20, 30, 40, 50, 60, 70),
  -            new CubicCurve2D.Float(15, 25, 35, 45, 55, 65, 75, 85),
  -            new Arc2D.Double(0, 0, 100, 100, 0, 90, Arc2D.OPEN),
  -            square,
  -            area
  -        };
  -
  -        Document domFactory = TestUtil.getDocumentPrototype();
  -        Element group = domFactory.createElementNS(SVG_NAMESPACE_URI, SVG_G_TAG);
  -        SVGShape converter = new SVGShape(domFactory);
  -
  -        for(int i=0; i<shapes.length; i++)
  -            group.appendChild(converter.toSVG(shapes[i]));
  -
  -        TestUtil.trace(group, System.out);
       }
   }
  
  
  
  1.7       +1 -31     xml-batik/sources/org/apache/batik/svggen/SVGTexturePaint.java
  
  Index: SVGTexturePaint.java
  ===================================================================
  RCS file: /home/cvs/xml-batik/sources/org/apache/batik/svggen/SVGTexturePaint.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- SVGTexturePaint.java	2001/03/14 01:36:47	1.6
  +++ SVGTexturePaint.java	2001/03/19 09:26:24	1.7
  @@ -31,7 +31,7 @@
    * SVG pattern element
    *
    * @author <a href="mailto:vincent.hardy@eng.sun.com">Vincent Hardy</a>
  - * @version $Id: SVGTexturePaint.java,v 1.6 2001/03/14 01:36:47 vhardy Exp $
  + * @version $Id: SVGTexturePaint.java,v 1.7 2001/03/19 09:26:24 cjolif Exp $
    */
   public class SVGTexturePaint extends AbstractSVGConverter{
       public static final String ERROR_IMAGE_HANDLER_NULL =
  @@ -155,35 +155,5 @@
           }
   
           return patternDesc;
  -    }
  -
  -    /**
  -     * Unit testing
  -     */
  -    public static void main(String args[]) throws Exception{
  -        Document domFactory = TestUtil.getDocumentPrototype();
  -
  -        BufferedImage buf = new BufferedImage(200, 200, BufferedImage.TYPE_INT_RGB);
  -        TexturePaint paint = new TexturePaint(buf, new Rectangle(0, 0, 200, 200));
  -
  -        SVGTexturePaint converter = new SVGTexturePaint(domFactory, new DefaultImageHandler());
  -        Element group = domFactory.createElementNS(SVG_NAMESPACE_URI, SVG_G_TAG);
  -        Element defs = domFactory.createElementNS(SVG_NAMESPACE_URI, SVG_DEFS_TAG);
  -
  -        SVGPaintDescriptor patternDesc = converter.toSVG(paint);
  -        Iterator iter = converter.getDefinitionSet().iterator();
  -        while(iter.hasNext()){
  -            Element patternDef = (Element)iter.next();
  -            defs.appendChild(patternDef);
  -        }
  -
  -        Element rect = domFactory.createElementNS(SVG_NAMESPACE_URI, SVG_RECT_TAG);
  -        rect.setAttributeNS(null, SVG_FILL_ATTRIBUTE, patternDesc.getPaintValue());
  -        rect.setAttributeNS(null, SVG_FILL_OPACITY_ATTRIBUTE, patternDesc.getOpacityValue());
  -
  -        group.appendChild(defs);
  -        group.appendChild(rect);
  -
  -        TestUtil.trace(group, System.out);
       }
   }
  
  
  
  1.3       +1 -42     xml-batik/sources/org/apache/batik/svggen/SVGTransform.java
  
  Index: SVGTransform.java
  ===================================================================
  RCS file: /home/cvs/xml-batik/sources/org/apache/batik/svggen/SVGTransform.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- SVGTransform.java	2001/03/14 01:36:47	1.2
  +++ SVGTransform.java	2001/03/19 09:26:25	1.3
  @@ -22,7 +22,7 @@
    * into an SVG transform attribute.
    *
    * @author <a href="mailto:vincent.hardy@eng.sun.com">Vincent Hardy</a>
  - * @version $Id: SVGTransform.java,v 1.2 2001/03/14 01:36:47 vhardy Exp $
  + * @version $Id: SVGTransform.java,v 1.3 2001/03/19 09:26:25 cjolif Exp $
    */
   public class SVGTransform extends AbstractSVGConverter{
       /**
  @@ -178,46 +178,5 @@
   
           return (matrix[0] == 1 && matrix[2] == 0 && matrix[4] == 0 &&
                   matrix[1] == 0 && matrix[3] == 1 && matrix[5] == 0);
  -    }
  -
  -    /**
  -     * Unit testing
  -     */
  -    public static void main(String args[]){
  -        GraphicContext gc = new GraphicContext();
  -        gc.translate(20, 20);
  -        gc.rotate(Math.PI/4);
  -        gc.shear(.5, .5);
  -        gc.scale(20, 20);
  -
  -        AffineTransform txf = new AffineTransform();
  -        txf.translate(60, 60);
  -        gc.transform(txf);
  -
  -        String svgTransform = SVGTransform.toSVGTransform(gc);
  -        System.out.println("SVG Transform: " + svgTransform);
  -
  -        gc.setTransform(new AffineTransform());
  -        gc.translate(45, 45);
  -
  -        svgTransform = SVGTransform.toSVGTransform(gc);
  -        System.out.println("SVG Transform: " + svgTransform);
  -
  -        gc.setTransform(new AffineTransform());
  -        gc.translate(10, 10);
  -        gc.translate(30, 30);
  -        gc.scale(2, 3);
  -        gc.scale(3, 2);
  -        gc.rotate(Math.PI/2);
  -        gc.rotate(Math.PI/2);
  -        gc.translate(100, 100);
  -        gc.translate(-100, -100);
  -        gc.scale(2, 2);
  -        gc.scale(.5, .5);
  -        gc.rotate(Math.PI/2);
  -        gc.rotate(-Math.PI/2);
  -
  -        svgTransform = SVGTransform.toSVGTransform(gc);
  -        System.out.println("SVG Transform: " + svgTransform);
       }
   }
  
  
  
  1.4       +1 -40     xml-batik/sources/org/apache/batik/svggen/XmlWriter.java
  
  Index: XmlWriter.java
  ===================================================================
  RCS file: /home/cvs/xml-batik/sources/org/apache/batik/svggen/XmlWriter.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- XmlWriter.java	2001/02/05 10:56:18	1.3
  +++ XmlWriter.java	2001/03/19 09:26:28	1.4
  @@ -21,7 +21,7 @@
    * for Sun's Project X by David Brownell.
    *
    * @author <a href="mailto:vincent.hardy@eng.sun.com">Vincent Hardy</a>
  - * @version $Id: XmlWriter.java,v 1.3 2001/02/05 10:56:18 tkormann Exp $
  + * @version $Id: XmlWriter.java,v 1.4 2001/03/19 09:26:28 cjolif Exp $
    */
   class XmlWriter implements SVGConstants {
       static private String       EOL;
  @@ -391,45 +391,6 @@
               writeXml((Element)node, out);
           else {
               System.err.println("Unable to write node of type: " + node.getClass().getName());
  -        }
  -    }
  -
  -    /**
  -     * Unit testing
  -     */
  -    public static void main(String args[]) throws Exception {
  -        Document domFactory = TestUtil.getDocumentPrototype();
  -
  -        Element root = domFactory.createElementNS(SVG_NAMESPACE_URI, SVG_SVG_TAG);
  -        Element genericDefs = domFactory.createElementNS(SVG_NAMESPACE_URI, SVG_DEFS_TAG);
  -        Element topLevelGroup = domFactory.createElementNS(SVG_NAMESPACE_URI, SVG_G_TAG);
  -        Element topLevelDefs = domFactory.createElementNS(SVG_NAMESPACE_URI, SVG_DEFS_TAG);
  -        Element groupA = domFactory.createElementNS(SVG_NAMESPACE_URI, SVG_G_TAG);
  -        Element groupB = domFactory.createElementNS(SVG_NAMESPACE_URI, SVG_G_TAG);
  -        Comment comment = domFactory.createComment("This is the topLevelGroup comment");
  -
  -        topLevelGroup.appendChild(comment);
  -        topLevelGroup.appendChild(topLevelDefs);
  -        topLevelGroup.appendChild(groupA);
  -        topLevelGroup.appendChild(groupB);
  -
  -        root.appendChild(genericDefs);
  -        root.appendChild(topLevelGroup);
  -
  -        domFactory.appendChild(root);
  -
  -        TestUtil.trace(root, System.out);
  -
  -        System.out.println("\n=======================================");
  -
  -        try{
  -            Writer out =  new OutputStreamWriter(System.out);
  -            XmlWriter.writeXml(domFactory, out);
  -            out.flush();
  -            out.close();
  -        }catch(Exception e){
  -            e.printStackTrace();
  -            throw new Exception(e.getMessage());
           }
       }
   }
  
  
  

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