You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-users@xmlgraphics.apache.org by "MECHOULAM, Mickael" <mi...@astrium-space.com> on 2002/05/02 17:31:59 UTC

How can I add an attribute ? [was : Add user info to SVG shapes]

Hi,
The problem I explained in my previous message is already there, but I think
I was not very clear in the explanation, here is another try. Excuse me if
this question seems naive, but I'm really beginning in Batik and I do not
know which class to use !

The JAVA2D--> SVG translation done by SVG Graphics2D generator is perfect to
me, except one thing : I want to add attributes to some SVG elements during
the generation : 
if I have a X object, with a string attribute "nameX", I want to paint it in
the SVG file (<rectangle> element for example) AND add to this SVG element
the attribute "name=nameX". This attribute will be later used in scripts for
tooltips, but this is not yet my main problem. 

Any idea ?

Thank you, and sorry for my english (I am french).

Mikael Mechoulam

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


Re: How can I add an attribute ? [was : Add user info to SVG shapes]

Posted by Vincent Hardy <vi...@sun.com>.
Mikael,

"MECHOULAM, Mickael" wrote:
> 
> Hi,
> The problem I explained in my previous message is already there, but I think
> I was not very clear in the explanation, here is another try. Excuse me if
> this question seems naive, but I'm really beginning in Batik and I do not
> know which class to use !
> 
> The JAVA2D--> SVG translation done by SVG Graphics2D generator is perfect to
> me, except one thing : I want to add attributes to some SVG elements during
> the generation :
> if I have a X object, with a string attribute "nameX", I want to paint it in
> the SVG file (<rectangle> element for example) AND add to this SVG element
> the attribute "name=nameX". This attribute will be later used in scripts for
> tooltips, but this is not yet my main problem.
> 
> Any idea ?
> 

Yes: have a look at the org.apache.batik.svggen.SwingSVGPrettyPrint
class
which shows how to do this kind of things (e.g., add ids on the
elements).

I hope this helps.

Good luck,
Vincent.

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