public abstract class AbstractController<V extends IView> extends java.lang.Object implements IController
Modifier and Type | Class and Description |
---|---|
static class |
AbstractController.ControllerWorker<T,W>
Worker class that has three steps: pre-ui, do-background, post-ui (i.e.,
done)
|
Modifier and Type | Field and Description |
---|---|
protected org.processmining.framework.plugin.PluginContext |
context |
protected SignalRegRecorder |
regrec |
static int |
ScheduleDelayDefault |
protected V |
view |
Constructor and Description |
---|
AbstractController(org.processmining.framework.plugin.PluginContext context) |
Modifier and Type | Method and Description |
---|---|
abstract void |
activate()
Register all listeners and stop background work here
|
void |
deactivate()
Unregister all listeners and start background work here
|
V |
getView()
Get view object
|
abstract void |
initialize()
Instantiate and prepare everything here
|
<T,W> void |
runBackground(AbstractController.ControllerWorker<T,W> worker)
Run prepareUi() in ui thread, then run doInBackground() in background
thread, and call done() in ui thread
|
void |
runBackground(java.lang.Runnable command)
Run command in background thread
|
<T,W> void |
runBackground(javax.swing.SwingWorker<T,W> worker)
Run doInBackground() in background thread, and call done() in ui thread
|
void |
runUi(java.lang.Runnable command)
Run command in ui thread
|
<T,W> void |
scheduleBackground(AbstractController.ControllerWorker<T,W> worker)
Schedule background work, unscheduling any previous unprocessed
background work
Run prepareUi() in ui thread, then run doInBackground() in background
thread, and call done() in ui thread
|
void |
scheduleBackground(java.awt.event.ActionListener lst)
Schedule background work, unscheduling any previous unprocessed
background work
|
void |
scheduleBackground(java.lang.Runnable command)
Schedule background work, unscheduling any previous unprocessed
background work
Run command in background thread
|
<T,W> void |
scheduleBackground(javax.swing.SwingWorker<T,W> worker)
Schedule background work, unscheduling any previous unprocessed
background work
Run doInBackground() in background thread, and call done() in ui thread
|
void |
setScheduleDelay(int newDelay)
Set delay for scheduled background work
|
public static final int ScheduleDelayDefault
protected final org.processmining.framework.plugin.PluginContext context
protected final SignalRegRecorder regrec
public AbstractController(org.processmining.framework.plugin.PluginContext context)
public void runBackground(java.lang.Runnable command)
command
- public <T,W> void runBackground(javax.swing.SwingWorker<T,W> worker)
command
- public <T,W> void runBackground(AbstractController.ControllerWorker<T,W> worker)
command
- public void setScheduleDelay(int newDelay)
command
- public void scheduleBackground(java.lang.Runnable command)
command
- public <T,W> void scheduleBackground(javax.swing.SwingWorker<T,W> worker)
command
- public <T,W> void scheduleBackground(AbstractController.ControllerWorker<T,W> worker)
command
- public void scheduleBackground(java.awt.event.ActionListener lst)
command
- public void runUi(java.lang.Runnable command)
command
- public V getView()
getView
in interface IController
public abstract void initialize()
initialize
in interface IController
public abstract void activate()
activate
in interface IController
public void deactivate()
deactivate
in interface IController