On 9/14/06, Cameron McCormack <[EMAIL PROTECTED]> wrote:
Hi Yaroslav.
Yaroslav Bulatov:
> Hi, I'm trying to substitute a different DOM implementation into a
> component rendered by JSVGCanvas, is the right strategy extend that
> class to override "loadSVGDocument" to provide my own DocumentLoader
> which provides my own version of DocumentFactory which in turn returns
> my custom DOM Implementation?
Do you want to just provide some implementations of some elements in the
document (e.g. your XForms elements)? If so, then you can provide an
instance of org.apache.batik.dom.DomExtension. See
http://xmlgraphics.apache.org/batik/extendingBatik.html#domExtension for
how to do this.
Actually the reason I want to provide my own implementation is to
enable XForms events generated by another framework (Chiba) to
propagate to the DOM hierarchy generated by Batik.
Right now those XForms events are dispatched through
org.apache.batik.dom.events.EventSupport.dispatch(), which discards
all events that are not instances of w3c's CustomEvent or batik's
AbstractEvent
Since I can't get Chiba to usea different implementation for event
generation, I understand that I must provide my own DOMImplementation
which overrides getEventSupport and getDocumentEventSupport to provide
my own event support classes. In particular my version of EventSupport
would override "dispatchEvent" to wrap Chiba's XFormsEvent into an
implementation compatible with Batik, and call the original
dispatchEvent method.
The question is -- how do I substitute this DOM implementation into
SVG document loaded into JSVGCanvas using loadSVGDocument?
As far as I can see, the DOM implementation used when I invoke
JSVGCanvas.loadDocument() is hardcoded to be SVGDOMImplementation (it
uses DocumentLoader, which uses SAXSVGDocumentFactory which uses
SVGDocumentImplementation), so I would need to override at least those
3 classes, is that correct?
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]