public class MergingUpdateQueue extends java.lang.Object implements java.lang.Runnable, Disposable, Activatable
queue(Update)
method to add new tasks.Disposable.Parent
Activatable.Adapter
Modifier and Type | Field and Description |
---|---|
static javax.swing.JComponent |
ANY_COMPONENT |
Constructor and Description |
---|
MergingUpdateQueue(java.lang.String name,
int mergingTimeSpan,
boolean isActive,
javax.swing.JComponent modalityStateComponent) |
MergingUpdateQueue(java.lang.String name,
int mergingTimeSpan,
boolean isActive,
javax.swing.JComponent modalityStateComponent,
Disposable parent) |
MergingUpdateQueue(java.lang.String name,
int mergingTimeSpan,
boolean isActive,
javax.swing.JComponent modalityStateComponent,
Disposable parent,
javax.swing.JComponent activationComponent) |
MergingUpdateQueue(java.lang.String name,
int mergingTimeSpan,
boolean isActive,
javax.swing.JComponent modalityStateComponent,
Disposable parent,
javax.swing.JComponent activationComponent,
Alarm.ThreadToUse thread) |
MergingUpdateQueue(java.lang.String name,
int mergingTimeSpan,
boolean isActive,
javax.swing.JComponent modalityStateComponent,
Disposable parent,
javax.swing.JComponent activationComponent,
boolean executeInDispatchThread) |
Modifier and Type | Method and Description |
---|---|
void |
activate() |
void |
cancelAllUpdates() |
void |
deactivate() |
void |
dispose()
Usually not invoked directly, see class javadoc.
|
protected void |
execute(Update [] update) |
void |
flush() |
ModalityState |
getModalityState() |
void |
hideNotify() |
boolean |
isActive() |
boolean |
isEmpty() |
boolean |
isFlushing() |
protected boolean |
isModalityStateCorrect() |
boolean |
isPassThrough() |
boolean |
isSuspended() |
void |
queue(Update update)
Adds a task to be executed.
|
void |
restartTimer() |
void |
resume() |
void |
run() |
void |
run(Update update) |
void |
sendFlush() |
void |
setActivationComponent(javax.swing.JComponent c) |
void |
setMergingTimeSpan(int timeSpan) |
void |
setModalityStateComponent(javax.swing.JComponent modalityStateComponent) |
void |
setPassThrough(boolean passThrough) |
MergingUpdateQueue |
setRestartTimerOnAdd(boolean restart) |
void |
setTrackUiActivity(boolean trackUiActivity) |
void |
showNotify() |
void |
suspend() |
java.lang.String |
toString() |
MergingUpdateQueue |
usePassThroughInUnitTestMode()
Switches on the PassThrough mode if this method is called during testing.
|
public MergingUpdateQueue(java.lang.String name, int mergingTimeSpan, boolean isActive, javax.swing.JComponent modalityStateComponent)
public MergingUpdateQueue(java.lang.String name, int mergingTimeSpan, boolean isActive, javax.swing.JComponent modalityStateComponent, Disposable parent)
public MergingUpdateQueue(java.lang.String name, int mergingTimeSpan, boolean isActive, javax.swing.JComponent modalityStateComponent, Disposable parent, javax.swing.JComponent activationComponent)
public MergingUpdateQueue(java.lang.String name, int mergingTimeSpan, boolean isActive, javax.swing.JComponent modalityStateComponent, Disposable parent, javax.swing.JComponent activationComponent, boolean executeInDispatchThread)
public MergingUpdateQueue(java.lang.String name, int mergingTimeSpan, boolean isActive, javax.swing.JComponent modalityStateComponent, Disposable parent, javax.swing.JComponent activationComponent, Alarm.ThreadToUse thread)
name
- name of this queue, used only for debugging purposesmergingTimeSpan
- time (in milliseconds) for which execution of tasks will be postponedisActive
- if true
the queue will execute tasks otherwise it'll just collect them and execute only after activate()
is calledmodalityStateComponent
- makes sense only if thread
is SWING_THREAD, in that
case the tasks will be processed in ModalityState
corresponding the given componentparent
- if not null
the queue will be disposed when the given parent is disposedactivationComponent
- if not null
the tasks will be processing only when the given component is showingthread
- specifies on which thread the tasks are executedpublic void setMergingTimeSpan(int timeSpan)
public void cancelAllUpdates()
public final boolean isPassThrough()
public final void setPassThrough(boolean passThrough)
passThrough
- if true
the tasks won't be postponed but executed immediately insteadpublic final MergingUpdateQueue usePassThroughInUnitTestMode()
public void activate()
public void deactivate()
public void suspend()
public void resume()
public void hideNotify()
hideNotify
in interface Activatable
public void showNotify()
showNotify
in interface Activatable
public void restartTimer()
public void run()
run
in interface java.lang.Runnable
public void flush()
public void setModalityStateComponent(javax.swing.JComponent modalityStateComponent)
protected boolean isModalityStateCorrect()
public boolean isSuspended()
protected void execute(Update [] update)
public void queue(Update update)
public final void run(Update update)
public boolean isActive()
public void dispose()
Disposable
dispose
in interface Disposable
public java.lang.String toString()
toString
in class java.lang.Object
public ModalityState getModalityState()
public void setActivationComponent(javax.swing.JComponent c)
public MergingUpdateQueue setRestartTimerOnAdd(boolean restart)
public boolean isEmpty()
public void sendFlush()
public boolean isFlushing()
public void setTrackUiActivity(boolean trackUiActivity)