xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Lukasz Matuszczak" <l.matuszc...@atrem.pl>
Subject complex svg components - batik extension
Date Thu, 21 Apr 2005 10:38:32 GMT
Is it possible (and is it a proper way to do it?) to make such batik extension 
which would generate some complex set of svg tags from my custom tag. Then I 
would like to control the state of these svg tags from a Java class (perhaps 
some specific kind of a graphics node).

for example i would like to generate from a tag:

<oc:component x="10" y="40" width="200" height="300" 
   state="off" type="measurement" font-style="Arial">


   <rect x="10" y="40" width="200" height="300" visible="dependant on 
   <text font-style="Arial" x="20" y="400" font-size="50">value from 
   <circle cx="150" cy="150" r="20" fill="dependant on datasource" 
visible="dependant on datasource"/>
      some complex svg content dependant on datasource

Note that several fragments (attributes, value of <text> tag, content of <g> 
tag) of this document fragment are somehow dependant on Java processing. In my 
current solution I'm searching for my components before building gvt tree 
(nodelist = doc.getElementsByTagNameNS("http://mynamespace","component")) and 
then I'm creating java objects (new MyComponent(node from nodelist)). In these 
MyComponent objects I'm operating on Dom tree using update manager.
This solution has several drawbacks. Firstly it's a little complex to 
synchronize processing (start and then stop it correctly). I can't update before 
UpdateManager is started, and I don't want to hold references to DOM tree in 
MyComponent object if the JSVGCanvas is disposed. Moreover searching for my 
components (using getElementsByTagNameNS) is a bit time-consuming. Therefore 
I've thought about integrate my components with batik extension mechanism.

But I don't know how to do it. AFAIK there is a one to one correspondence 
between DOM and GVT nodes. I don't want also to draw my custom GraphicsNode 
without using SVG tags, because the power of my components' presentation lies in 

Any suggestions?

Lukasz Matuszczak 

To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org

View raw message