xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Danh Hoai" <h...@indent.org>
Subject Re: repaint
Date Mon, 06 May 2002 16:59:50 GMT
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" <thomas.deweese@kodak.com>
To: "Batik Users" <batik-users@xml.apache.org>; "Danh Hoai"
<hoai@indent.org>
Cc: <michiel@microweb.nl>; <thomas.deweese@kodak.com>
Sent: Monday, May 06, 2002 12:31 PM
Subject: repaint


> >>>>> "DH" == Danh Hoai <hoai@indent.org> 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: 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


Mime
View raw message