David Bullock wrote:
> > Then, using the DOM API, I add append a new <use> to the top level
> > <svg> tag like this:
> >
> > SVGElement topNode = ... // find the top <svg> node
> > ...
> > String iconId = ... // id of the icon you want to display
> > SVGElement use = (SVGElement)svg.createElementNS(
> > SVGDOMImplementation.SVG_NAMESPACE_URI, "use");
> > use.setAttributeNS(XPATH_NAMESPACE_URI, "href", "#" + iconId);
> > use.setAttribute("visibility", "visible");
> > use.setAttribute("x", "" + x);
> > use.setAttribute("y", "" + y);
> > topNode.appendChild(use);
>
> Hi Archie,
>
> This method worked well for me, thanks.
>
> I suppose it works well to have a common semantic model (the
> SVG DOM) for vector graphics. I do find W3 DOM's awkward
> to work with, but that's the price you pay for using only
> IDL-compatible Java idioms, I guess.
>
> The GVTBuilder code, upon encountering a <svg:use/> element,
> simply builds a new GraphicsNode corresponding to the target
> of the use and the use's translations, thus achieving the same
> effect as I intended by cloning a GrahicsNode.
Glad that worked... it's still an open question (to me) whether one
method is more "correct", faster, etc. than the other.
-Archie
__________________________________________________________________________
Archie Cobbs * CTO, Awarix * http://www.awarix.com
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]