> > > I must say that I have a few reservations about the general >technique of adding new elements to SVG. I don't really know what >your constraints are but you might consider using a transformation >language like XSLT to map your custom grammer into standard SVG. >
I will use some brain cycles to process that idea. I had not previoulsy thought of that. > However if you really need to be able to use Java2D to do >rendering of the element this approach is probably the only feasable >one. > I need no Java2D at all. But I need to make things appear/disappear/change depending on (a set of) Java variables which represent the state of an automation system. So, to use XSLT I would have to generate some dynamic XML which would change only a little bit, every time a variable changes. Then I would have to do an entire transform, and an entire render. If I use custom "g" components that make their content be rendered/not rendered, I only would need to do the entire render, thus being much more efficient. >AFB> What I did: > >AFB> Created a DOM extension. Created a bridge extension. Created an >AFB> element. Created a bridge. > >AFB> If I launch the browser loading a file which contains the >AFB> <ext:wrapper> thing, I see the constructors being called, for the >AFB> bridge, and for the element. > >AFB> However, the bridge method for generating a GVT node are NEVER >AFB> called. > >AFB> Why is that? > > I suspect that you are not registering them with the DOM >implementation or the BridgeContext. If not you probably want to look >at batik.extensions.svg.BatikDomExtension, and >batik.extensions.svg.BatikBridgeExtension. Note that on top of >writing these classes you need to create a 'services' file, take a >look at the contents of 'xml-batik/resources/META-INF/services/', and >'http://java.sun.com/j2se/1.3/docs/guide/jar/jar.html#Service Provider'. > I did look at those files, and used the registering methods at them (copy+paste+modify to suit my names). I created the services file and... the constructors of my custom element _and_ bridge *are* both called. But then, once constructed, the bridge is *not* used at all. The constructor is probably called at the registering stage. May I send you the sources I have for you to look at? I am relly stuck on this. Thank you very much for all your attention. Antonio Fiol --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
