A status bar intended to be displayed at the bottom of each window.
Implementation notes:
An update timer is used to only update the statusbar, every xx seconds. As a
nice side-effect, all swing method calls happen in the awt-event dispatcher
thread automatically. If we don't do this, we have to wrap every swing method
in a Runnable interface and execute it using SwingUtilities.invokeLater().
Note, that without an update timer, the statusbar text and most importantly
the progressbar are updated very frequently, using very small updates. But,
because these are called using invokeLater(), all have to be placed in the
awt-event dispatcher queue. This makes things very slow. We discovered, when
moving around 1000 messages and updating the progressbar for every message,
it will take more time to update the statusbar than actually moving the
messages.
There's another Timer, addWorkerTimer which makes sure that only Workers who
are alive for at most 2000 ms will appear in the statusbar. This prevents the
statusbar from flicker, caused by many smaller tasks which usually tend to
hide the parent task. For example when downloaded POP3 messages and using
filters which move message to different folders. Without the addWorkerTimer
you would see all those little move tasks. Instead now, you only see the POP3
tasks which is much more comfortable for the user.
There's yet another Timer ;-), clearTextTimer which automatically clears the
statusbar after a delay of 2000 ms.
|