Sky View Café - Java

org.shetline.util
Class DelayedAction

java.lang.Object
  extended by org.shetline.util.DelayedAction

public class DelayedAction
extends Object


Nested Class Summary
protected  class DelayedAction.TimerThread
           
 
Field Summary
protected  Runnable action
           
protected  int delay
           
protected  String name
           
protected  boolean onEventDispatch
           
protected  boolean rushed
           
protected  Thread timer
           
 
Constructor Summary
DelayedAction(int delay, boolean onEventDispatch, Runnable action)
          Constructs a DelayedAction for the given component.
DelayedAction(int delay, boolean onEventDispatch, String name, Runnable action)
          Constructs a DelayedAction for the given component.
 
Method Summary
 int getDelay()
           
 void resetAndTrigger()
           
 void rush()
           
 void setDelay(int delay)
           
 void trigger()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

action

protected Runnable action

delay

protected volatile int delay

name

protected String name

onEventDispatch

protected boolean onEventDispatch

rushed

protected boolean rushed

timer

protected Thread timer
Constructor Detail

DelayedAction

public DelayedAction(int delay,
                     boolean onEventDispatch,
                     Runnable action)
Constructs a DelayedAction for the given component.

Parameters:
delay - Time (in milliseconds) for action to be delayed after being triggered.
onEventDispatch - If true, perform action on the AWT event dispatch thread.
action - The action to perform periodically.

DelayedAction

public DelayedAction(int delay,
                     boolean onEventDispatch,
                     String name,
                     Runnable action)
Constructs a DelayedAction for the given component.

Parameters:
delay - Time (in milliseconds) for action to be delayed after being triggered.
onEventDispatch - If true, perform action on the AWT event dispatch thread.
name - Name for the thread which handles the delay. Unique thread names are useful when debugging.
action - The action to perform periodically.
Method Detail

getDelay

public int getDelay()

setDelay

public void setDelay(int delay)

trigger

public void trigger()

resetAndTrigger

public void resetAndTrigger()

rush

public void rush()

Sky View Café - Java