public class Controller extends Object
Modifier and Type | Field and Description |
---|---|
static Controller |
defaultInstance |
static int |
INITIAL_DELAY
initial delay for ading progress indication into the UI.
|
Constructor and Description |
---|
Controller(ProgressUIWorker comp)
Creates a new instance of Controller
|
Modifier and Type | Method and Description |
---|---|
protected ProgressUIWorkerWithModel |
createWorker()
Creates a worker.
|
static Controller |
getDefault() |
protected Executor |
getEventExecutor()
Executes runnable synchronously with controller's event dispatch.
|
TaskModel |
getModel() |
protected ProgressUIWorker |
getProgressUIWorker()
Retrieves the ProgressUIWorker instance.
|
protected void |
resetTimer(int delay,
boolean activate)
The method is responsible to start or stop a timing service in the environment.
|
protected void |
runEvents()
Processes the queued events.
|
void |
runNow() |
public static Controller defaultInstance
public static final int INITIAL_DELAY
public Controller(ProgressUIWorker comp)
public static Controller getDefault()
protected ProgressUIWorkerWithModel createWorker()
protected final ProgressUIWorker getProgressUIWorker()
Controller.createWorker()
.public TaskModel getModel()
protected void resetTimer(int delay, boolean activate)
Controller.runEvents()
if the timer ticks.
If "delay" is positive, the method should configure the timer to fire after "delay" milliseconds. Depending on "restart" parameter, the timer should be just configured (false), or activated (true) - potentially canceling the previous schedule.
The default implementation uses RequestProcessor
for scheduling.
delay
- delay in milliseconds before the timer should fireactivate
- if true, activate the changes immediately.protected Executor getEventExecutor()
The method must be overriden by a controller implementation which changes the threading model from the default one.
protected void runEvents()
public void runNow()