Hi All!
I have to continue working on previously existing Java GUI app.
it has tool bar, menu and map area with objects.
I'm now looking for good solution for how to organize events/state
handling inside the app.
It can work in several states:
logged in, logged out, showing current objects state on the map,
showing movements history on the map.
Main question: how to best handle changes of the app state to
enable/disable controls and update statuses?
Right now there is a periodically executed task (each 100 ms) that
updates state of controls in the app.
The code looks like:
toolbar.setEnabled( isHistoryMode && loggedIn );
I think it is ugly to have such code and going to define
event/listeners for app state changes:
login/logout,
change mode to history/normal
etc.
Will setup listeners right on app start.
What can you say?
Thanks in advance.
Michael Rauscher - 22 Jan 2007 05:55 GMT
Andrey Chernyh schrieb:
> Hi All!
>
[quoted text clipped - 12 lines]
> Right now there is a periodically executed task (each 100 ms) that
> updates state of controls in the app.
Uuh. That's really hard :) Have a look at [1].
Bye
Michael
[1] http://www.martinfowler.com/eaaDev/OrganizingPresentations.html