[prev in list] [next in list] [prev in thread] [next in thread] 

List:       batik-users
Subject:    Re: More on the JSVGCanvas's RunnableQueue...
From:       Cameron McCormack <cam () mcc ! id ! au>
Date:       2006-12-14 22:59:29
Message-ID: 20061214225929.GB3287 () arc ! mcc ! id ! au
[Download RAW message or body]

Hi Michael.

Bishop, Michael W. CONTR J9C880:
> OK, so we've covered that this RunnableQueue/UpdateManager is not
> available until you get the "GVT Rendering Complete" event.  How do you
> know when the RunnableQueue is about to become "not" available?  Is
> there an equivalent listener that lets you know that the
> UpdateManager/RunnableQueue is going away?

Yes you can add a listener to the UpdateManager to be informed about its
state:

  UpdateManagerListener l = new UpdateManagerAdapter() {
      public void managerStopped(UpdateManagerEvent e) {
          // code in here is run just after the queue is stopped
      }
  };
  um.addUpdateManagerListener(l);

or you could just listen for the SVGUnload DOM event dispatched to the
document.

> My case is that I have events coming in from an XMPP client that update
> the document in the JSVGCanvas.  While these events are coming in, it's
> possible that the user will switch pages to another document, causing
> the tree to re-render.  On occasion, I receive NPEs or an error message
> stating the "RunnableQueue is stopping or has exited...".
> 
>  
> 
> I tried to amend this by stopping the processing of events when I
> receive the "GVT Rendering Started" event.  I then start processing
> events when I get the "GVT Rendering Complete" event.  It's not early
> enough.  How can I tell when I need to pause my XMPP event queue?

I reckon try the SVGUnload event first: it should be sufficient.

-- 
Cameron McCormack, http://mcc.id.au/
	xmpp:heycam@jabber.org  ▪  ICQ 26955922  ▪  MSN cam@mcc.id.au

---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic