Hi Ted,
[EMAIL PROTECTED] wrote:
Everything seems to be ok, but the BridgeContext always returns null !
Your code looks quite confused to me..
| GVTTreeWalker treeWalker = new
GVTTreeWalker(e.getGVTRoot());
| UserAgentAdapter userAgent = new UserAgentAdapter();
| GVTBuilder builder = new GVTBuilder();
| BridgeContext ctx = new BridgeContext(userAgent);
| ctx.setDynamic(true);
|
| builder.build(ctx, theDocument);
By doing this you are attaching a new GVT tree to 'theDocument'
You apparently already have a GVT tree (first line e.getGVTRoot()).
So I have to wonder why you are doing this? Did you not
build the document dynamically the first time? Doing this will
severely corrupt the document so it is a very bad idea...
| GraphicsNode root = theGVTTreeWalker.getRoot();
| Point point = new Point(nowToX, nowToY);
|
| // this (seems) to get the correct rectangle in the SVG
file (see below)
| GraphicsNode childGNode = root.nodeHitAt(point);
|
| // this comes up null every time
| - >>>>> Element svgElement = theBridgeContext.getElement(childGNode);
Almost none of the instances used here seem to be related to anything
that comes before, so I can't make sense of this.
|
| - >>>>> //ultimately, I need to get this group's id attribute (see
below)
String targetNodeID = svgElement.getAttribute("id");
Here's the snipped SVG group:
<g id="guid_F917D459-6947-4C77-874B-9FED41DF5492">
<g transform="translate(50,30)" style="font-size:11;
fill:rgb(230,230,245); font-family:'Arial'
stroke:rgb(230,230,245); stroke-width:1.5;">
<rect x="180" y="189" width="35.2494" style="stroke:none;" height="63"
/>
<rect x="180" y="189" width="35.2494" style="fill:none;
stroke:rgb(0,0,205);" height="63" />
<text x="184.62469482421875" y="200" style="font-size:9; fill:black;
stroke:none;" xml:space="preserve">R6/Z1
</text>
<text x="181.62469482421875" y="218" style="font-size:8; fill:black;
stroke:none;" xml:space="preserve">W1:19.00
</text>
<text x="181.62469482421875" y="226" style="font-size:8; fill:black;
stroke:none;" xml:space="preserve">W2:13.00
</text>
</g>
</g>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]