xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas E Deweese <thomas.dewe...@kodak.com>
Subject Re: getting a group element for each component
Date Mon, 05 Aug 2002 11:20:06 GMT
>>>>> "EB" == Erik Blankinship <erikb@media.mit.edu> writes:

>> if i want to add additional attribute elements to this <g> element,
>> all i have to do is ask my svgGenerator for getTopLevelGroup().
>> pretty easy. but what if I want to add custom attribute tags to
>> each subcomponent?

EB> this did not work.  asking SVGGraphics2D for getroot() or
EB> getTopLevelGroup() doesn't return anything.  evidently, it is not
EB> until you call stream() that the SVG document is generated at all?

    I don't think this is correct, as all stream does is call
'getRoot'.  Have you drawn anything to the Graphics2D when you call
this method?

    Also when you call this method it create a new group to do it's
drawing into.  So calling it up front then drawing then looking at the
group will not show you anything.

EB> is there a way to use SVGGraphics2D to just get a <g> element back
EB> from a component?

    Draw just the one component then get the root.  If you use a
JComponent you can override paintChildren and handle this correctly
for your case.

EB> thanks again ERIK!

    Hope it helps.  The real expert on this (Vicent Hardy) is away for
a while.

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

View raw message