Thomas DeWeese <[EMAIL PROTECTED]> writes:
> Actually it does:
> For example if you are using the Batik SVGBrowser application you
> should be able to use the previous piece of code on a subclass of
> the JSVGCanvas class in the createBridgeContext() method.
>
> This would be the 'best' place to put it for two reasons, firstly
> it would ensure that no-one has looked at the bridge context
> interpreter pool yet. And Second, see below...
I'm not using the Batik SVGBrowser application, just JSVGCanvas. So, the
user is expected to subclass JSVGCanvas and override the
createBridgeContext() method, something like this?
,----
| import org.apache.batik.swing.*;
| import org.apache.batik.swing.svg.*;
| import org.apache.batik.bridge.*;
|
| class JExtendedSVGComponent 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.setInterpreterPool(pool);
|
| return bridgeContext;
| }
| }
`----
But we still have the problem that setInterpreterPool() is protected...
> Yes, second you can change the constructor it calls so that it
> uses your interpreter pool rather than the default one
What constructor should I change? Create my own BridgeContext instead of
calling super.createBridgeContext()? I found this constructor:
| 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?
> (or subclass so you can call setInterpreterPool).
If I subclass BridgeContext, how should I tell JSVGCanvas to use my new
class?
--
\ / [EMAIL PROTECTED]
\/lad http://www.hashbang.de
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]