Hi Cameron,

Thanks for looking into this.

A couple of new things:

1) I forgot to mention that line 17 of the ExtendedRhinoInterpreter example
is missing it's ending semi-colon.

2) In getting the ExtendedRhinoInterpreter compiled I moved on with the rest
of the example and noted that the last line of the InterPool building
example code has setIntepreterPool missing an 'r'.

3) Fixing the above I got stuck because the setInterpreterPool method of
BridgeContext has protected access and I couldn't seem to call it. Perhaps
I'm misunderstanding something straightforward here but my solution was to
extend the BridgeContext and override the method to provide public access. I
also had to extend SVG12BridgeContext to extend the new BridgeContext. 
Having done all this I am now able to make print calls from my JavaScript
and have it show up in the Java console. If there was a simpler way to do
this I'd love to hear it.

Here's my final createBridgeContext method:

    protected BridgeContext createBridgeContext(SVGOMDocument doc) {
        if (loader == null) {
            loader = new DocumentLoader(userAgent);
        }
        ExtendedBridgeContext result;
        if (doc.isSVG12()) {
            result = new ExtendedSVG12BridgeContext(userAgent, loader);
        } else {
            result = new ExtendedBridgeContext(userAgent, loader);
        }
        
        InterpreterPool pool = new InterpreterPool();
        InterpreterFactory f = new ExtendedRhinoInterpreterFactory();
        
        // Register the interpreter factory for all four MIME types that
        // Batik normally supports for ECMAScript.
        pool.putInterpreterFactory("text/ecmascript", f);
        pool.putInterpreterFactory("text/javascript", f);
        pool.putInterpreterFactory("application/ecmascript", f);
        pool.putInterpreterFactory("application/javascript", f);
        result.setInterpreterPool(pool);
        
        return result;
    } 

Regards,
Jeff Cressman

-- 
View this message in context: 
http://www.nabble.com/problems-extending-RhinoInterpreter-tf4934336.html#a14180378
Sent from the Batik - Users mailing list archive at Nabble.com.


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

Reply via email to