HI, I use this code to init the SVGDom UserAgentAdapter mUserAgent = new UserAgentAdapter(); BridgeContext mCtx = new BridgeContext(mUserAgent); mCtx.setDynamicState(BridgeContext.DYNAMIC); GVTBuilder mBuilder = new DynamicGVTBuilder(); GraphicsNode mGVTElement = mBuilder.build(mCtx, element);
and to get the GraphicsNode I use: mCtx.getGraphicsNode(pElement); (Element is a org.w3c.dom.Element) I hope this can help you! Ciao aGO! Zenobios wrote: > > Hi, > > sorry for pushing this old thread. But I want to do exactly the same and I > have exactly the same problem: After build(ctx,element) the returned > GraphicsNode is null... > > Any suggestions? > > Cheers, > Zenobios > > > tavolate wrote: >> >> I'm trying to do an SVG Editor with Batik and Eclipse. >> I use the Batik DOM to manage the SVG file and after some process I draw >> the SVG elements as image inside a Figure (Draw2d). For each child node >> (text, rect, g..) inside the SVG DOM I would like to make a GraphicsNode. >> So when I modify for example x and y coordinates with my editor, I have >> to modify x and y coordinates of node and then redraw it. >> >> With the code below, mGVTElement after the build is NULL. >> >> >> thomas.deweese wrote: >>> >>> Hi aGO, >>> >>> tavolate <[EMAIL PROTECTED]> wrote on >>> 12/06/2007 11:48:17 AM: >>> >>>> is it possible to create a GraphicsNode from an Element of a SVG >>> Document? >>> >>> Yes, you have more or less shown the code below. >>> The code below can't work in all cases (in particular the >>> fact that you have set the context dynamic seems like trouble). >>> So what are you trying to do in a wider sense? >>> >>> Or what problems are you having with the code >>> below? >>> >>>> Ex: >>>> >>>> UserAgentAdapter mUserAgent = new UserAgentAdapter(); >>>> BridgeContext mCtx = new BridgeContext(mUserAgent); >>>> mCtx.setDynamicState(BridgeContext.DYNAMIC); >>>> GVTBuilder mBuilder = new DynamicGVTBuilder(); >>>> >>>> GraphicsNode mGVTElement = mBuilder.build(mCtx, element); >>>> >>>> >>>> element is a part of SVG document for example a rect tag (I can get it >>> with >>>> document.getElementByTagName(...)). >>> >>> >> >> > > -- View this message in context: http://www.nabble.com/GVT-Builder-problem-tp14195869p18316107.html Sent from the Batik - Users mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
