Hi Mistercaste,
mistercaste <[email protected]> wrote on 10/22/2009 07:24:44 AM:
> I get the Element with the getElementById(String) method.
Ok, most of the stuff looks fine. So I suspect your
element is in a 'defs' or perhaps part of a subtree that
has 'display="none"' set on it. You may still think the
element should have a graphics node because there may be
a use element that references it but it doesn't (we create
a 'copy' since a used element may actually be associated
with many GN).
The one thing that isn't quite right here is that
you should really only look at the DOM/GN tree from
the UpdateManager. I don't think this is your problem
but I mention it for the benefit of others.
> SVGDocument docum = canvas.getSVGDocument();
BTW it's important to make sure the document you are
working with came from the canvas. If your document isn't
using the Batik DOM then we need to copy it so that it
Does use the Batik DOM (with CSS, DOM events, etc support).
> Element element = docum.getElementById("MySvgElement"); <-
HERE I GET THE SVG ELEMENT
Can you forward a skeleton SVG file that shows where/what MySvgElement
is?
> UpdateManager um = ((JSVGCanvas) c).getUpdateManager(); <-
JGVTComponent to JSVGCanvas
> BridgeContext bc = um.getBridgeContext();
> System.out.println("BC: " + bc.toString()); <--------------
THIS RETURNS SOMETHING
> GraphicsNode gn = (GraphicsNode)
bc.getGraphicsNode(element);
> System.out.println("GN: " + gn); <-------------------------
THIS RETURNS NULL