xmlgraphics-batik-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tkorm...@apache.org
Subject cvs commit: xml-batik/test-sources/org/apache/batik/test/svg SVGRenderingAccuracyTest.java
Date Thu, 07 Mar 2002 09:02:57 GMT
tkormann    02/03/07 01:02:57

  Modified:    resources/org/apache/batik/apps/rasterizer/resources
                        Messages.properties
               samples  3D.svg
               samples/tests/spec/scripting remove.svg
               sources/org/apache/batik/apps/rasterizer Main.java
                        SVGConverter.java
               test-resources/org/apache/batik/test regard.xml
                        samplesRendering.xml
               test-sources/org/apache/batik/test/svg
                        SVGRenderingAccuracyTest.java
  Added:       test-references/samples/tests/spec/scripting add.png
                        circle.png ellipse.png line.png path.png
                        polygon.png polyline.png rect.png remove.png
                        transform.png transform2.png xyModifOnLoad.png
  Log:
  - add the '-onload' command line option for the rasterizer
  - set KEY_EXECUTE_ONLOAD=true by default in regard
  - add scripting 'onload' tests to regard
  - add the reference images
  
  Revision  Changes    Path
  1.6       +8 -1      xml-batik/resources/org/apache/batik/apps/rasterizer/resources/Messages.properties
  
  Index: Messages.properties
  ===================================================================
  RCS file: /home/cvs/xml-batik/resources/org/apache/batik/apps/rasterizer/resources/Messages.properties,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- Messages.properties	20 Nov 2001 15:08:21 -0000	1.5
  +++ Messages.properties	7 Mar 2002 09:02:55 -0000	1.6
  @@ -94,7 +94,10 @@
    -dpi <resolution> \n \
   \tResolution for the ouptut image. \n \
    -validate  \n \
  -\tControls whether the source SVG files should be validated. \n
  +\tControls whether the source SVG files should be validated. \n \
  + -onload  \n \
  +\tControls if the source SVG files must be rasterize after \n \
  +\tdispatching the ''onload'' event. \n
   
   
   Main.cl.option.output.description = \
  @@ -176,6 +179,10 @@
   
   Main.cl.option.validate.description = \
   -validate  controls whether the source SVG files should be validated. 
  +
  +Main.cl.option.onload.description = \
  +-onload  controls whether the source SVG files must be rasterize after \n \
  +dispatching the 'onload' event. 
   
   #
   # Main error codes
  
  
  
  1.3       +5 -5      xml-batik/samples/3D.svg
  
  Index: 3D.svg
  ===================================================================
  RCS file: /home/cvs/xml-batik/samples/3D.svg,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- 3D.svg	5 Mar 2002 19:43:38 -0000	1.2
  +++ 3D.svg	7 Mar 2002 09:02:56 -0000	1.3
  @@ -14,12 +14,12 @@
   <!-- 3D demo                                                                -->
   <!--                                                                        -->
   <!-- @author tkormann@ilog.fr                                               -->
  -<!-- @version $Id: 3D.svg,v 1.2 2002/03/05 19:43:38 tkormann Exp $ -->
  +<!-- @version $Id: 3D.svg,v 1.3 2002/03/07 09:02:56 tkormann Exp $ -->
   <!-- ====================================================================== -->
   
   <svg xmlns="http://www.w3.org/2000/svg" 
        xmlns:xlink="http://www.w3.org/1999/xlink"
  -     id="body" width="450" height="500" viewBox="0 0 450 500">
  +     id="body" width="640" height="480" viewBox="0 0 640 480">
   
       <script type="text/ecmascript"><![CDATA[
   
  @@ -32,8 +32,8 @@
           var OBJECT_GO = 2;
           var OBJECT_PLAY = 3;
   
  -        var _xOrigin = 225;
  -        var _yOrigin = 250;
  +        var _xOrigin = 320;
  +        var _yOrigin = 240;
           var svgNS = "http://www.w3.org/2000/svg";
   
           // 3D object collection
  @@ -488,6 +488,6 @@
       <!-- ============================================================= -->
       <!-- Batik sample mark                                             -->
       <!-- ============================================================= -->
  -    <use xlink:href="batikLogo.svg#Batik_Tag_Box" />
  +    <use transform="translate(598,447) scale(0.5, 0.5)" xlink:href="batikLogo.svg#Batik_Squiggle"
/>
   
   </svg>
  
  
  
  1.2       +3 -3      xml-batik/samples/tests/spec/scripting/remove.svg
  
  Index: remove.svg
  ===================================================================
  RCS file: /home/cvs/xml-batik/samples/tests/spec/scripting/remove.svg,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- remove.svg	14 Feb 2002 12:37:54 -0000	1.1
  +++ remove.svg	7 Mar 2002 09:02:56 -0000	1.2
  @@ -14,7 +14,7 @@
   <!-- append child test                                                      -->
   <!--                                                                        -->
   <!-- @author tkormann@ilog.fr                                               -->
  -<!-- @version $Id: remove.svg,v 1.1 2002/02/14 12:37:54 tkormann Exp $ -->
  +<!-- @version $Id: remove.svg,v 1.2 2002/03/07 09:02:56 tkormann Exp $ -->
   <!-- ====================================================================== -->
   
   <?xml-stylesheet type="text/css" href="../../resources/style/test.css" ?>  
  @@ -49,14 +49,14 @@
   
       </script>
   
  -    <g onload="remove(evt)" id="test-content">
  +    <g onload="remove(evt)">
          <rect x="100" y="100" width="100" height="100" style="fill:#eee"/>
          <rect x="150" y="100" width="100" height="100" style="fill:gold"/>
          <rect x="200" y="100" width="100" height="100" style="fill:crimson"/>
          <rect x="250" y="100" width="100" height="100" style="fill:orange"/>
       </g>
   
  -    <g onload="removeAll(evt)" id="test-content">
  +    <g onload="removeAll(evt)">
          <rect x="100" y="300" width="100" height="100" style="fill:#eee"/>
          <rect x="150" y="300" width="100" height="100" style="fill:gold"/>
          <rect x="200" y="300" width="100" height="100" style="fill:crimson"/>
  
  
  
  1.17      +21 -1     xml-batik/sources/org/apache/batik/apps/rasterizer/Main.java
  
  Index: Main.java
  ===================================================================
  RCS file: /home/cvs/xml-batik/sources/org/apache/batik/apps/rasterizer/Main.java,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- Main.java	12 Nov 2001 16:33:10 -0000	1.16
  +++ Main.java	7 Mar 2002 09:02:56 -0000	1.17
  @@ -46,7 +46,7 @@
    * <tt>SVGConverter</tt> which is used to perform the conversion.
    *
    * @author <a href="mailto:vhardy@apache.org">Vincent Hardy</a>
  - * @version $Id: Main.java,v 1.16 2001/11/12 16:33:10 vhardy Exp $
  + * @version $Id: Main.java,v 1.17 2002/03/07 09:02:56 tkormann Exp $
    */
   public class Main implements SVGConverterController {
       /**
  @@ -363,6 +363,16 @@
           = Messages.get("Main.cl.option.validate.description", "No description");
   
       /**
  +     * Option to specify that the converted SVG files should
  +     * be after the dispatch of the 'onload' event.
  +     */
  +    public static String CL_OPTION_ONLOAD
  +        = Messages.get("Main.cl.option.onload", "-onload");
  +      
  +    public static String CL_OPTION_ONLOAD_DESCRIPTION
  +        = Messages.get("Main.cl.option.onload.description", "No description");
  +
  +    /**
        * Option to specify the user language with which SVG
        * documents should be processed
        */
  @@ -598,6 +608,16 @@
   
                                 public String getOptionDescription(){
                                     return CL_OPTION_VALIDATE_DESCRIPTION;
  +                              }
  +                          });
  +        optionMap.put(CL_OPTION_ONLOAD,
  +                      new NoValueOptionHandler(){
  +                              public void handleOption(SVGConverter c){
  +                                  c.setExecuteOnload(true);
  +                             }
  +
  +                              public String getOptionDescription(){
  +                                  return CL_OPTION_ONLOAD_DESCRIPTION;
                                 }
                             });
           
  
  
  
  1.9       +25 -1     xml-batik/sources/org/apache/batik/apps/rasterizer/SVGConverter.java
  
  Index: SVGConverter.java
  ===================================================================
  RCS file: /home/cvs/xml-batik/sources/org/apache/batik/apps/rasterizer/SVGConverter.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- SVGConverter.java	19 Nov 2001 12:45:28 -0000	1.8
  +++ SVGConverter.java	7 Mar 2002 09:02:56 -0000	1.9
  @@ -80,7 +80,7 @@
    * <li>pixelToMillimeter: defines the size of a pixel when processing the SVG documents.</li>
    * </ul>
    *
  - * @version $Id: SVGConverter.java,v 1.8 2001/11/19 12:45:28 vhardy Exp $
  + * @version $Id: SVGConverter.java,v 1.9 2002/03/07 09:02:56 tkormann Exp $
    * @author Henri Ruini
    * @author <a href="mailto:vhardy@apache.org">Vincent Hardy</a>
    */
  @@ -219,6 +219,9 @@
       /** Validation flag */
       protected boolean validate = false;
   
  +    /** Execute the 'onload' scripts flag */
  +    protected boolean executeOnload = false;
  +
       /** Sources files or URLs */
       protected Vector sources = null;
   
  @@ -474,6 +477,25 @@
       public boolean getValidate(){
           return validate;
       }
  +
  +    /**
  +     * Sets whether or not scripts attached to the DOM using 'onload'
  +     * event attribute must be executed before rasterizing.
  +     *
  +     * @param b true means scripts will be executed
  +     */
  +    public void setExecuteOnload(boolean b){
  +        this.executeOnload = b;
  +    }
  +
  +    /**
  +     * Returns true if the scripts attached to the DOM using 'onload'
  +     * event attribute is going to be executed before rasterizing,
  +     * false otherwise.
  +     */
  +    public boolean getExecuteOnload(){
  +        return executeOnload;
  +    }
       
       /**
        * Returns true if f is a File. f is found to be a file if
  @@ -706,6 +728,8 @@
                       new Boolean(validate));
           }
   
  +        // Set onload
  +        map.put(ImageTranscoder.KEY_EXECUTE_ONLOAD, new Boolean(executeOnload));
           
           return map;
       }
  
  
  
  1.1                  xml-batik/test-references/samples/tests/spec/scripting/add.png
  
  	<<Binary file>>
  
  
  1.1                  xml-batik/test-references/samples/tests/spec/scripting/circle.png
  
  	<<Binary file>>
  
  
  1.1                  xml-batik/test-references/samples/tests/spec/scripting/ellipse.png
  
  	<<Binary file>>
  
  
  1.1                  xml-batik/test-references/samples/tests/spec/scripting/line.png
  
  	<<Binary file>>
  
  
  1.1                  xml-batik/test-references/samples/tests/spec/scripting/path.png
  
  	<<Binary file>>
  
  
  1.1                  xml-batik/test-references/samples/tests/spec/scripting/polygon.png
  
  	<<Binary file>>
  
  
  1.1                  xml-batik/test-references/samples/tests/spec/scripting/polyline.png
  
  	<<Binary file>>
  
  
  1.1                  xml-batik/test-references/samples/tests/spec/scripting/rect.png
  
  	<<Binary file>>
  
  
  1.1                  xml-batik/test-references/samples/tests/spec/scripting/remove.png
  
  	<<Binary file>>
  
  
  1.1                  xml-batik/test-references/samples/tests/spec/scripting/transform.png
  
  	<<Binary file>>
  
  
  1.1                  xml-batik/test-references/samples/tests/spec/scripting/transform2.png
  
  	<<Binary file>>
  
  
  1.1                  xml-batik/test-references/samples/tests/spec/scripting/xyModifOnLoad.png
  
  	<<Binary file>>
  
  
  1.20      +3 -1      xml-batik/test-resources/org/apache/batik/test/regard.xml
  
  Index: regard.xml
  ===================================================================
  RCS file: /home/cvs/xml-batik/test-resources/org/apache/batik/test/regard.xml,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- regard.xml	12 Feb 2002 18:17:45 -0000	1.19
  +++ regard.xml	7 Mar 2002 09:02:57 -0000	1.20
  @@ -11,7 +11,7 @@
   <!-- regression testing.                                                       -->
   <!--                                                                           -->
   <!-- @author vincent.hardy@eng.sun.com                                         -->
  -<!-- @version $Id: regard.xml,v 1.19 2002/02/12 18:17:45 deweese Exp $  -->
  +<!-- @version $Id: regard.xml,v 1.20 2002/03/07 09:02:57 tkormann Exp $  -->
   <!-- ========================================================================= -->
   <testRun id="regard" name="Batik Standard Regression Test Run">
       <testReportProcessor class="org.apache.batik.test.xml.XMLTestReportProcessor" >

  @@ -58,5 +58,7 @@
       <testSuite href="file:test-resources/org/apache/batik/gvt/unitTesting.xml" />

       <testSuite href="file:test-resources/org/apache/batik/parser/unitTesting.xml" />

       <testSuite href="file:test-resources/org/apache/batik/transcoder/image/unitTesting.xml"
/> 
  +
  +    <testSuite href="file:test-resources/org/apache/batik/css/engine/value/unitTesting.xml"
/> 
   
   </testRun>
  
  
  
  1.61      +16 -1     xml-batik/test-resources/org/apache/batik/test/samplesRendering.xml
  
  Index: samplesRendering.xml
  ===================================================================
  RCS file: /home/cvs/xml-batik/test-resources/org/apache/batik/test/samplesRendering.xml,v
  retrieving revision 1.60
  retrieving revision 1.61
  diff -u -r1.60 -r1.61
  --- samplesRendering.xml	7 Feb 2002 12:44:53 -0000	1.60
  +++ samplesRendering.xml	7 Mar 2002 09:02:57 -0000	1.61
  @@ -8,7 +8,7 @@
   
   <!-- ========================================================================= -->
   <!-- @author vincent.hardy@eng.sun.com                                         -->
  -<!-- @version $Id: samplesRendering.xml,v 1.60 2002/02/07 12:44:53 tkormann Exp $ -->
  +<!-- @version $Id: samplesRendering.xml,v 1.61 2002/03/07 09:02:57 tkormann Exp $ -->
   <!-- ========================================================================= -->
   <testSuite id="samplesRendering" name="samples and samples/test Rendering" class="org.apache.batik.test.svg.SamplesRenderingTest">
   
  @@ -252,6 +252,21 @@
           <test id="samples/tests/spec/text/verticalTextOnPath.svg" />
           <test id="samples/tests/spec/text/textPosition.svg" />
           <test id="samples/tests/spec/text/textPosition2.svg" />
  +    </testGroup>
  +
  +    <testGroup id="tests.spec.scripting">
  +        <test id="samples/tests/spec/scripting/add.svg" />
  +        <test id="samples/tests/spec/scripting/circle.svg" />
  +        <test id="samples/tests/spec/scripting/ellipse.svg" />
  +        <test id="samples/tests/spec/scripting/line.svg" />
  +        <test id="samples/tests/spec/scripting/path.svg" />
  +        <test id="samples/tests/spec/scripting/polygon.svg" />
  +        <test id="samples/tests/spec/scripting/polyline.svg" />
  +        <test id="samples/tests/spec/scripting/rect.svg" />
  +        <test id="samples/tests/spec/scripting/remove.svg" />
  +        <test id="samples/tests/spec/scripting/transform.svg" />
  +        <test id="samples/tests/spec/scripting/transform2.svg" />
  +        <test id="samples/tests/spec/scripting/xyModifOnLoad.svg" />
       </testGroup>
   
   </testSuite>
  
  
  
  1.28      +5 -3      xml-batik/test-sources/org/apache/batik/test/svg/SVGRenderingAccuracyTest.java
  
  Index: SVGRenderingAccuracyTest.java
  ===================================================================
  RCS file: /home/cvs/xml-batik/test-sources/org/apache/batik/test/svg/SVGRenderingAccuracyTest.java,v
  retrieving revision 1.27
  retrieving revision 1.28
  diff -u -r1.27 -r1.28
  --- SVGRenderingAccuracyTest.java	6 Dec 2001 08:13:47 -0000	1.27
  +++ SVGRenderingAccuracyTest.java	7 Mar 2002 09:02:57 -0000	1.28
  @@ -67,7 +67,7 @@
    * all pixel values are the same).
    *
    * @author <a href="mailto:vhardy@apache.lorg">Vincent Hardy</a>
  - * @version $Id: SVGRenderingAccuracyTest.java,v 1.27 2001/12/06 08:13:47 vhardy Exp $
  + * @version $Id: SVGRenderingAccuracyTest.java,v 1.28 2002/03/07 09:02:57 tkormann Exp
$
    */
   public class SVGRenderingAccuracyTest extends AbstractTest {
       /**
  @@ -948,13 +948,15 @@
       public ImageTranscoder getTestImageTranscoder(){
           ImageTranscoder t = new InternalPNGTranscoder();
           t.addTranscodingHint(PNGTranscoder.KEY_FORCE_TRANSPARENT_WHITE,
  -                             new Boolean(false));
  +                             Boolean.FALSE);
           t.addTranscodingHint(PNGTranscoder.KEY_BACKGROUND_COLOR,
                                new Color(0,0,0,0));
  +        t.addTranscodingHint(PNGTranscoder.KEY_EXECUTE_ONLOAD,
  +                             Boolean.TRUE);
   
           if (validate){
               t.addTranscodingHint(PNGTranscoder.KEY_XML_PARSER_VALIDATING,
  -                                 new Boolean(true));
  +                                 Boolean.TRUE);
               t.addTranscodingHint(PNGTranscoder.KEY_XML_PARSER_CLASSNAME,
                                    VALIDATING_PARSER);
           }
  
  
  

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


Mime
View raw message