xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ted.Clem...@apcc.com
Subject BridgeContext.getElement returns null
Date Tue, 14 Jun 2005 16:21:25 GMT
Everything seems to be ok, but the BridgeContext always returns null !
|
|              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);
|                 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);
|
| - >>>>>  //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:&apos;Arial&apos;
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: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org


Mime
View raw message