Provides a progress message that can be made to be updated automatically by adding dots after it, representing a running process. When a configurable maximum number of dots have been added, all dots are removed and the cycle starts over.
A ProgressMessage
can be updated manually, by calling its {@link #update()}method, but a more common mode of operation is to make it update {@link #setUpdateAutomatically(int) automatically}, with a configurable delay between each update.
The current text of a ProgressMessage
can be {@link #getText() pulled}, but it can also be pushed to an {@link Acceptor} that is notified everytime the message changes, e.g.when a new dot has been added. This can be used e.g. to create widgets such as JLabel
s the text of which should be updated periodically to display the progress of a monitored process.
All setters of configurable properties of this class are safe to call from any thread. The provided getters for pulling the current state must be called from the event-dispatching thread in order to guarantee correct behavior.
@author Torgil Zethson
@since 2.0.0