|
Sky View Café - Java | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.shetline.util.RepeatingComponentAction
public class RepeatingComponentAction
A periodically repeating action based on the visibility of a component.
| Field Summary | |
|---|---|
protected Runnable |
action
|
protected Component |
comp
|
protected int |
delay
|
protected String |
name
|
protected boolean |
onEventDispatch
|
protected Thread |
repeater
|
protected boolean |
stopped
|
| Constructor Summary | |
|---|---|
RepeatingComponentAction(Component comp,
int delay,
boolean onEventDispatch,
Runnable action)
Constructs a RepeatingComponentAction for the given component. |
|
RepeatingComponentAction(Component comp,
int delay,
boolean onEventDispatch,
String name,
Runnable action)
Constructs a RepeatingComponentAction for the given component. |
|
| Method Summary | |
|---|---|
void |
actNow()
Skip over any remaining delay until the next repetition and perform the repeated action immediately (or as immediately as waiting for SwingUtilities.isEventDispatchThread() permits). |
void |
setName(String name)
Sets the name of the thread which handles periodic repetition - useful for debugging. |
void |
start()
Starts repeater if not already running. |
void |
stop()
Stops repeater. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected Runnable action
protected Component comp
protected int delay
protected String name
protected boolean onEventDispatch
protected Thread repeater
protected boolean stopped
| Constructor Detail |
|---|
public RepeatingComponentAction(Component comp,
int delay,
boolean onEventDispatch,
Runnable action)
comp - Component for a repeating action.delay - Time (in milliseconds) between each repetition of action.onEventDispatch - If true, perform action on the AWT event dispatch thread.action - The action to perform periodically.
public RepeatingComponentAction(Component comp,
int delay,
boolean onEventDispatch,
String name,
Runnable action)
comp - Component for a repeating action.delay - Time (in milliseconds) between each repetition of action.onEventDispatch - If true, perform action on the AWT event dispatch thread.name - Name for the thread which handles periodic repetition. Unique thread names are useful when debugging.action - The action to perform periodically.| Method Detail |
|---|
public void setName(String name)
name - Name for thread.public void start()
public void stop()
public void actNow()
SwingUtilities.isEventDispatchThread() permits). Timing cycle
will be reset and the next repetition will occur after a full delay.
If the repeater isn't running when this method is called, a single-shot action is performed.
|
Sky View Café - Java | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||