xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erik Bunn <...@basen.net>
Subject Identifying SVG DOM node equivalents in GVT
Date Thu, 21 Sep 2006 08:45:04 GMT

Is there a way of identifying the counterpart of an id'ed SVG node in  
a GVT tree?

I'll expound; I may be approaching SVG from a different direction  
than some.

An artist designs an appealing SVG icon for a steam engine. He  
publishes it in my system, informing me that within the SVG document,  
the color of SVG node 'foo' indicates operational status (green ==  
good, red == broken), and that the rotation angle of SVG node 'bar'  
indicates temperature and should be between 0 and 180 degrees.

I currently load the icon as an SVG DOM tree. I look up nodes 'foo'  
and 'bar', and, performing some nasty attribute manipulations,  
programmatically inject the current engine status and boiler  
temperature values measured from my favorite steam engine into the  
DOM. (Identifying the nodes intended for manipulation is relatively  
easy using JXPath, but changing SVG element attributes like this is  
just stupid.)

If I could identify those same graphical elements in the transformed  
GVT tree, I could just use the nice GraphicsNode API for the  
transformations. However, while I imagine that there's a strong  
correlation between GVT branches and SVG DOM branches, I don't see  
anything like id's being offered at the API level on the GVT side.

Hmm. Or should I stick to the SVG DOM side? Looks like I could use  
org.w3c.dom.svg.SVGLocatable.getTransform() and  
CSSStylableElement.setComputedStyleMap() to fill most of my needs,  
with a little type casting after the JXPath lookup.


Sorry if these are elementary questions, still trying to find my  
integration points to the library;
//ebu


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


Mime
View raw message