pre9 to pre11 question...

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

pre9 to pre11 question...

ThomasR
Is the EventDispatchThread being used somewhere in the initialization of JOGL and/or Java3D in pre11 where it wasn't
before in pre9?  My assumption has been, and perhaps this is incorrect, that we could start Java3D and have it render off the swing thread so as not to freeze up the gui.  My application is behaving a little different, working very well, but also seems slower, when I moved from pre9 to pre11.
Reply | Threaded
Open this post in threaded view
|

Re: pre9 to pre11 question...

gouessej
Administrator
Hi

I really doubt that Java3D is to blame as there were only a few changes between pre9 and pre11. Some operations must be performed on the Swing event dispatch thread anyway.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: pre9 to pre11 question...

ThomasR
Hi Julien,

Thanks for your reply.  It's a damn waitCursor problem, such a PITA in Swing.  This used to work:
(1) on EDT set cursor to wait
(2) start a SwingWorker do some heavy processing, start Java3D, render
(3) done back on EDT set cursor to default.  Show the results in a new Window

But if Java3D/JOGL perform operation on the EDT, the wait cursor might get interrupted which is
happening now, some subtle change from pre9 to pre11 has shown me I can't do it this way. So
it's my problem.  How do you handle this sort of thing?

Tom
Reply | Threaded
Open this post in threaded view
|

Re: pre9 to pre11 question...

gouessej
Administrator
Maybe this tip can work in your case:
http://www.javaworld.com/article/2077590/learn-java/java-tip-87--automate-the-hourglass-cursor.html

If you set the wait cursor just before performing a long task on the AWT EDT, sometimes AWT will try to treat both operations in the same cycle and you won't see your wait cursor.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: pre9 to pre11 question...

ThomasR
Hi Julien,

Thanks for the tip... I'll take a look.  Does jogl or java3d use SwingUtil.invokeLater or invokeAndWait anywhere?

Tom
Reply | Threaded
Open this post in threaded view
|

Re: pre9 to pre11 question...

gouessej
Administrator
Hi

JOGL uses invokeAndWait and invokeLater:
https://github.com/sgothel/jogl/blob/master/src/jogl/classes/com/jogamp/opengl/awt/GLCanvas.java#L1563

However, Java3D uses its own canvases even though they are based on JOGL, i.e Java3D doesn't use GLCanvas and GLJPanel. Maybe Harvey can confirm whether or not it uses invokeAndWait and invokeLater.
Julien Gouesse | Personal blog | Website