Hi,
How do I terminate javascript running in an SVG document?
I have 2 SVG documents which both run infinite loop javascript programs
(timers for clocks).
I display them using JSVGCanvas and they both display and behave correctly.
However, when I switch between them, I wish to terminate the script of the
current document before loading the next document, but I get an Exception...
java.lang.IllegalStateException: Timer already cancelled.
        at java.util.Timer.sched(Timer.java:312)
        at java.util.Timer.schedule(Timer.java:128)
        at org.apache.batik.bridge.ScriptingEnvironment$Window.setTimeout(Unknown
Source)
        at
org.apache.batik.script.rhino.WindowWrapper.jsFunction_setTimeout(Unknown
Source)         at inv2.invoke()
(I have listed the FULL EXCEPTION at the end)

Perhaps I am terminating the scripts incorrectly.
At present I do this......

    UpdateManager updateManager = getUpdateManager();
    if (updateManager != null)
    {
        ScriptingEnvironment se = updateManager.getScriptingEnvironment();
        if (se != null)
        {
            se.interrupt();
        }
    }

How should a javascript be terminated?

thanks,
Stuart McMahon


FULL EXCEPTION .....

java.lang.IllegalStateException: Timer already cancelled.
    at java.util.Timer.sched(Timer.java:312)
    at java.util.Timer.schedule(Timer.java:128)
    at
org.apache.batik.bridge.ScriptingEnvironment$Window.setTimeout(Unknown
Source)
    at
org.apache.batik.script.rhino.WindowWrapper.jsFunction_setTimeout(Unknown
Source)
    at inv2.invoke()
    at org.mozilla.javascript.FunctionObject.doInvoke(Unknown Source)
    at org.mozilla.javascript.FunctionObject.callVarargs(Unknown Source)
    at org.mozilla.javascript.FunctionObject.call(Unknown Source)
    at org.mozilla.javascript.ScriptRuntime.call(Unknown Source)
    at org.mozilla.javascript.gen.c19.call(Inline Script:18)
    at org.mozilla.javascript.ScriptRuntime.call(Unknown Source)
    at org.mozilla.javascript.gen.c18.call(Inline Script:8)
    at org.mozilla.javascript.optimizer.OptRuntime.callSimple(Unknown
Source)
    at org.mozilla.javascript.gen.c23.call(<SVG>:1)
    at org.mozilla.javascript.gen.c23.exec(<SVG>)
    at org.mozilla.javascript.Context.evaluateReader(Unknown Source)
    at org.apache.batik.script.rhino.RhinoInterpreter.evaluate(Unknown
Source)
    at org.apache.batik.script.rhino.RhinoInterpreter.evaluate(Unknown
Source)
    at
org.apache.batik.bridge.BaseScriptingEnvironment$1.handleEvent(Unknown
Source)
    at org.apache.batik.dom.events.EventSupport.fireEventListeners(Unknown
Source)
    at org.apache.batik.dom.events.EventSupport.dispatchEvent(Unknown
Source)
    at org.apache.batik.dom.AbstractNode.dispatchEvent(Unknown Source)
    at
org.apache.batik.bridge.BaseScriptingEnvironment.dispatchSVGLoad(Unknown
Source)
    at
org.apache.batik.bridge.BaseScriptingEnvironment.dispatchSVGLoad(Unknown
Source)
    at
org.apache.batik.bridge.BaseScriptingEnvironment.dispatchSVGLoad(Unknown
Source)
    at
org.apache.batik.bridge.BaseScriptingEnvironment.dispatchSVGLoadEvent(Unknow
n Source)
    at org.apache.batik.bridge.UpdateManager.dispatchSVGLoadEvent(Unknown
Source)


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

Reply via email to