Hm... for some strange reason, only the attachment got posted on the
mailing list, while the message text disappeared. Here is the text
again:

----------------------------------------------------------------------------
>| BridgeContext(UserAgent userAgent, InterpreterPool interpreterPool, DocumentLoader 
>documentLoader)
> 
> Is it what you mean? What should I supply as UserAgent and
> DocumentLoader? Can I call getUserAgent() and getDocumentLoader() on the
> BridgeContext created by the super class and then use them in my own
> BridgeContext?

I tried this way and it worked for me:

,----
| import org.apache.batik.swing.*;
| import org.apache.batik.swing.svg.*;
| import org.apache.batik.bridge.*;
| 
| class JExtendedSVGCanvas extends JSVGCanvas
| {
|   protected BridgeContext createBridgeContext()
|   {
|     BridgeContext bridgeContext = super.createBridgeContext();
| 
|     org.apache.batik.script.InterpreterPool pool = new 
org.apache.batik.script.InterpreterPool();
|     pool.putInterpreterFactory("text/ecmascript", new 
ExtendedRhinoInterpreterFactory());
|     BridgeContext newBridgeContext = new BridgeContext(
|       bridgeContext.getUserAgent(), pool, bridgeContext.getDocumentLoader());
| 
|     // Check if the original BridgeContext is dynamic and set newBridgeContext
|     // to the same state (otherwise it won't update the document)
|     if (bridgeContext.isDynamic())
|       newBridgeContext.setDynamicState(BridgeContext.DYNAMIC);
| 
|     return newBridgeContext;
|   }
| }
`----

I hope, reusing UserAgent and DocumentLoader won't break anything?

Suggestion for future releases: please consider including some working
code samples in the distribution, it would simplify the learning process
significantly! I attached a complete working version of the "print"
example from the tutorial.

----------------------------------------------------------------------------

-- 
\  /                                       [EMAIL PROTECTED]
 \/lad                                     http://www.hashbang.de 


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

Reply via email to