Class OPITimer

java.lang.Object
org.csstudio.swt.widgets.util.OPITimer

public class OPITimer extends Object
A customized timer for the internal use of OPI builder. It will execute a task after certain delay. The timer can be reseted or stopped during the delay period. The timer will stop and dispose automatically when it is due.
   |------------|---------------|
 Start      Due/start task  task done
 
  • Constructor Details

    • OPITimer

      public OPITimer()
  • Method Details

    • start

      public void start(Runnable task, long delay)
      Schedules the specified task for execution after the specified delay.
      Parameters:
      task - task to be scheduled.
      delay - delay in milliseconds before task is to be executed.
      Throws:
      IllegalArgumentException - if delay is negative, or delay + System.currentTimeMillis() is negative.
      IllegalStateException - if task was already scheduled or canceled, or timer was canceled.
    • reset

      public void reset()
      Reset the timer to start from zero again.
    • isDue

      public boolean isDue()
      Returns:
      true if timer is due
    • stop

      public void stop()
      Stop the timer. Cancel the scheduled task.