what is the state of awt in lingcj?

Rolf W. Rasmussen rolfwr@ii.uib.no
Fri Jul 13 06:07:00 GMT 2001


On Thu, Jul 12, 2001 at 05:49:53PM -0700, Per Bothner wrote:
> There are advantages in doing xlib peers (first):
>
> * More compatible with the Swing model, using light-weight components
> where most of the code including look-and-feel are written in Java.

This was my original motivation for creating the Xlib peer. I wanted to 
create a lightweight implementation of the core of AWT so that a clean room 
Swing implementation could be built on top of it.

Pure Xlib doesn't have any native widgets, so I planned to "loop back" the 
Swing component implementations to separate sub-windows to create the 
traditional heavyweight AWT components. The screenshots of simple 
buttons and labels on my website shows an early implementation of this.

The problem arose when I tried to implement more complex components such 
as text fields. First then I realized what a terrible state Swing APIs was 
in. Swing is horribly underspecified. The documentation of a large 
portion of classes is practically non-existant, and while the design of 
Swing on the surface may look sound, the further you dig into the details, 
the more messy it gets. The chances of creating a proper clean room Swing 
implementation without seems pretty bleak.

In order to make the Xlib usable, we need either to create something 
resembling Swing, or create a set of simpler component implementations 
based on the AWT primitives, but as you said...


> There are also advantages in concentrating on Gnome first:
> * Higher level abstracting means lot of the work is already done.
> Re-inventing the wheel is not my idea of fun.

I agree. Without a proper Swing implementation, some of the 
merit of the Xlib peers have disappeared.

I haven't had much time to work on libgcj lately, but I hope that
will change soon. When that happens I might consider concentrating my 
efforts on getting get a set of GTK/Gnome peers up and running instead.

> Rolf, any comments?  Do you have any recent work you haven't
> checked in?  Is there anything we need besides what's in CVS
> to try it out?

The old JCNIX libraries has some code that I never merged, including some 
optimized renderers for the Java2d stuff.

Of newer code not in CVS, I have parts of a Swing implementation. You can 
find the source code at 
http://www.ii.uib.no/~rolfwr/jcnix/jcnix-swing.tar.gz

I'm sorry that I don't have more time to devote to this at the moment.

-- 
Rolf W. Rasmussen



More information about the Java mailing list