I tried to do the following with no success (no visible change to
JSVGcanvas):
     rq.invokeLater(new Runnable()
     {
        public void run()
        {
           elem1.setAttribute("style","fill:red;display:inline;opacity:2;");
        }
     });

I also tried invokeAndWait but I got an error:
java.lang.IllegalStateException: cannot be called  from RunnableQueue thread


Another related (may be unrelated) question--do we need to mess with GVT to
change DOM?



----- Original Message -----
From: "Thomas E Deweese" <[EMAIL PROTECTED]>
To: "Batik Users" <[EMAIL PROTECTED]>; "Danh Hoai"
<[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Monday, May 06, 2002 12:31 PM
Subject: repaint


> >>>>> "DH" == Danh Hoai <[EMAIL PROTECTED]> writes:
>
> DH> We are running into a similar problem.  Can you elaborate on how
> DH> you got your case to work.
> >> JSVGCanvas canvas = ...
> >> canvas.setDocumentState(JSVGCanvs.ALWAYS_DYNAMIC);
> >>
> >> import org.apache.batik.bridge.UpdateManager; import
> >> org.apache.batik.util.RunnableQueue;
> >>
> >> UpdateManager um = canvas.getUpdateManager(); RunnableQueue rq =
> >> um.getUpdateRunnableQueue(); rq.invokeLater(new Runnable() { public
> >> void run() { /*...*/ } }); rq.invokeAndWait(new Runnable() { public
> >> void run() { /*...*/ } });
>
>
> DH> Specifically, where do you make the change to DOM.  Is it done
> DH> inside the run()
>
>     Yes you make your changes inside the run method of the
> runnable you pass to either invokeLater or invokeAndWait.
>
> >> rq.invokeLater(new Runnable() { public void run() { /*...*/ } });
> >> rq.invokeAndWait(new Runnable() { public void run() { /*...*/ } });
>
> DH> Do we need to invoke both methods?
>
>     No, pick one.
>
> DH> Also, how do methods invokeAndWait and invokeLater work? do they
> DH> invoke after the change inside the DOM?
>
>     InvokeAndWait will not return until the change has been made in
> the DOM.  InvokeLater will return 'immediately' usually before your
> change as been made to the DOM (this of course is left to the vagures
> of thread scheduling in the JDK).
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to