AWT is dead now

Per Bothner per@bothner.com
Mon Mar 20 21:30:00 GMT 2000


Cedric Berger <cedric@wireless-networks.com> writes:

> 1) implementing the basic (low level) AWT functionalities.
> Basically Window/Frame/Component/Container/Canvas and
> event handling.

I agree this comes first.

> 2) implementing Java2D (it's probably more difficult than 1),
> but it can be done later and its probably a lot of fun to do.

It seems plausible to use libart (see http://www.levien.com/libart/
and http://developer.gnome.org/arch/imaging/libart.html ).

> 3) implementing Swing on top of the minimal AWT (or
> borrowing it from 1.1 as a temporary solution). Swing is not
> a trivial piece of code, but the advantage is that since almost
> all functions/members of Swing are either public or protected,
> all the skeleton of the code can be written from the JavaDoc
> output of swing. "only" filling the method's body is required.

Well, this is the "pure Java" approach.  It may make sense
to use existing Gtk widgets instead.  It may also make sense
to do provide both:  I.e. the toolkit by default uses Gtk
widgets, but that can be overridden.

I think the "model" classes should be pure Java (except perhaps
a few CNI methods for speed).  However, the "view" classes
should perhaps be based on gtk widgets.  At least the default
implementation of the view classes should use the gtk theme
framework.

One exciting idea I want to explore is to use the XSL
"formatting object" model for views.  See http://www.w3.org/TR/xsl/ 
We could base the implementation on FOP ( http://xml.apache.org/fop/ ),
which is an open-source implementation in Java sponsored by the Apache
XML Project.  FOP can generate pdf - and it also includes
a viewer, so it could form the basis for a "view engine".
(However, I don't know if the Apache license is viewed as
being compatible with the modified-GPL of libgcj.)

Similarly, it might be cool to have the Element hierarchy of a
Swing Document implement the org.w3c.dom.Node.  This might provide
a nice integrated and efficient XML environment.

> 4) if somebody really need it at that point, implementing
> AWT widgets by calling Swing code

That is my suggestion, too.
-- 
	--Per Bothner
per@bothner.com   http://www.bothner.com/~per/


More information about the Java mailing list