You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-users@xmlgraphics.apache.org by Grant Mc Auley <gm...@som.llu.edu> on 2003/09/10 00:55:29 UTC
Waiting for RenderingCompleted
I need to ensure that the UpdateManager and all SVG element are not null
and available before an Applet's init() method returns in the code
below. In other words, I need to delay init() from returning until
gvtRendingCompleted() is called.
Does anybody have any suggestions on how I might accomplish this? I
have tried many approaches but to no avail. I am unclear about the
relationship between the GVTTreeBuilder thread and the main thread. Any
help with this would be much appreciated as I am facing a deadline.
//----------------------------------------------------------------
init() {
File f = new File("file.svg");
canvas = new JSVGCanvas();
canvas.addGVTTreeRendererListener(new GVTTreeRendererAdapter() {
public void gvtRenderingCompleted(GVTTreeRendererEvent e) {
um = canvas.getUpdateManager();
element = doc.getElementByID("name");
. . .
}
});
canvas.setDocumentState(JSVGCanvas.ALWAYS_DYNAMIC);
String parser = XMLResourceDescriptor.getXMLParserClassName();
SAXSVGDocumentFactory factory = new SAXSVGDocumentFactory(parser);
doc = factory.createDocument(f.toURL().toString());
canvas.setDocument(doc);
// delay goes here
}
//----------------------------------------------------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org
Re: Waiting for RenderingCompleted
Posted by Thomas DeWeese <Th...@Kodak.com>.
Hi Grant,
Grant Mc Auley wrote:
> No. It looks like the event does not even get fired. This is the state
> of the GVTTreeBuilder thread when the main thread is waiting (ie,
> mutex.wait() ):
>
> org.apache.batik.util.EventDispatcher
> org.apache.batik.swing.gvt.GVTTreeRenderer.fireEvent()
> org.apache.batik.swing.gvt.GVTTreeRenderer.run()
>
> When I do not use the mutex and use a breakpoint in renderingCompleted()
> I see this when stopped at the breakpoint:
>
> java.awt.EventQueue.postEventPrivate()
> java.awt.EventQueue.postEvent()
> java.awt.EventQueue.invokeAndWait()
> org.apache.batik.util.EventDispatcher
> org.apache.batik.swing.gvt.GVTTreeRenderer.fireEvent()
> org.apache.batik.swing.gvt.GVTTreeRenderer.run()
>
> So, somehow the waiting main thread seems to prevent the posting of the
> event from the TreeBuilder thread.
>> The GVTTreeBuilder is a seperate thread but I believe it
>> notifies in the AWT event thread.
>
> A deadlock would occur if the AWT Event thread was wait()ing for the
> wait()ing main thread. I wonder if this occurs for applets. In other
> words, is the AWT Event thread suspended until init() returns?
Yah, I suspect that the init thread either is the Event thread
or the Event thread will not be created until init returns. Either
way it is effectively impossible to delay the init thread until
the GVTTreeRenderer completes.
>
>>>>-----Original Message-----
>>>>From: Thomas DeWeese [mailto:Thomas.DeWeese@Kodak.com]
>>>>Sent: Tuesday, September 09, 2003 4:50 PM
>>>>To: Batik Users
>>>>Subject: Re: Waiting for RenderingCompleted
>>>>
>>>>
>>>>Grant Mc Auley wrote:
>>>>
>>>>
>>>>>I need to ensure that the UpdateManager and all SVG element
>>>>
>>>>are not null
>>>>
>>>>
>>>>>and available before an Applet's init() method returns in the code
>>>>>below. In other words, I need to delay init() from returning until
>>>>>gvtRendingCompleted() is called.
>>>>>
>>>>>Does anybody have any suggestions on how I might
>>
>>accomplish this? I
>>
>>>>>have tried many approaches but to no avail. I am unclear about the
>>>>>relationship between the GVTTreeBuilder thread and the main
>>>>
>>>>thread. Any
>>>>
>>>>
>>>>>help with this would be much appreciated as I am facing a deadline.
>>>>
>>>> You need to setup a mutex and wait on it, you probably also want
>>>>to check for failed/interrupted conditions:
>>>>
>>>>Object mutext = new Object;
>>>> canvas.addGVTTreeRendererListener(new GVTTreeRendererAdapter() {
>>>>public void gvtRenderingCompleted(GVTTreeRendererEvent e) {
>>>> // . . .
>>>>
>>>> synchronized (mutext) {
>>>> mutex.notifyAll();
>>>> }
>>>> }
>>>>
>>>>synchronized (mutext) {
>>>> canvas.setDocument(doc);
>>>> try {
>>>> mutext.wait();
>>>> catch(InterruptedException ie) {
>>>> ie.printStackTrace();
>>>> }
>>>>}
>>>>
>>>>
>>>>
>>>>
>>>>>//----------------------------------------------------------------
>>>>>
>>>>>init() {
>>>>>
>>>>> File f = new File("file.svg");
>>>>> canvas = new JSVGCanvas();
>>>>> canvas.addGVTTreeRendererListener(new GVTTreeRendererAdapter() {
>>>>>
>>>>> public void gvtRenderingCompleted(GVTTreeRendererEvent e) {
>>>>>
>>>>> um = canvas.getUpdateManager();
>>>>> element = doc.getElementByID("name");
>>>>> . . .
>>>>>
>>>>> }
>>>>>
>>>>> });
>>>>> canvas.setDocumentState(JSVGCanvas.ALWAYS_DYNAMIC);
>>>>> String parser = XMLResourceDescriptor.getXMLParserClassName();
>>>>> SAXSVGDocumentFactory factory = new
>>
>>SAXSVGDocumentFactory(parser);
>>
>>>>> doc = factory.createDocument(f.toURL().toString());
>>>>> canvas.setDocument(doc);
>>>>>
>>>>> // delay goes here
>>>>>
>>>>>}
>>>>>
>>>>>//----------------------------------------------------------------
>>>>>
>>>>>
>>>>>
>>>>>
>>>>
>>>>------------------------------------------------------------
>>
>>---------
>>
>>>>>To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
>>>>>For additional commands, e-mail: batik-users-help@xml.apache.org
>>>>>
>>>>>
>>>>
>>>>
>>>>
>>>>
>>>>------------------------------------------------------------
>>
>>---------
>>
>>>>To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
>>>>For additional commands, e-mail: batik-users-help@xml.apache.org
>>>>
>>>>
>>>
>>>
>>>
>>>
>>---------------------------------------------------------------------
>>
>>>To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
>>>For additional commands, e-mail: batik-users-help@xml.apache.org
>>>
>>>
>>
>>
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
>>For additional commands, e-mail: batik-users-help@xml.apache.org
>>
>>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: batik-users-help@xml.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org
RE: Waiting for RenderingCompleted
Posted by Grant Mc Auley <gm...@som.llu.edu>.
> > Grant Mc Auley wrote:
> > > Thank you for your quick reply.
> > >
> > > I had already tried this (and just double checked it
> again) but the
> > > mutex apparently never gets notified, the thread waits
> indefinitely.
> > > That was why I was asking about how the GVTTreeBuilder
> > thread is related
> > > to the main thread. I have even tried spawning a thread
> > from the main
> > > thread and locking on the mutex from it, but it hangs also.
> >
> > Is 'notifyAll' getting called?
>
> No. It looks like the event does not even get fired. This
> is the state
> of the GVTTreeBuilder thread when the main thread is waiting (ie,
> mutex.wait() ):
>
> org.apache.batik.util.EventDispatcher
> org.apache.batik.swing.gvt.GVTTreeRenderer.fireEvent()
> org.apache.batik.swing.gvt.GVTTreeRenderer.run()
>
> When I do not use the mutex and use a breakpoint in
> renderingCompleted()
> I see this when stopped at the breakpoint:
>
> java.awt.EventQueue.postEventPrivate()
> java.awt.EventQueue.postEvent()
> java.awt.EventQueue.invokeAndWait()
> org.apache.batik.util.EventDispatcher
> org.apache.batik.swing.gvt.GVTTreeRenderer.fireEvent()
> org.apache.batik.swing.gvt.GVTTreeRenderer.run()
>
> So, somehow the waiting main thread seems to prevent the
> posting of the
> event from the TreeBuilder thread.
>
> >
> > The GVTTreeBuilder is a seperate thread but I believe it
> > notifies in the
> > AWT event thread.
> >
> > > Without the wait/notify the renderingCompleted() returns OK
> > and I can
> > > see the main thread wait()ing in my debugger. So it
> seems that the
> > > trouble is from the GVTTreeBuilder event handler end.
> >
> > Does it get into they sync blocks?
>
> It gets into the first, and the main thread waits. But as mentioned
> above, the event does not seem to get posted.
>
> A deadlock would occur if the AWT Event thread was wait()ing for the
> wait()ing main thread. I wonder if this occurs for applets. In other
> words, is the AWT Event thread suspended until init() returns?
OK, I put the the mutex in a thread spawned from the init() method.
This allows init() to return while the spawned thread wait()s on the
mutex and every thing works fine. Earlier, I had tried join()ing the
spawned thread to the main in the init() method, without success. So,
somehow it is necessary for init() to return.
Anyway, this will work for me. Thank you for your efforts and a great
list!
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org
RE: Waiting for RenderingCompleted
Posted by Grant Mc Auley <gm...@som.llu.edu>.
> -----Original Message-----
> From: Thomas DeWeese [mailto:Thomas.DeWeese@Kodak.com]
> Sent: Tuesday, September 09, 2003 6:12 PM
> To: Batik Users
> Subject: Re: Waiting for RenderingCompleted
>
>
> Grant Mc Auley wrote:
> > Thank you for your quick reply.
> >
> > I had already tried this (and just double checked it again) but the
> > mutex apparently never gets notified, the thread waits indefinitely.
> > That was why I was asking about how the GVTTreeBuilder
> thread is related
> > to the main thread. I have even tried spawning a thread
> from the main
> > thread and locking on the mutex from it, but it hangs also.
>
> Is 'notifyAll' getting called?
No. It looks like the event does not even get fired. This is the state
of the GVTTreeBuilder thread when the main thread is waiting (ie,
mutex.wait() ):
org.apache.batik.util.EventDispatcher
org.apache.batik.swing.gvt.GVTTreeRenderer.fireEvent()
org.apache.batik.swing.gvt.GVTTreeRenderer.run()
When I do not use the mutex and use a breakpoint in renderingCompleted()
I see this when stopped at the breakpoint:
java.awt.EventQueue.postEventPrivate()
java.awt.EventQueue.postEvent()
java.awt.EventQueue.invokeAndWait()
org.apache.batik.util.EventDispatcher
org.apache.batik.swing.gvt.GVTTreeRenderer.fireEvent()
org.apache.batik.swing.gvt.GVTTreeRenderer.run()
So, somehow the waiting main thread seems to prevent the posting of the
event from the TreeBuilder thread.
>
> The GVTTreeBuilder is a seperate thread but I believe it
> notifies in the
> AWT event thread.
>
> > Without the wait/notify the renderingCompleted() returns OK
> and I can
> > see the main thread wait()ing in my debugger. So it seems that the
> > trouble is from the GVTTreeBuilder event handler end.
>
> Does it get into they sync blocks?
It gets into the first, and the main thread waits. But as mentioned
above, the event does not seem to get posted.
A deadlock would occur if the AWT Event thread was wait()ing for the
wait()ing main thread. I wonder if this occurs for applets. In other
words, is the AWT Event thread suspended until init() returns?
>
> >>-----Original Message-----
> >>From: Thomas DeWeese [mailto:Thomas.DeWeese@Kodak.com]
> >>Sent: Tuesday, September 09, 2003 4:50 PM
> >>To: Batik Users
> >>Subject: Re: Waiting for RenderingCompleted
> >>
> >>
> >>Grant Mc Auley wrote:
> >>
> >>>I need to ensure that the UpdateManager and all SVG element
> >>
> >>are not null
> >>
> >>>and available before an Applet's init() method returns in the code
> >>>below. In other words, I need to delay init() from returning until
> >>>gvtRendingCompleted() is called.
> >>>
> >>>Does anybody have any suggestions on how I might
> accomplish this? I
> >>>have tried many approaches but to no avail. I am unclear about the
> >>>relationship between the GVTTreeBuilder thread and the main
> >>
> >>thread. Any
> >>
> >>>help with this would be much appreciated as I am facing a deadline.
> >>
> >> You need to setup a mutex and wait on it, you probably also want
> >>to check for failed/interrupted conditions:
> >>
> >>Object mutext = new Object;
> >> canvas.addGVTTreeRendererListener(new GVTTreeRendererAdapter() {
> >>public void gvtRenderingCompleted(GVTTreeRendererEvent e) {
> >> // . . .
> >>
> >> synchronized (mutext) {
> >> mutex.notifyAll();
> >> }
> >> }
> >>
> >>synchronized (mutext) {
> >> canvas.setDocument(doc);
> >> try {
> >> mutext.wait();
> >> catch(InterruptedException ie) {
> >> ie.printStackTrace();
> >> }
> >>}
> >>
> >>
> >>
> >>>
> >>>//----------------------------------------------------------------
> >>>
> >>>init() {
> >>>
> >>> File f = new File("file.svg");
> >>> canvas = new JSVGCanvas();
> >>> canvas.addGVTTreeRendererListener(new GVTTreeRendererAdapter() {
> >>>
> >>> public void gvtRenderingCompleted(GVTTreeRendererEvent e) {
> >>>
> >>> um = canvas.getUpdateManager();
> >>> element = doc.getElementByID("name");
> >>> . . .
> >>>
> >>> }
> >>>
> >>> });
> >>> canvas.setDocumentState(JSVGCanvas.ALWAYS_DYNAMIC);
> >>> String parser = XMLResourceDescriptor.getXMLParserClassName();
> >>> SAXSVGDocumentFactory factory = new
> SAXSVGDocumentFactory(parser);
> >>> doc = factory.createDocument(f.toURL().toString());
> >>> canvas.setDocument(doc);
> >>>
> >>> // delay goes here
> >>>
> >>>}
> >>>
> >>>//----------------------------------------------------------------
> >>>
> >>>
> >>>
> >>>
> >>
> >>------------------------------------------------------------
> ---------
> >>
> >>>To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
> >>>For additional commands, e-mail: batik-users-help@xml.apache.org
> >>>
> >>>
> >>
> >>
> >>
> >>
> >>------------------------------------------------------------
> ---------
> >>To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
> >>For additional commands, e-mail: batik-users-help@xml.apache.org
> >>
> >>
> >
> >
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
> > For additional commands, e-mail: batik-users-help@xml.apache.org
> >
> >
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: batik-users-help@xml.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org
Re: Waiting for RenderingCompleted
Posted by Thomas DeWeese <Th...@Kodak.com>.
Grant Mc Auley wrote:
> Thank you for your quick reply.
>
> I had already tried this (and just double checked it again) but the
> mutex apparently never gets notified, the thread waits indefinitely.
> That was why I was asking about how the GVTTreeBuilder thread is related
> to the main thread. I have even tried spawning a thread from the main
> thread and locking on the mutex from it, but it hangs also.
Is 'notifyAll' getting called?
The GVTTreeBuilder is a seperate thread but I believe it notifies in the
AWT event thread.
> Without the wait/notify the renderingCompleted() returns OK and I can
> see the main thread wait()ing in my debugger. So it seems that the
> trouble is from the GVTTreeBuilder event handler end.
Does it get into they sync blocks?
>>-----Original Message-----
>>From: Thomas DeWeese [mailto:Thomas.DeWeese@Kodak.com]
>>Sent: Tuesday, September 09, 2003 4:50 PM
>>To: Batik Users
>>Subject: Re: Waiting for RenderingCompleted
>>
>>
>>Grant Mc Auley wrote:
>>
>>>I need to ensure that the UpdateManager and all SVG element
>>
>>are not null
>>
>>>and available before an Applet's init() method returns in the code
>>>below. In other words, I need to delay init() from returning until
>>>gvtRendingCompleted() is called.
>>>
>>>Does anybody have any suggestions on how I might accomplish this? I
>>>have tried many approaches but to no avail. I am unclear about the
>>>relationship between the GVTTreeBuilder thread and the main
>>
>>thread. Any
>>
>>>help with this would be much appreciated as I am facing a deadline.
>>
>> You need to setup a mutex and wait on it, you probably also want
>>to check for failed/interrupted conditions:
>>
>>Object mutext = new Object;
>> canvas.addGVTTreeRendererListener(new GVTTreeRendererAdapter() {
>>public void gvtRenderingCompleted(GVTTreeRendererEvent e) {
>> // . . .
>>
>> synchronized (mutext) {
>> mutex.notifyAll();
>> }
>> }
>>
>>synchronized (mutext) {
>> canvas.setDocument(doc);
>> try {
>> mutext.wait();
>> catch(InterruptedException ie) {
>> ie.printStackTrace();
>> }
>>}
>>
>>
>>
>>>
>>>//----------------------------------------------------------------
>>>
>>>init() {
>>>
>>> File f = new File("file.svg");
>>> canvas = new JSVGCanvas();
>>> canvas.addGVTTreeRendererListener(new GVTTreeRendererAdapter() {
>>>
>>> public void gvtRenderingCompleted(GVTTreeRendererEvent e) {
>>>
>>> um = canvas.getUpdateManager();
>>> element = doc.getElementByID("name");
>>> . . .
>>>
>>> }
>>>
>>> });
>>> canvas.setDocumentState(JSVGCanvas.ALWAYS_DYNAMIC);
>>> String parser = XMLResourceDescriptor.getXMLParserClassName();
>>> SAXSVGDocumentFactory factory = new SAXSVGDocumentFactory(parser);
>>> doc = factory.createDocument(f.toURL().toString());
>>> canvas.setDocument(doc);
>>>
>>> // delay goes here
>>>
>>>}
>>>
>>>//----------------------------------------------------------------
>>>
>>>
>>>
>>>
>>
>>---------------------------------------------------------------------
>>
>>>To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
>>>For additional commands, e-mail: batik-users-help@xml.apache.org
>>>
>>>
>>
>>
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
>>For additional commands, e-mail: batik-users-help@xml.apache.org
>>
>>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: batik-users-help@xml.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org
RE: Waiting for RenderingCompleted
Posted by Grant Mc Auley <gm...@som.llu.edu>.
Thank you for your quick reply.
I had already tried this (and just double checked it again) but the
mutex apparently never gets notified, the thread waits indefinitely.
That was why I was asking about how the GVTTreeBuilder thread is related
to the main thread. I have even tried spawning a thread from the main
thread and locking on the mutex from it, but it hangs also.
Without the wait/notify the renderingCompleted() returns OK and I can
see the main thread wait()ing in my debugger. So it seems that the
trouble is from the GVTTreeBuilder event handler end.
> -----Original Message-----
> From: Thomas DeWeese [mailto:Thomas.DeWeese@Kodak.com]
> Sent: Tuesday, September 09, 2003 4:50 PM
> To: Batik Users
> Subject: Re: Waiting for RenderingCompleted
>
>
> Grant Mc Auley wrote:
> > I need to ensure that the UpdateManager and all SVG element
> are not null
> > and available before an Applet's init() method returns in the code
> > below. In other words, I need to delay init() from returning until
> > gvtRendingCompleted() is called.
> >
> > Does anybody have any suggestions on how I might accomplish this? I
> > have tried many approaches but to no avail. I am unclear about the
> > relationship between the GVTTreeBuilder thread and the main
> thread. Any
> > help with this would be much appreciated as I am facing a deadline.
>
> You need to setup a mutex and wait on it, you probably also want
> to check for failed/interrupted conditions:
>
> Object mutext = new Object;
> canvas.addGVTTreeRendererListener(new GVTTreeRendererAdapter() {
> public void gvtRenderingCompleted(GVTTreeRendererEvent e) {
> // . . .
>
> synchronized (mutext) {
> mutex.notifyAll();
> }
> }
>
> synchronized (mutext) {
> canvas.setDocument(doc);
> try {
> mutext.wait();
> catch(InterruptedException ie) {
> ie.printStackTrace();
> }
> }
>
>
> >
> >
> > //----------------------------------------------------------------
> >
> > init() {
> >
> > File f = new File("file.svg");
> > canvas = new JSVGCanvas();
> > canvas.addGVTTreeRendererListener(new GVTTreeRendererAdapter() {
> >
> > public void gvtRenderingCompleted(GVTTreeRendererEvent e) {
> >
> > um = canvas.getUpdateManager();
> > element = doc.getElementByID("name");
> > . . .
> >
> > }
> >
> > });
> > canvas.setDocumentState(JSVGCanvas.ALWAYS_DYNAMIC);
> > String parser = XMLResourceDescriptor.getXMLParserClassName();
> > SAXSVGDocumentFactory factory = new SAXSVGDocumentFactory(parser);
> > doc = factory.createDocument(f.toURL().toString());
> > canvas.setDocument(doc);
> >
> > // delay goes here
> >
> > }
> >
> > //----------------------------------------------------------------
> >
> >
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
> > For additional commands, e-mail: batik-users-help@xml.apache.org
> >
> >
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: batik-users-help@xml.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org
Re: Waiting for RenderingCompleted
Posted by Thomas DeWeese <Th...@Kodak.com>.
Grant Mc Auley wrote:
> I need to ensure that the UpdateManager and all SVG element are not null
> and available before an Applet's init() method returns in the code
> below. In other words, I need to delay init() from returning until
> gvtRendingCompleted() is called.
>
> Does anybody have any suggestions on how I might accomplish this? I
> have tried many approaches but to no avail. I am unclear about the
> relationship between the GVTTreeBuilder thread and the main thread. Any
> help with this would be much appreciated as I am facing a deadline.
You need to setup a mutex and wait on it, you probably also want
to check for failed/interrupted conditions:
Object mutext = new Object;
canvas.addGVTTreeRendererListener(new GVTTreeRendererAdapter() {
public void gvtRenderingCompleted(GVTTreeRendererEvent e) {
// . . .
synchronized (mutext) {
mutex.notifyAll();
}
}
synchronized (mutext) {
canvas.setDocument(doc);
try {
mutext.wait();
catch(InterruptedException ie) {
ie.printStackTrace();
}
}
>
>
> //----------------------------------------------------------------
>
> init() {
>
> File f = new File("file.svg");
> canvas = new JSVGCanvas();
> canvas.addGVTTreeRendererListener(new GVTTreeRendererAdapter() {
>
> public void gvtRenderingCompleted(GVTTreeRendererEvent e) {
>
> um = canvas.getUpdateManager();
> element = doc.getElementByID("name");
> . . .
>
> }
>
> });
> canvas.setDocumentState(JSVGCanvas.ALWAYS_DYNAMIC);
> String parser = XMLResourceDescriptor.getXMLParserClassName();
> SAXSVGDocumentFactory factory = new SAXSVGDocumentFactory(parser);
> doc = factory.createDocument(f.toURL().toString());
> canvas.setDocument(doc);
>
> // delay goes here
>
> }
>
> //----------------------------------------------------------------
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: batik-users-help@xml.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org