Thanks thomas that worked. Now I have a question. I've tried early to put my statement inside runnablequeue but gives me a nullpointerexception(i think). That is when I didn't set my document state. So then is runnablequeue only available when the document state is set to dynamic?
vyang thomas.deweese wrote: > > Hi Vyang, > > vyang <[EMAIL PROTECTED]> wrote on 02/23/2007 03:58:58 PM: > >> I meant its an image of a svg file on server. I added your line of code > to >> my constructor and it doesn't seem to work. It is coded as follows: > > I suspect the problem is that you are modifying the document while > Batik is trying to build the rendering tree. There are a number > of ways to avoid this problem. Probably the simplest is to > clone the entire tree into a new document before giving it to > the Canvas to display. > > The best way would be to change the way you are doing everything > and make your Document a dynamic SVG document. This would allow you > to modify the document and have the Canvas automatically update the > display. For this to work however you need to make all your changes > to the document in the update manager's RunnableQueue. You can > look at the Batik FAQ for information on how to run thing in > the RunnableQueue. > >> impl = SVGDOMImplementation.getDOMImplementation(); >> svgNS = SVGDOMImplementation.SVG_NAMESPACE_URI; >> xlinkNS = XMLConstants.XLINK_NAMESPACE_URI; >> >> doc = impl.createDocument(svgNS, "svg", null); >> SVGOMDocument omDocument = (SVGOMDocument) doc; >> try { >> omDocument.setURLObject(new > File("c:/icontemp.svg").toURL()); >> } catch (MalformedURLException ex) { >> ex.printStackTrace(); >> } >> >> svgRoot = doc.getDocumentElement(); >> groupElement = doc.createElementNS(svgNS, "g"); >> svgRoot.appendChild(groupElement); >> >> I also notice that if I type real slow the image doesn't get broken up > (my >> method gets called after a key is pressed). Any thoughts on whats >> happening? >> >> vyang > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > -- View this message in context: http://www.nabble.com/xlink%3Ahref-problem---tf3274450.html#a9161124 Sent from the Batik - Users mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]