T
- Type that would be returned from the doInBackground() methodpublic abstract class DelayedActionManager<T>
extends java.lang.Object
SwingWorker
in
that a DelayedActionManager can be executed multiple times, but the background process will not start until AFTER
the wait period has expired. For example, if you create a Delayed Action Manager with a wait time of 700ms, then when
execute() is called, it will wait 700ms before calling doInBackground(). If after 300ms (ie, we have 400ms left) we
call execute() again, then then the the timer is reset and we wait another 700ms before calling doInBackground().
This primary use base for this is a case where we may have some repetitive actions being performed, such as a user
typing in a text box, or a user dragging an object, but we only only want to do the main background task once there
is a pause.
Much like a SwingWorker
, you'd want to do your long running, non ui work, in the background, and then ONLY
update the UI in the runOnUI() methodConstructor and Description |
---|
DelayedActionManager(long waitFor)
Creates a new DelayedActionManager that waits for waitFor ms before executing its doInBackground task
|
Modifier and Type | Method and Description |
---|---|
void |
execute()
Execute the task (ie, doInBackground() and runOnUI()).
|