Ezra,

Ezra Jennings wrote:
> 
> 
> 1. Is it possible to tell the SVGGenerator to not have the style of the rect be 
>applied at the g element that is the parent of the rect, but instead have the style 
>be applied on the rect itself?  (I realize I could do DOM manipulations myself to do 
>this, but want to know if the SVG generator can do that automatically.)
> 
> instead of what's below in the output, have:
>     <g>
>       <rect x="10" y="10" width="100" height="100" style="fill:red; stroke:red;" />
>     </g>
> 
> (and maybe get rid of the <g> </g> tags then)

No, short of doing the a heavy manipulation through the DOM and move the
style to the rect yourself, then remove the <g>s. However, this only 
works in a very specific context if you know that this is exactly the
structure of your output SVG.

> 
> 2. Is it possible to have the id attribute of the rect element set in the 
>SVGGraphics2D object before the SVG is generated so when the SVG is generated, the 
>SVG output
> has an id attribute in it?
> ...

There is an example of how to put automatic ids in content generated
by SVGGraphics2D in the SwingSVGPrettyPrint class:

http://cvs.apache.org/viewcvs.cgi/xml-batik/sources/org/apache/batik/svggen/SwingSVGPrettyPrint.java?rev=1.4&content-type=text/vnd.viewcvs-markup

I hope this helps.
Vincent.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to