Class 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.
    • Constructor Detail

      • BufferedSwingRunner

        public BufferedSwingRunner​(int minDelay,
                                   int maxDelay)
        Constructs a new SwingUpdateManager

        Note: The minDelay will always be at least AbstractSwingUpdateManager.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

      • run

        public void run​(java.lang.Runnable r)
        Runs the given runnable. If this is the first call to run, 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