Package ghidra.util.task
Class BufferedSwingRunner
- java.lang.Object
-
- ghidra.util.task.AbstractSwingUpdateManager
-
- ghidra.util.task.BufferedSwingRunner
-
public class BufferedSwingRunner extends AbstractSwingUpdateManager
A class that run the client's runnable on the Swing thread. Repeated requests will get buffered until the max delay is reached.
-
-
Field Summary
-
Fields inherited from class ghidra.util.task.AbstractSwingUpdateManager
DEFAULT_MAX_DELAY, DEFAULT_MIN_DELAY, DEFAULT_NAME, isWorking, MIN_DELAY_FLOOR, NONE, timer
-
-
Constructor Summary
Constructors Constructor Description BufferedSwingRunner()
BufferedSwingRunner(int minDelay, int maxDelay)
Constructs a new SwingUpdateManager
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
run(java.lang.Runnable r)
Runs the given runnable.void
runLater(java.lang.Runnable r)
Runs the given runnable later, buffering the request until the timeout has expired.protected void
swingDoWork()
The subclass callback to perform work.-
Methods inherited from class ghidra.util.task.AbstractSwingUpdateManager
checkForWork, dispose, flush, hasPendingUpdates, isBusy, isDisposed, scheduleCheckForWork, stop, toString, toStringDebug, update, updateLater, updateNow
-
-
-
-
Constructor Detail
-
BufferedSwingRunner
public BufferedSwingRunner(int minDelay, int maxDelay)
Constructs a new SwingUpdateManagerNote: The
minDelay
will always be at leastAbstractSwingUpdateManager.MIN_DELAY_FLOOR
, regardless of the given value.- Parameters:
minDelay
- the minimum number of milliseconds to wait once the event stream stops coming in before actually updating the screen.maxDelay
- the maximum amount of time to wait between gui updates.
-
BufferedSwingRunner
public BufferedSwingRunner()
-
-
Method Detail
-
swingDoWork
protected void swingDoWork()
Description copied from class:AbstractSwingUpdateManager
The subclass callback to perform work.- Specified by:
swingDoWork
in classAbstractSwingUpdateManager
-
run
public void run(java.lang.Runnable r)
Runs the given runnable. If this is the first call torun
, then do the work immediately; otherwise, buffer the request until the timeout has expired.See the header of
AbstractSwingUpdateManager
for details on the update process.- Parameters:
r
- the task to run on the Swing thread
-
runLater
public void runLater(java.lang.Runnable r)
Runs the given runnable later, buffering the request until the timeout has expired.See the header of
AbstractSwingUpdateManager
for details on the update process.- Parameters:
r
- the task to run on the Swing thread
-
-