[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [platform-swt-dev] SWT on top of swing?
- From: Michael Scharf <Michael-Scharf@xxxxxx>
- Date: Tue, 09 Sep 2003 00:32:05 +0200
- Delivered-to: firstname.lastname@example.org
- User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030529
NetAmie is a project on java.net which abstracts out SWT and Swing for
the application (also AWT, Flash, and Conga and OpenGL). The application
will not care whether it is Swing or SWT. Therefore, you remove your
application dependency on the specific tool kit.
That's cool. I'm currently working on a similar project called
GuiModel. Here the idea is, to clearly separate the GUI from
the GuiModel. Client code is written against the GuiModel. You
build the gui (well it's intended to be used for dialogs) with
your favorite widgetset or guibuilder. All you have to do is to
register the widgets with slots in the gui model. The interaction
between the GUI and the model is done in the GUI specific adapter (e.g
the SWTAdapter or the SwingAdapter)....
All the logic of the dialog is encoded in the GuiModel. That makes
it easy to change the GUI witout touching any of the logic of
the application. An additional advantage is, that you can change
values in the model and the GUI is automatically listening to
the model changes. Or the user changes the state of a GUI widget
and the model gets changed (and listeners to the model get
notified). Because the model is generic, it's easy to add
a "cancel" or "defaults" behaviour in a general way.
You can plug in a data implementation of your choice for the
model representation. That way it's easy to directly drive e.g.
eclipse Preferences or a custom data implementation of your
This approach is slighty less ambitios then netamie (as I
understand it), because the creation of the GUI remains
specific to he used widgetset, but changing the GUI should
not have an impact on the application (because there should
be no application logic in the GUI part...)
However, as we say in German, "the devil is in the detail".
So, I'm experimenting with my preliminary implementation to
see if this is usable in the real world....
The GuiModel is really restricted to dialogs, wizzard pages
etc. It's not meant to cover the the logic of an application.
You have an interface contract which abstracts out the details of the
graphics implementation. Think JDO which abstracts out the specific
The project is https://netamie.dev.java.net/ . Look forward to your
comments or participation.
I tryed to check out the code, but neither
cvs -d :pserver:anoncvs@xxxxxxxxxxxxxxxx:/cvs login
cvs -d :pserver:guest@xxxxxxxxxxxxxxxx:/cvs login
seem to work (what's the anonymous password?)