• Welcome to OS2World OLD-STATIC-BACKUP Forum.
 

News:

This is an old OS2World backup forum for reference only. IT IS READ ONLY!!!

If you need help with OS/2 - eComStation visit http://www.os2world.com/forum

Main Menu

SWTSwing alternative way to use applications using SWT (e.g. Azureus, Eclipse)?

Started by magog, 2007.07.17, 18:14:53

Previous topic - Next topic

magog

Hi!

Last week I've found the project SWTSwing at http://swtswing.sourceforge.net/.
The goal of this project is to implement the SWT GUI-Framework using standard Swing components.

First I will lay things out for you and then I'll post a message from Christopher Deckers the main person behind SWTSwing. Before I talked to Christopher I got in contact with Dieter Krachtus who is working together with Christopher on the Eclipse on Swing project (EoS; http://eos.sourceforge.net/).
I got an older SWTSwing version from him, so I could execute the Paint example (see EoS website) on eComStation. After I got that working I began to spent some time with the Azureus code and created my own Azureus build. Together with the help of Retroweaver, which adds some functionality that has been missing in Java 1.4 but is available in Java 1.5 and Dieter's SWTSwing version I was able to start Azureus on eComStation. I even got to the main window (at the first tests it did stop at the end of the splash screen).
Here is a picture of Azureus running on eCS 2.0rc1 (I did post this 3 days ago at OS2.org - german discussion forum):

You can get the full sized version here: http://www.juergen-ulbts.de/Sonstiges/Java/AzureusSWTSwing/Azureus2504_on_eCS20_using_older_SWTSwing-Lib.jpg
The application itself is not usable (see error messages in the background 4OS2 command line window)

So we are now back on the SWTSwing topic
Why is this project so important for us?

  • SWT is used for two applications everyone know...Azureus (Bittorrent Client) and of course Eclipse (Integrated development IDE for Java, C,...).
  • SWT has to be ported to every target platform (for example eComStation and OS/2)!
  • We currently don't have a working SWT port on eComStation and OS/2!

Ok, we don't have a working SWT port but there is work in progress. The push the project became last year did came to a stop around December 2006 and seems to be re-actived since about 5 weeks. Before we see a working SWT port there is still a lot work that needs to be done if it will be finished ever.

If you look at the wxWidget developers that are working for years now and what problems they still have you might get an idea how hard it is with very limited resources to get it working. Currently the wxWidget guys have problems with GCC 3.3.5 and also Open Watcom. Open Watcom doesn't support the required C functionality and it's the same with GCC. wxWidget is using more and more Unicode which is also causing problems. The other GUI Framework is Qt, we have a working Qt port, but it's also outdated (current eCS and OS/2 version is 3.3.1 and it's not a complete port - http://svn.netlabs.org/qt3; Trolltech is currently using version 4.3.0 - http://trolltech.com/developer/downloads/qt/windows).

I can't blame any developer working on the stuff above. They are working on it in their free time and they don't get paid for it...ok the qt3 development may be supported a little bit by netlabs.org. Maybe Adrian might tell us something if we ask.


SWTSwing seems to be very far in it's development as you can see when you look at the screenshots on the website. SWTSwing uses standard Swing that is part of Java since version 1.2 (was an additional package in Java 1.1.8 but maybe only because of IBM)
I don't know how many people beside Christopher and Dieter are working on SWTSwing, but what they did create so far is incredible!


Great so we can use SWTSwing to get applications running that require SWT?

No that's unfortunatley not possible because of two reasons:

  • SWTSwing is currently not Java 1.4 compatible, and we don't have access to newer versions of Java on eCS and OS/2
  • The application that's using SWT also has to be compatible with Java 1.4 as well

It may be possible to get them involved to add Java 1.4 compatible checks but we may need some developers that could work on this project. Even some users testing it would be VERY HELPFUL.
Another motivation might me our Bounty system!
I hope you all hear me. :)


I asked Christoper a few questions and this is what he said...
Quote
Hi Juergen,

Well, I knew this compatibility discussion was to come up some day.
Maybe discussing it further may help me find a solution.

A bit of background first. SWTSwing is quite a challenging project:
SWT is a moving target, and has a lot of advanced native-like
features. It brings competition to Swing, so Swing usually tries to
follow whatever SWT has, but of course with the delay implied by
waiting for a new JRE. This is why, to achieve a most complete
coverage of the SWT API, I need the latest official JRE. To give a few
examples:
- Absolute mouse location at any time (java 5)
- System tray support (java 6)
- Irregular shaped windows (planned for Java 7, I am waiting for it)

Compatibility concerns two aspects: using new constructs (generics,
enums) that imply a certain bytecode version, and the use of methods
from certain JREs.
Keeping track of compatibility is a really hard task. I did that
several times in the past and I know the various issues around it.
This is why I originaly decided that SWTSwing's goal would be to cover
a maximum of SWT, rather than supporting legacy JREs. On the other
hand, I knew there would be a need for these legacy JREs, so I set the
binary compatibility to Java 1.4, and never use 5.0+ constructs. This
allows an easer backporting of SWTSwing to earlier JRE versions by
external parties.


> After that I also tried to get Azureus working using the SWTSwing version from
> the Paint.jar. I recompiled Azureus for Java 1.5 and used Retroweaver to patch
> the bytecode to make it mostly Java 1.4 compatible.

I thought Retroweaver would just downgrade new Java 5 constructs to
Java 1.4. Since I use Java 1.4 compatibility, where does Retroweaver
help?


> Dieter told me that the old compatibility with Java 1.5 has been removed from
> the current SWTSwing code.

It is not that it was removed, it is just that I could finally
implement more of SWT using Java 6, and get big applications like
Eclipse to work better.

> Is there any chance to get Java 1.4 compatibility back into SWTSwing.

Well, I have to do a bit of downgrades for Java 5 compatibility at
least. That means, as long as you don't use certain SWT calls that
definitely require a Java 6 API, the program would not break. Now,
what would happen if you launch a program that does call such API
(like Azureus using the system tray)? There are two approaches: let
the program break, which means SWTSwing would be useful for programs
making the checks themselves, or handle those cases to return default
values. The latter requires compatibility checks in the code itself,
or special downgraded releases of SWTSwing.

> Dieter is
> currently thinking about this and maybe he has already an idea.
> I would say a parameter like "-Dswt.swing.java=1.4" but maybe it's sometimes
> easier to at a try..catch around Java method calls to catch
> "java.lang.NoSuchMethodError" and execute a Java 1.4 compatible call if
> available (for example usefull for the "setLocationByPlatform()" method call -
> only used in two *.java files right now).

The version you have may be enough for a paint application, but can't
run Eclipse properly. I put a lot of work in what's currently in CVS,
and there are probably far more calls that require a later JRE.

> Having SWTSwing working on eComStation would be appreciated by a lot of people
> as we don't have a native SWT implementation (even if the work on a port has
> been restarted recently).
> Currently we can't use a great applications like Eclipse, Azureus and other
> popular Java applications. A Java 1.4 compatible version SWTSwing would be very
> helpfull to make those applications work.

Now we touch the important aspect of this issue: to know if
compatibility handling is worth the trouble. I would love to learn
more about who still use OS/2, or Java 1.4, and evaluate if I should
spend some time on this support or let that to external parties.
I originaly mentioned to Dieter having AOP using external pointcut
definitions in order to avoid damaging the code with compatibility
checks, but I know it would not solve all the cases.

If you can give me more insight as to where such compatilibity would
be useful, and if you are willing to help testing a few dev versions
in case I implement anything, then I may handle it in the code itself.
In the meantime I will think about it to try to find a clean solution
in case I decide to go for it.

Cheers,
-Christopher
Regards,
Juergen
*** Java Movie Database - http://www.jmdb.de/

magog

Hi!

Come on guys, is nobody interested in Eclipse, Azureus, RSSOwl and Hibiscus (based on the Jameica Framework) which all use SWT?

I can't believe that!


To make the above applications working on OS/2 and eCS there is a little bit more work involved than just gettting SWTSwing compatible with Java 1.4 but we are get from 0% to 80% with SWTSwing. You can see how far I already got with limited Java 1.4 support Christopher Deckers was kind enough to add to the current SWTSwing version. With basically 24 hours of work spent on Azureus and Jameica (for Hibiscus) I was able to get those screenshots.

I think it's worth it as long as we don't have a native SWT library (which we maybe never get).
So please post some comments!

I'm going to propose the SWTSwing project as bounty shortly...


In the meantime here is a screenshot of Hibiscus running inside the Jameica framework.
Hibiscus is an application to manage you bank account and comparable to Moneyplex (which may only known by German OS/2 users). Matrica the developer of Moneyplex turned their back on the OS/2 customers a while back and only provides Linux, Windows and I think Mac with new versions of Moneyplex.
An application to manage your bank account is critical and there are only two applications that could be used on OS/2 and eCS. Hibiscus is one of them and the other one is Moneydance.
If you want to know more about Hibiscus and Jameica you have to read the german description:
http://www.willuhn.de/projects/jameica/

For a full-screen image click the following link:
http://www.juergen-ulbts.de/Sonstiges/Java/JameicaSWTSwing/Jameica15_on_eCS20_01.jpg

Hibiscus running inside the SWT based Jameica framework:

Regards,
Juergen
*** Java Movie Database - http://www.jmdb.de/

DavidG

Presently OpenWatcom is broken.  It fails to copy the resident names table and the iterated pages.  Steven Levine is working on patching this since FM/2 has moved to OpenWatcom.   Once WRC is repaired (hopefully in OpenWatcom 1.7), FM/2 will switch from RC.EXE to WRC.EXE.  The OS/2 libraries appear to work fine.  As you stated, there are some problems with OpenWatcom.  The point being that the missing C libraries won't be done unless someone steps forward to do them for the OpenWatcom project.  It makes me wonder why none of the Linux people have stepped forward to do this?

What we need is a Java 1.5.  But again unless someone or someones steps forward, this will never happen.  I would gladly pay for a working Java 1.5.

Is SWT important.  I think it is even though I know very little about it except for what you posted here.

cytan

 :-\

I really don't like java apps, however, the stuff I need at work requires java 1.5 which is a real bummer because
I have to run SVista with NT (!) to run the java stuff.

I know nothing about SWTSwing so I really cannot comment. But getting 1.5 for OS/2 is important to me and I
can put some money into the bounty if that is what is required to get this going.

cytan

magog

Ok, the last call seems to have worked.  ;D

Yes, we need a newer Java version but unfortunatly that is currently a no go.
Java 1.5 is already "old" and with Sun having released Java finally as "real" open source (the sources where already available before) it makes sense to focus on the latest version.
I've already asked Gregory Shah/Eric Faulhaber from Golden Code if they would donate some of their code to speed things up, but they don't want to do that right now. The original quote from Eric Faulhaber was:
Quote"We will *consider* any idea, but frankly, this is unlikely. The J2SE port was unbelievable costly for us."!

Maybe they would offer some of their code (JSound, Threading, JNI) when there would be some activity to port the lastest version.

To get back on topic with SWTSwing...I know most people don't know (or don't care) what SWT is and what it is good for.
Basically all you really need to know is, that some applications use it.
I think I've named the most important apps. I also know some OS/2 users who would like to see Eclipse running on OS/2. As a developer it's VERY important for me.
Maybe SWTSwing would also help the native SWT development and vice versa. Some native calls not covered in Java 1.4 could be used in SWTSwing when they are implemented in a native SWT port for example.

I've just sent some info about SWTSwing to the Bounty keeper. Let's see what happens.


@cytan: Is it a free java app you use at work? Maybe you can tell me the name and I take a look.
With retroweaver some things can be run with Java 1.4 even if compiled for Java 1.5.

@David Graser: I'm looking forward to see some progress with OW as I've used it for some JNI (Java Native Interface) stuff in the past. I definately like it more then GCC.
Regards,
Juergen
*** Java Movie Database - http://www.jmdb.de/

cytan

Hi Juergen,
   Thanks for the offer. The Java programmes are inhouse and so I cannot send it to you.

cytan

magog

I just released the updated Eclipse Enabler package to v1.1.0 (2007-10-03).
Eclipse is starting much faster now!!

I also hope to get the special Azureus build out today.
UPDATE
Later yesterday evening I finished the first Azureus4eCS v0.1.0 (2007-10-03) package which includes everything needed to run Azureus v2.5.0.4 on eCS and OS/2.

You can get both here:
http://www.juergen-ulbts.de/swtswing
Regards,
Juergen
*** Java Movie Database - http://www.jmdb.de/

DavidG

Quote from: magog on 2007.07.31, 21:14:24

@David Graser: I'm looking forward to see some progress with OW as I've used it for some JNI (Java Native Interface) stuff in the past. I definately like it more then GCC.

As most FM/2 users are aware, FM/2 has switched its development environment over to OW.  As a result, some bugs in the OS/2 OW development environment have been discovered and are slowly being corrected by Steven Levine.  Probably the last big hurtle is getting the WRC.EXE working as it needs to be.

The goal of FM/2 is to build using OW's WRC.EXE instead of IBM's RC.EXE.

Just a plug for FM/2.  If you follow FM/2's SVN Trac page, one can see that it is being actively developed.  Lots of bug fixes and lots of enhancements.  The next release 3.08, when it comes out will contain enhancements to the association logic.  No longer does one have to use *.txt but will be able to use *txt or *text, etc.  In addition, if all goes well, FM/2 will support the copying and moving of files larger than 2GB on file systems that support this.