vhardy 2003/07/09 12:15:04 Modified: . build.xml samples/tests/resources/script common.js Added: samples/tests/resources/java/resources/com/test/script java-binding.mf samples/tests/resources/java/sources/com/test/script EventListenerInitializerImpl.java samples/tests/spec/scripting javaBinding.svg Log: Added regression test for Java binding using the SVG 1.1 specification Revision Changes Path 1.134 +10 -1 xml-batik/build.xml Index: build.xml =================================================================== RCS file: /home/cvs/xml-batik/build.xml,v retrieving revision 1.133 retrieving revision 1.134 diff -u -r1.133 -r1.134 --- build.xml 8 Jul 2003 07:32:36 -0000 1.133 +++ build.xml 9 Jul 2003 19:15:03 -0000 1.134 @@ -344,6 +344,15 @@ </jar> </target> + <target name="java-binding.jar" depends="compiletestjars" > + <jar manifest="${samples}/tests/resources/java/resources/com/test/script/java-binding.mf" + jarfile="${samples}/tests/spec/scripting/java-binding.jar"> + <fileset dir="${samples}/tests/resources/java/classes"> + <include name="com/test/script/EventListenerInitializerImpl*.class"/> + </fileset> + </jar> + </target> + <target name ="compile" depends ="init" 1.1 xml-batik/samples/tests/resources/java/resources/com/test/script/java-binding.mf Index: java-binding.mf =================================================================== Manifest-Version: 1.0 SVG-Handler-Class: com.test.script.EventListenerInitializerImpl 1.1 xml-batik/samples/tests/resources/java/sources/com/test/script/EventListenerInitializerImpl.java Index: EventListenerInitializerImpl.java =================================================================== /***************************************************************************** * Copyright (C) The Apache Software Foundation. All rights reserved. * * ------------------------------------------------------------------------- * * This software is published under the terms of the Apache Software License * * version 1.1, a copy of which has been included with this distribution in * * the LICENSE file. * *****************************************************************************/ package com.test.script; import org.w3c.dom.Element; import org.w3c.dom.events.Event; import org.w3c.dom.events.EventListener; import org.w3c.dom.events.EventTarget; import org.w3c.dom.svg.EventListenerInitializer; import org.w3c.dom.svg.SVGDocument; /** * This class implements the EventListenerInitializer interface. * * @author <a href="mailto:[EMAIL PROTECTED]">Christophe Jolif</a> * @version $Id: EventListenerInitializerImpl.java,v 1.1 2003/07/09 19:15:04 vhardy Exp $ */ public class EventListenerInitializerImpl implements EventListenerInitializer { /** * This method is called by the SVG viewer * when the scripts are loaded to register * the listener needed. * @param doc The current document. */ public void initializeEventListeners(SVGDocument doc) { System.err.println(">>>>>>>>>>>>>>>>>>> SVGDocument : " + doc); ((EventTarget)doc.getElementById("testContent")). addEventListener("mousedown", new EventListener() { public void handleEvent(Event evt) { ((Element)evt.getTarget()).setAttributeNS(null, "fill", "orange"); } }, false); } } 1.2 +0 -2 xml-batik/samples/tests/resources/script/common.js Index: common.js =================================================================== RCS file: /home/cvs/xml-batik/samples/tests/resources/script/common.js,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- common.js 30 Apr 2002 08:45:16 -0000 1.1 +++ common.js 9 Jul 2003 19:15:04 -0000 1.2 @@ -91,8 +91,6 @@ } } - - /** * Sets the content of a text node */ 1.1 xml-batik/samples/tests/spec/scripting/javaBinding.svg Index: javaBinding.svg =================================================================== <?xml version="1.0" standalone="no"?> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN" "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd"> <!-- ========================================================================= --> <!-- Copyright (C) The Apache Software Foundation. All rights reserved. --> <!-- --> <!-- This software is published under the terms of the Apache Software License --> <!-- version 1.1, a copy of which has been included with this distribution in --> <!-- the LICENSE file. --> <!-- ========================================================================= --> <!-- ========================================================================= --> <!-- Test description here --> <!-- --> <!-- @author [EMAIL PROTECTED] --> <!-- @version $Id: javaBinding.svg,v 1.1 2003/07/09 19:15:04 vhardy Exp $ --> <!-- ========================================================================= --> <?xml-stylesheet type="text/css" href="../../resources/style/test.css" ?> <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="450" height="500" viewBox="0 0 450 500"> <!-- ============================================================= --> <!-- Test content --> <!-- ============================================================= --> <g id="testContent" transform="translate(135, 120) scale(2)"> <rect width="40" height="40" fill="crimson" stroke-width="4" stroke="gold" /> <circle cx="70" cy="20" r="20" fill="crimson" stroke-width="4" stroke="gold" /> <rect x="50" y="50" width="40" height="40" fill="crimson" stroke-width="4" stroke="gold" /> <circle cx="20" cy="70" r="20" fill="crimson" stroke-width="4" stroke="gold" /> </g> <script type="application/java-archive" xlink:href="java-binding.jar" /> <!-- ============================================================= --> <!-- Batik sample mark --> <!-- ============================================================= --> <use xlink:href="../../../batikLogo.svg#Batik_Tag_Box" /> </svg>
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]