org.shetline.util
Class DelayedAction
java.lang.Object
org.shetline.util.DelayedAction
public class DelayedAction
- extends Object
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. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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
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.
getDelay
public int getDelay()
setDelay
public void setDelay(int delay)
trigger
public void trigger()
resetAndTrigger
public void resetAndTrigger()
rush
public void rush()