Class DisplayCoalescentEDTRunnablePool
java.lang.Object
org.micromanager.ndviewer.internal.gui.DisplayCoalescentEDTRunnablePool
public class DisplayCoalescentEDTRunnablePool extends Object
Provide versions of SwingUtilities.invokeLater that coalesce with other
outstanding invocations.
- Author:
- Mark A. Tsuchida
-
Method Summary
Modifier and Type Method Description static DisplayCoalescentEDTRunnablePoolcreate()voidinvokeAsLateAsPossibleWithCoalescence(CoalescentRunnable runnable)LikeinvokeLaterWithCoalescence, but defers invocation until the last scheduled task on the event queue is processed.voidinvokeLaterWithCoalescence(CoalescentRunnable runnable)Invoke the given runnable on the EDT, coalescing multiple invocations on the event queue.
-
Method Details
-
create
-
invokeLaterWithCoalescence
Invoke the given runnable on the EDT, coalescing multiple invocations on the event queue. This is a mechanism to coalesce refresh-like tasks, in the manner of Swing'sRepaintManager, without having to replace the system global event queue via EventQueue.push. The given runnable is scheduled to run on the EDT, just as withSwingUtilities.invokeLater, but when invoked, all outstanding runnables with the same "coalescence class" (see CoalescentRunnable.getCoalescenceClass) will be coalesced and the result will be run.- Parameters:
runnable- the coalescent runnable to invoke on the EDT
-
invokeAsLateAsPossibleWithCoalescence
LikeinvokeLaterWithCoalescence, but defers invocation until the last scheduled task on the event queue is processed. Note that if you keep calling this method at a higher rate than the EDT is processing events, the runnable will not be executed until the EDT becomes otherwise idle.- Parameters:
runnable- the coalescent runnable to invoke on the EDT
-