Jogl and SWT

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

Jogl and SWT

ul
I'm considering a switch from C++ to Java and it looks like my best option is to use Jogl with SWT,

http://forum.jogamp.org/Jogl-and-JavaFX-td4030720.html#a4030774

So my question now is how well supported is Jogl on SWT? What is there to think about?
Reply | Threaded
Open this post in threaded view
|

Re: Jogl and SWT

gouessej
Administrator
Hi

You can use JOGL with Swing and SWT. Swing is better supported in JOGL than SWT but SWT has been improved as time goes by and we have a dedicated contributor for it. I used SWT (+ Eclipse RCP) with JOGL by using the AWT SWT bridge for years; now you have a lot more options, you can use the heavyweight JOGL SWT canvas or NewtCanvasSWT.

Actually, JOGL isn't the problem. If you switch from C++, rather spend much time in choosing the GUI API that fits the best into your needs. Eclipse RCP + SWT and Netbeans Platform + Swing have pros and cons. It depends on what you would like to do. Memory management is less painful and the APIs are a lot more flexible with Netbeans Platform + Swing, there are a lot of tutorials about Swing but a few good ones about Netbeans Platform whereas the community using Eclipse RCP seems larger than the one using Netbeans Platform. SWT heavily relies on the OS which can be really good for native integration but very time consuming for cross-platform development. SWT is less reliable than Swing under Unix and GNU Linux, some bugs have never been fixed whereas they have been reported more than 7 years ago, for example in the drag and drop of images. Good luck.
Julien Gouesse | Personal blog | Website
ul
Reply | Threaded
Open this post in threaded view
|

Re: Jogl and SWT

ul
This post was updated on .
Thank you.

If I have the basics right AWT and SWT are widget toolkits. The main differences are that AWT is core Java whereas SWT is part of the Eclipse infrasstructure, and that AWT draws its own widgets whereas SWT utilizes native widgets if available. Swing and JFace are UI toolkits on top of AWT and SWT respectively.

There's also the new Java GUI technology called JavaFX and that would've been my first choise had it only supported OpenGL. I know JavaFX has a 3D module which probably is just old Java3D in disguise. And I have a problem with Java3D because it really never got beyond the "proof of concept" phase so I would like a fallback to OpenGL but it's not supported by JavaFX and most likely never will as it seems.

So appearantly it boils down to either Swing/AWT or Jface/SWT.

Now my beef with Swing is  that from what I've heard it has been deprecated (or at least put in a dark corner) in favour of JavaFX. JFace/SWT on the other hand will stay fully supported and current since it's the cornerstone of Eclipse. For this reason it seems like a better choise.

On yet another hand I would like a good 3D render and jMonkeyEngine seems an appealing choise since it's shader based. I get the impression though that the jMonkeyEngine developers may favour Swing/AWT,

http://hub.jmonkeyengine.org/wiki/doku.php/sdk:whynoteclipse

This link states they prefer the Netbeans IDE over the Eclipse IDE but it gives me the feeling it may spill over to also mean they favour Swing/AWT over JFace/SWT and that the former therefore would be better supported.

Well, since both Jogl and jMonkeyEngine seem to favour Swing/AWT I'll reconsider using it. Is this a free fantasy I'm having or may there be something to it? Finally I'm not quite sure how Newt enters the picture but since it seems to exist both for AWT and SWT it probably doesn't matter at this stage of my decision process.
Reply | Threaded
Open this post in threaded view
|

Re: Jogl and SWT

gouessej
Administrator
SWT has an "uncommon" way of managing memory, some resources have to be managed by the developer.

JMonkeyEngine is nice for games but if you really need a solid integration in Eclipse RCP / JFace / SWT or in Netbeans Platform / Swing / AWT, rather use Ardor3D (even though it is less documented and it has a smaller community). JMonkeyEngine is mainly designed for games or applications within a single screen whereas Ardor3D is mainly designed for applications even though it can be used for games.

Swing is far from being deprecated but it's "frozen", in maintenance mode.
Julien Gouesse | Personal blog | Website
ul
Reply | Threaded
Open this post in threaded view
|

Re: Jogl and SWT

ul
Hi,

I've used the word "deprecated" because it's how the Swing situation is described in a bug report you linked to in another thread,

https://jogamp.org/bugzilla/show_bug.cgi?id=607

But regardless, I think Oracle has signalled clearly enougth that JavaFX is the future and Swing is the past. If only JavaFX had supported OpenGL I would've gone for that right away but since it doesn't the decision to switch from C++ to Java is less clearcut.

Ardor3D seems to be a continuation of the old jMonkeyEngine design of 2008, whereas jMonkeyEngine 3 is a completely new shader oriented design. Spontaneously I like the latter because it represents the future of OpenGL but I'll have a close look at Ardor3D too.

I'm aware of the memory managegement issues with SWT and it detracts somewhat from the advantages of Java. This and the fact that Swing/AWT is core Java makes me reconsider that to be my best option.
Reply | Threaded
Open this post in threaded view
|

Re: Jogl and SWT

gouessej
Administrator
ul wrote
Ardor3D seems to be a continuation of the old jMonkeyEngine design of 2008, whereas jMonkeyEngine 3 is a completely new shader oriented design. Spontaneously I like the latter because it represents the future of OpenGL but I'll have a close look at Ardor3D too.
It is a bit more complicated than that. I have used JMonkeyEngine since 2008, especially JMonkeyEngine 2 and after that a little bit JMonkeyEngine 3. In my humble opinion, JMonkeyEngine 2 was very buggy and the problem wasn't only the general design or the renderers. That's why I stopped using JMonkeyEngine 2 and I started to use Ardor3D which has some similarities with JMonkeyEngine 2 as its main developer is a former main developer of JMonkeyEngine but its design is a lot more flexible, this flexibility is useless most of the time for games but not for applications. Ardor3D 1 doesn't have a fully shader based pipeline but this will be different for Ardor3D 2 and anyway, I already plan to support forward compatible contexts in Ardor3D 1.x, probably in another minor release. JMonkeyEngine 3 is more reliable than JMonkeyEngine 2 and it is a bit less painful to use in applications as you can use a canvas and put it into your application but I still recommend it only for games. The main problem with Ardor3D is the lack of documentation despite tens of examples in the official repository.

ul wrote
I'm aware of the memory management issues with SWT and it detracts somewhat from the advantages of Java. This and the fact that Swing/AWT is core Java makes me reconsider that to be my best option.
You can even use fully hardware accelerated Swing thanks to GLG2D.
Julien Gouesse | Personal blog | Website