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 sh...@agilent.com on 2003/05/05 20:56:33 UTC

RunnableQueue question

Hi All,
	From time to time, I run into an IllegalStateException (error message: "RunnableQueue not started or has exited") when trying to use the RunnableQueue associated with JSVGCanvas's UpdateManager.  After taking a look at the source code of RunnableQueue, I amended my code to the following:

		    RunnableQueue rq = um.getUpdateRunnableQueue();
                if(rq.getThread() == null)
                    rq.run();

                rq.invokeLater(runnableTask);


(Where "um" is an instance of UpdateManager.)


I'm just wondering if calling run() on the RunnableQueue is the right thing to do to get around the "Illegal state" error?  Thanks in advance!

-Shawn

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


how to suspend mouse events (but not DOM update events) on a JSVGCanvas?

Posted by William Billingsley <wh...@cam.ac.uk>.
Hi,

I'm a newbie asking a hopefully trivial question...

I'm putting together a drawing applet for creating very simple static SVG
diagrams.  I have registered a mouse input listener (java.awt.event.*) on
the JSVGCanvas so that the Applet can allow the user to draw on the canvas.
This is working fine, but I have noticed that occasionally mouse events are
not being caught, and the cursor shape changes as it moves over elements
within the SVG, so existing mouse listeners for interactivity of the objects
must be catching some of the mouse events.  I need to be able to switch
these pre-existing mouse listeners on and off depending on whether I am in
"draw" mode or "select" mode, but leave the DOM update listeners always on.
I can't seem to find any public methods on the JSVGCanvas that would suspend
mouse interactions but not DOM update events.  (Or am I misreading some of
the Javadoc?).

cheers,
Will Billingsley.


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


Re: RunnableQueue question

Posted by Thomas E Deweese <th...@kodak.com>.
Hi Shawn,

   I would definately say you are treating a symptom not the problem.
You probably need to register listeners so you get notified when the
update manager is fully up and running (and get notified when it has
been shut down). 

   'Jump starting' the runnable queue is likely to do "bad things".

>>>>> "GWJ" == G Wade Johnson <wa...@abbnm.com> writes:

GWJ> I saw this problem several times when I executed this code before
GWJ> the document was completely loaded/parsed/rendered.

GWJ> Once I corrected my code, I haven't seen this issue again.

GWJ> G. Wade

GWJ> shawn_hwang@agilent.com wrote:
>>  Hi All, From time to time, I run into an IllegalStateException
>> (error message: "RunnableQueue not started or has exited") when
>> trying to use the RunnableQueue associated with JSVGCanvas's
>> UpdateManager.  After taking a look at the source code of
>> RunnableQueue, I amended my code to the following:
>> 
>> RunnableQueue rq = um.getUpdateRunnableQueue(); if(rq.getThread()
>> == null) rq.run();
>> 
>> rq.invokeLater(runnableTask);
>> 
>> (Where "um" is an instance of UpdateManager.)
>> 
>> I'm just wondering if calling run() on the RunnableQueue is the
>> right thing to do to get around the "Illegal state" error?  Thanks
>> in advance!
>> 
>> -Shawn
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org For
>> additional commands, e-mail: batik-users-help@xml.apache.org

GWJ> ---------------------------------------------------------------------
GWJ> To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
GWJ> 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: RunnableQueue question

Posted by "G. Wade Johnson" <wa...@abbnm.com>.
I saw this problem several times when I executed this code before the
document was completely loaded/parsed/rendered.

Once I corrected my code, I haven't seen this issue again.

G. Wade

shawn_hwang@agilent.com wrote:
> 
> Hi All,
>         From time to time, I run into an IllegalStateException (error message: "RunnableQueue not started or has exited") when trying to use the RunnableQueue associated with JSVGCanvas's UpdateManager.  After taking a look at the source code of RunnableQueue, I amended my code to the following:
> 
>                     RunnableQueue rq = um.getUpdateRunnableQueue();
>                 if(rq.getThread() == null)
>                     rq.run();
> 
>                 rq.invokeLater(runnableTask);
> 
> (Where "um" is an instance of UpdateManager.)
> 
> I'm just wondering if calling run() on the RunnableQueue is the right thing to do to get around the "Illegal state" error?  Thanks in advance!
> 
> -Shawn
> 
> ---------------------------------------------------------------------
> 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