|
Gridarta Editor
|
Helper for reducing the number of change events: calls to change() will be forwarded to DelayedChangeListener#change(). More...
Collaboration diagram for net.sf.gridarta.utils.DelayedChangeManager:Classes | |
| interface | State |
| The states of the FSM. More... | |
| class | TimeoutTimerTask |
| A TimerTask that calls State#timeout() when the timer expires. More... | |
Public Member Functions | |
| void | change () |
| Delivers a change event to the associated DelayedChangeListener. More... | |
| DelayedChangeManager (final int initialDelay, final int notificationDelay, @NotNull final DelayedChangeListener delayedChangeListener) | |
| Creates a new instance. More... | |
| void | finish () |
| Finishes a series of change events. More... | |
Private Attributes | |
| final DelayedChangeListener | delayedChangeListener |
| The DelayedChangeListener events are forwarded to. More... | |
| final State | idle |
| The state "idle" of the FSM. More... | |
| final int | initialDelay |
| The delay in millisecond the first forwarded event is delayed. More... | |
| final int | notificationDelay |
| The interval in milliseconds events are forwarded during a long series of events. More... | |
| final State | pending |
| The state "pending" of the FSM. More... | |
| State | state = idle |
| The FSM's current state. More... | |
| final Timer | timer = new Timer() |
| The Timer for delaying events. More... | |
| final State | wait |
| The state "wait" of the FSM. More... | |
Helper for reducing the number of change events: calls to change() will be forwarded to DelayedChangeListener#change().
Forwarded calls are dropped if they would happen very quickly.
Definition at line 32 of file DelayedChangeManager.java.
| net.sf.gridarta.utils.DelayedChangeManager.DelayedChangeManager | ( | final int | initialDelay, |
| final int | notificationDelay, | ||
| @NotNull final DelayedChangeListener | delayedChangeListener | ||
| ) |
Creates a new instance.
| initialDelay | the initial delay for a series of events in milliseconds |
| notificationDelay | the delay for following events in a series of events; in milliseconds |
| delayedChangeListener | the delayed change listener to forward events to |
Definition at line 199 of file DelayedChangeManager.java.
References net.sf.gridarta.utils.DelayedChangeManager.delayedChangeListener, net.sf.gridarta.utils.DelayedChangeManager.initialDelay, and net.sf.gridarta.utils.DelayedChangeManager.notificationDelay.
| void net.sf.gridarta.utils.DelayedChangeManager.change | ( | ) |
Delivers a change event to the associated DelayedChangeListener.
Definition at line 208 of file DelayedChangeManager.java.
References net.sf.gridarta.utils.DelayedChangeManager.State.change().
Here is the call graph for this function:| void net.sf.gridarta.utils.DelayedChangeManager.finish | ( | ) |
Finishes a series of change events.
Calling this function is optional: if it is called, a pending change event is immediately forwarded; otherwise when the notification timeout has expired.
Definition at line 218 of file DelayedChangeManager.java.
References net.sf.gridarta.utils.DelayedChangeManager.State.finish().
Here is the call graph for this function:
|
private |
The DelayedChangeListener events are forwarded to.
Definition at line 51 of file DelayedChangeManager.java.
Referenced by net.sf.gridarta.utils.DelayedChangeManager.DelayedChangeManager().
|
private |
The state "idle" of the FSM.
Definition at line 104 of file DelayedChangeManager.java.
|
private |
The delay in millisecond the first forwarded event is delayed.
This allows combining the first few events of a long series of events without delaying the delivery for a long time (notificationDelay).
Definition at line 39 of file DelayedChangeManager.java.
Referenced by net.sf.gridarta.utils.DelayedChangeManager.DelayedChangeManager().
|
private |
The interval in milliseconds events are forwarded during a long series of events.
Definition at line 45 of file DelayedChangeManager.java.
Referenced by net.sf.gridarta.utils.DelayedChangeManager.DelayedChangeManager().
|
private |
The FSM's current state.
Definition at line 188 of file DelayedChangeManager.java.
Referenced by net.sf.gridarta.utils.DelayedChangeManager.TimeoutTimerTask.run().
|
private |
The Timer for delaying events.
Definition at line 57 of file DelayedChangeManager.java.
|
private |