What I would like to do, is just a little example of how to use ScripHandler.java
Could you please help me. Just few words.


-----
I have tried this: - but I don't have the expected "yellow circle".

------------------------
SVGApplication.java
------------------------
import org.w3c.dom.*;
import org.apache.batik.script.ScriptHandler;
import org.apache.batik.script.Window;

public class SVGApplication implements ScriptHandler {
public void run (final Document document, final Window win) {
Element changecolor=document.getElementById("myclic-circle");
changecolor.setAttributeNS(null, "style", "fill:yellow");
}
}
------------
manifest.mf
------------
Manifest-Version: 1.0
Script-Handler: SVGApplication
------------------------
SVGApplication.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";>
<svg xmlns="http://www.w3.org/2000/svg";
xmlns:xlink="http://www.w3.org/1999/xlink";>


<script type="application/java-archive"
xlink:href="SVGApplication.jar" />
<circle id="myclic-circle" cx="25" cy="25" r="25" style="fill:blue" onclick="SVGApplication()" />
</svg>
--------
launch
--------
cd c:\temp\ (all are in that directory)
javac SVGApplication.java
jar cmf manifest.mf SVGApplication.jar *.class
My .class and .jar are now in the directory c:\temp\
Then, when I try the svg file, and clic on the "blue circle" I don't have the expected "yellow circle".
---
In fact, with this examle, I would like to succeed the http://xml.apache.org/batik/javaScripting.html SVGApplication.
---


Thank for your help
Ludovic Desforges


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to