Hi Batik user group,
I am using Batik for rendering SVG in my java application. The SVG is
interactive and responds to mouse events. I have programmed mouse listeners in
JavaScript using Rhino) to execute . I am using JavaScript for listener code
instead of Java so that I can reuse the SVG file in an HTML page without having
to rewrite anything. My SVG files looks like -
<svg onload="init(evt)">
<script>
var svgDocument;
function init(evt) {
svgDocument = evt.target.ownerDocument;
}
</script>
.....
</svg>
I have a few questions about using JavaScript with Batik -
1. My JavaScript code declares functions. Is it possible to invoke JavaScript
functions from my java class? For instance, can I invoke the function 'init'
from a Java class.
2. Occasionally, I need to pass data from my JavaScript functions to my java
class. Is it possible to invoke methods of my Java object from my JavaScript?
3. I have a version of my application that uses java for mouse listeners. It is
much faster than the JavaScript prototype. I suspect performance issues with
Rhino. Are there tips and tricks to improve performance when using Rhino and
batik together.
4. I understand that Rhino ships with JDK 6 as the default JavaScript execution
engine for javax.Script . Is it possible to use the Rhino that ships with JDK
instead of js.jar that ships with Batik.
5. Is it common to use Batik + Rhino for creating interactive SVG in a java
application. If so, can you share your experience with me. Are there any
tutorials or sample application I can look at for help.
Thanks,
Jyoti
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]