On 1 Nov 2004, at 16:01, Thomas DeWeese wrote:
Jeffrey Hau wrote:
i have the following ecmascript embedded in a svg document,
function test() { alert("test java.") };
obj = { run: test };
r = java.lang.Runnable(obj);
t = new java.lang.Thread(r);
t.start();
when i run this in batik (JSVGCanvas) i get the following error,
org.mozilla.javascript.EvaluatorException: error instantiating (java.lang.RuntimeException: NOT SUPPORTED): class java.lang.Runnable is interface or abstract (Inline <script> file:/Users/jh398//lines.svg:6; line 18)
at however the above script works fine in rhino's shell. Has this feature been disabled in batik?
Not to my knowledge. However I can't figure out where the error message is coming from (neither Batik nor Rhino has the string "NOT SUPPORTED" in them). If you are running in Squiggle with security turned on this message might come from the JVM it's self.
Also, I wouldn't do what you are doing... Our JavaScript interface is not thread safe, and even if it were our DOM interface isn't and if you modify the document from the thread you create you are likely to run into _serious_ issues.
I am trying to implement a listener interface, again i was trying out the example given in rhino's tutorial pages. what i really want to do is to have a call back functionality (waiting for a server to respond, then update my svg document), is the only way to achieve this by doing the following in my java code?
JSVGCanvas.getUpdateManager().getUpdateRunnableQueue().invokeLater(.....
thanks very much for you help,
Jeff
Further there is no way to fix this issue with the current JavaScript interface. You need access to the equivalent of the 'event queue' (from swing) for the SVG implementation.
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]