|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.alee.utils.swing.WebTimer
public class WebTimer
This timer is a small extension for standart javax.swing.Timer. Instead of running in a single queue it creates separate Threads for each timer and does not affect event-dispatching thread, until events are dispatched. This basically means that you can use any number of Timer instances and you can run them alltogether without having any issues.
Also this Timer implementation offers a variety of additional features and improvements which standard timer doesn't have (for example you can dispatch events in a separate non-EDT thread and as a result avoid using EDT at all where it is not necessary).
Timer
,
TimerActionListener
Nested Class Summary | |
---|---|
protected static class |
WebTimer.PartType
Time part type enumeration used to parse string delay. |
Field Summary | |
---|---|
protected java.lang.String |
actionCommand
Action command for fired events. |
protected boolean |
coalesce
Whether each action should be fired from a separate invoke and wait call or not. |
protected int |
cycleCount
Number of executed cycles; |
protected int |
cyclesLimit
Timer cycles execution limit. |
static int |
defaultCyclesLimit
Default cycles number limit. |
static java.lang.String |
defaultThreadName
Default name for timer thread. |
protected long |
delay
Delay between timer cycles in milliseconds. |
protected java.lang.Thread |
exec
Last timer thread. |
protected int |
id
Unique (within one timer instance) ID of currently running thread. |
protected long |
initialDelay
Delay before the first timer cycle run in milliseconds. |
protected int |
lastId
ID of previously executed thread. |
protected java.util.List<java.awt.event.ActionListener> |
listeners
Timer event listeners list. |
static int |
msInDay
Timer constants for calculations. |
static int |
msInHour
|
static int |
msInMinute
|
static int |
msInSecond
|
protected java.lang.String |
name
Internal timer thread name. |
protected boolean |
repeats
Whether timer repeat its cycles or not. |
protected java.util.Map<java.lang.Integer,java.lang.Boolean> |
running
Map of marks for currently active threads. |
protected long |
sleepStart
Last timer cycle start time. |
protected long |
sleepTime
Last timer cycle delay time. |
static boolean |
useEdtByDefault
Whether EDT should be used as the default timer action execution thread. |
protected boolean |
useEventDispatchThread
Whether actions should be fired from Event Dispatch Thread or not. |
Constructor Summary | |
---|---|
WebTimer(long delay)
Constructs timer with specified delay. |
|
WebTimer(long delay,
java.awt.event.ActionListener listener)
Constructs timer with specified delay and action listener. |
|
WebTimer(long delay,
long initialDelay)
Constructs timer with specified delay and initial delay. |
|
WebTimer(long delay,
long initialDelay,
java.awt.event.ActionListener listener)
Constructs timer with specified delay, initial delay and action listener. |
|
WebTimer(java.lang.String delay)
Constructs timer with specified delay. |
|
WebTimer(java.lang.String delay,
java.awt.event.ActionListener listener)
Constructs timer with specified delay and action listener. |
|
WebTimer(java.lang.String name,
long delay)
Constructs timer with specified internal thread name and delay. |
|
WebTimer(java.lang.String name,
long delay,
java.awt.event.ActionListener listener)
Constructs timer with specified internal thread name, delay and action listener. |
|
WebTimer(java.lang.String name,
long delay,
long initialDelay)
Constructs timer with specified internal thread name, delay and initial delay. |
|
WebTimer(java.lang.String name,
long delay,
long initialDelay,
java.awt.event.ActionListener listener)
Constructs timer with specified internal thread name, delay, initial delay and action listener. |
|
WebTimer(java.lang.String name,
java.lang.String delay)
Constructs timer with specified internal thread name and delay. |
|
WebTimer(java.lang.String name,
java.lang.String delay,
java.awt.event.ActionListener listener)
Constructs timer with specified internal thread name, delay and action listener. |
|
WebTimer(java.lang.String name,
java.lang.String delay,
java.lang.String initialDelay,
java.awt.event.ActionListener listener)
Constructs timer with specified internal thread name, delay, initial delay and action listener. |
Method Summary | |
---|---|
WebTimer |
addActionListener(java.awt.event.ActionListener listener)
Adds new action listener. |
protected void |
cleanUp(int id)
Cleans thread ID cache. |
protected java.awt.event.ActionEvent |
createActionEvent()
Returns action event. |
static WebTimer |
delay(long delay,
java.awt.event.ActionListener listener)
Returns newly created and started timer that doesn't repeat and has the specified delay and action listener. |
static WebTimer |
delay(long delay,
boolean useEventDispatchThread,
java.awt.event.ActionListener listener)
Returns newly created and started timer that doesn't repeat and has the specified delay and action listener. |
static WebTimer |
delay(java.lang.String delay,
java.awt.event.ActionListener listener)
Returns newly created and started timer that doesn't repeat and has the specified delay and action listener. |
static WebTimer |
delay(java.lang.String delay,
boolean useEventDispatchThread,
java.awt.event.ActionListener listener)
Returns newly created and started timer that doesn't repeat and has the specified delay and action listener. |
static WebTimer |
delay(java.lang.String name,
long delay,
java.awt.event.ActionListener listener)
Returns newly created and started timer that doesn't repeat and has the specified delay and action listener. |
static WebTimer |
delay(java.lang.String name,
long delay,
boolean useEventDispatchThread,
java.awt.event.ActionListener listener)
Returns newly created and started timer that doesn't repeat and has the specified delay and action listener. |
static WebTimer |
delay(java.lang.String name,
java.lang.String delay,
java.awt.event.ActionListener listener)
Returns newly created and started timer that doesn't repeat and has the specified delay and action listener. |
static WebTimer |
delay(java.lang.String name,
java.lang.String delay,
boolean useEventDispatchThread,
java.awt.event.ActionListener listener)
Returns newly created and started timer that doesn't repeat and has the specified delay and action listener. |
void |
fireActionPerformed()
Fires action events. |
java.lang.String |
getActionCommand()
Returns action command for fired events. |
int |
getCycleCount()
Returns executed cycles count. |
int |
getCycleNumber()
Returns current cycle number. |
int |
getCyclesLimit()
Returns timer cycles execution limit. |
long |
getCycleTimeLeft()
Returns time left in milliseconds until current cycle action exection. |
long |
getCycleTimePassed()
Returns time passed in milliseconds since curent cycle start. |
long |
getDelay()
Returns delay between timer cycles in milliseconds. |
long |
getInitialDelay()
Returns delay before the first timer cycle run in milliseconds. |
java.lang.String |
getInitialStringDelay()
Returns delay before the first timer cycle run. |
java.util.List<java.awt.event.ActionListener> |
getListeners()
Returns available action listeners list. |
java.lang.String |
getName()
Returns internal timer thread name. |
java.lang.String |
getStringDelay()
Returns delay between timer cycles. |
static void |
invokeAndWait(java.lang.Runnable runnable)
Will invoke the specified action in EDT in case it is called from non-EDT thread. |
boolean |
isCoalesce()
Returns whether each action should be fired from a separate invoke and wait call or not. |
boolean |
isLastCycle()
Return whether last cycle exection is ongoing or not. |
boolean |
isRepeats()
Returns whether timer repeat its cycles or not. |
boolean |
isRunning()
Returns whether this timer is running or not. |
boolean |
isUseEventDispatchThread()
Returns whether actions should be fired from Event Dispatch Thread or not. |
static long |
parseDelay(java.lang.String delay)
Either returns delay retrieved from string or throws an exception if it cannot be parsed. |
WebTimer |
removeActionListener(java.awt.event.ActionListener listener)
Removes an action listener. |
static WebTimer |
repeat(long delay,
java.awt.event.ActionListener listener)
Returns newly created and started timer that repeats and has the specified delay and action listener. |
static WebTimer |
repeat(long delay,
boolean useEventDispatchThread,
java.awt.event.ActionListener listener)
Returns newly created and started timer that repeats and has the specified delay and action listener. |
static WebTimer |
repeat(long delay,
int cyclesLimit,
java.awt.event.ActionListener listener)
Returns newly created and started timer that repeats and has the specified delay and action listener. |
static WebTimer |
repeat(long delay,
int cyclesLimit,
boolean useEventDispatchThread,
java.awt.event.ActionListener listener)
Returns newly created and started timer that repeats and has the specified delay and action listener. |
static WebTimer |
repeat(long delay,
long initialDelay,
java.awt.event.ActionListener listener)
Returns newly created and started timer that repeats and has the specified delay, initial delay and action listener. |
static WebTimer |
repeat(long delay,
long initialDelay,
boolean useEventDispatchThread,
java.awt.event.ActionListener listener)
Returns newly created and started timer that repeats and has the specified delay, initial delay and action listener. |
static WebTimer |
repeat(long delay,
long initialDelay,
int cyclesLimit,
java.awt.event.ActionListener listener)
Returns newly created and started timer that repeats and has the specified delay, initial delay and action listener. |
static WebTimer |
repeat(long delay,
long initialDelay,
int cyclesLimit,
boolean useEventDispatchThread,
java.awt.event.ActionListener listener)
Returns newly created and started timer that repeats and has the specified delay, initial delay and action listener. |
static WebTimer |
repeat(java.lang.String delay,
java.awt.event.ActionListener listener)
Returns newly created and started timer that repeats and has the specified delay and action listener. |
static WebTimer |
repeat(java.lang.String delay,
boolean useEventDispatchThread,
java.awt.event.ActionListener listener)
Returns newly created and started timer that repeats and has the specified delay and action listener. |
static WebTimer |
repeat(java.lang.String delay,
int cyclesLimit,
java.awt.event.ActionListener listener)
Returns newly created and started timer that repeats and has the specified delay and action listener. |
static WebTimer |
repeat(java.lang.String delay,
int cyclesLimit,
boolean useEventDispatchThread,
java.awt.event.ActionListener listener)
Returns newly created and started timer that repeats and has the specified delay and action listener. |
static WebTimer |
repeat(java.lang.String name,
long delay,
java.awt.event.ActionListener listener)
Returns newly created and started timer that repeats and has the specified delay and action listener. |
static WebTimer |
repeat(java.lang.String name,
long delay,
boolean useEventDispatchThread,
java.awt.event.ActionListener listener)
Returns newly created and started timer that repeats and has the specified delay and action listener. |
static WebTimer |
repeat(java.lang.String name,
long delay,
int cyclesLimit,
java.awt.event.ActionListener listener)
Returns newly created and started timer that repeats and has the specified delay and action listener. |
static WebTimer |
repeat(java.lang.String name,
long delay,
int cyclesLimit,
boolean useEventDispatchThread,
java.awt.event.ActionListener listener)
Returns newly created and started timer that repeats and has the specified delay and action listener. |
static WebTimer |
repeat(java.lang.String name,
long delay,
long initialDelay,
java.awt.event.ActionListener listener)
Returns newly created and started timer that repeats and has the specified delay, initial delay and action listener. |
static WebTimer |
repeat(java.lang.String name,
long delay,
long initialDelay,
boolean useEventDispatchThread,
java.awt.event.ActionListener listener)
Returns newly created and started timer that repeats and has the specified delay, initial delay and action listener. |
static WebTimer |
repeat(java.lang.String name,
long delay,
long initialDelay,
int cyclesLimit,
java.awt.event.ActionListener listener)
Returns newly created and started timer that repeats and has the specified delay, initial delay and action listener. |
static WebTimer |
repeat(java.lang.String name,
long delay,
long initialDelay,
int cyclesLimit,
boolean useEventDispatchThread,
java.awt.event.ActionListener listener)
Returns newly created and started timer that repeats and has the specified delay, initial delay and action listener. |
static WebTimer |
repeat(java.lang.String name,
java.lang.String delay,
java.awt.event.ActionListener listener)
Returns newly created and started timer that repeats and has the specified delay and action listener. |
static WebTimer |
repeat(java.lang.String name,
java.lang.String delay,
boolean useEventDispatchThread,
java.awt.event.ActionListener listener)
Returns newly created and started timer that repeats and has the specified delay and action listener. |
static WebTimer |
repeat(java.lang.String name,
java.lang.String delay,
int cyclesLimit,
java.awt.event.ActionListener listener)
Returns newly created and started timer that repeats and has the specified delay and action listener. |
static WebTimer |
repeat(java.lang.String name,
java.lang.String delay,
int cyclesLimit,
boolean useEventDispatchThread,
java.awt.event.ActionListener listener)
Returns newly created and started timer that repeats and has the specified delay and action listener. |
WebTimer |
restart()
Restarts timer execution. |
WebTimer |
restart(long delay)
Restarts timer execution and modifies timer delay. |
WebTimer |
restart(long initialDelay,
long delay)
Restarts timer execution and modifies timer delays. |
WebTimer |
restart(java.lang.String delay)
Restarts timer execution and modifies timer delay. |
WebTimer |
restart(java.lang.String initialDelay,
java.lang.String delay)
Restarts timer execution and modifies timer delays. |
WebTimer |
setActionCommand(java.lang.String actionCommand)
Sets action command for fired events. |
protected void |
setAlive(int id,
boolean alive)
Sets whether thread under specified ID is alive or not. |
WebTimer |
setCoalesce(boolean coalesce)
Sets whether each action should be fired from a separate invoke and wait call or not. |
WebTimer |
setCyclesLimit(int cyclesLimit)
Sets timer cycles execution limit. |
WebTimer |
setDelay(long delay)
Sets delay between timer cycles in milliseconds. |
WebTimer |
setDelay(java.lang.String delay)
Sets delay between timer cycles. |
WebTimer |
setInitialDelay(long initialDelay)
Sets delay before the first timer cycle run in milliseconds. |
WebTimer |
setInitialDelay(java.lang.String initialDelay)
Sets delay before the first timer cycle run. |
WebTimer |
setName(java.lang.String name)
Sets internal timer thread name. |
WebTimer |
setRepeats(boolean repeats)
Sets whether timer should repeat its cycles or not. |
WebTimer |
setUseEventDispatchThread(boolean useEventDispatchThread)
Sets whether actions should be fired from Event Dispatch Thread or not. |
protected boolean |
shouldContinue(int cycle,
int id)
Returns whether thread with specified ID should continue execution or not. |
WebTimer |
start()
Starts timer execution. |
protected void |
startExec()
Starts timer execution thread. |
WebTimer |
stop()
Stops timer execution. |
protected void |
stopExec()
Stops timer execution. |
java.lang.String |
toString()
|
static java.lang.String |
toStringDelay(long delay)
Returns delay string representation. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int msInDay
public static final int msInHour
public static final int msInMinute
public static final int msInSecond
public static java.lang.String defaultThreadName
public static int defaultCyclesLimit
public static boolean useEdtByDefault
protected final java.util.List<java.awt.event.ActionListener> listeners
protected int id
protected int lastId
protected final java.util.Map<java.lang.Integer,java.lang.Boolean> running
protected long sleepStart
protected long sleepTime
protected int cycleCount
protected java.lang.Thread exec
protected long delay
protected long initialDelay
protected boolean repeats
protected boolean coalesce
protected boolean useEventDispatchThread
protected java.lang.String actionCommand
protected java.lang.String name
protected int cyclesLimit
Constructor Detail |
---|
public WebTimer(java.lang.String delay)
delay
- delay between timer cyclesparseDelay(String)
public WebTimer(long delay)
delay
- delay between timer cycles in millisecondspublic WebTimer(java.lang.String name, java.lang.String delay)
name
- internal thread namedelay
- delay between timer cyclesparseDelay(String)
public WebTimer(java.lang.String name, long delay)
name
- internal thread namedelay
- delay between timer cycles in millisecondspublic WebTimer(long delay, long initialDelay)
delay
- delay between timer cycles in millisecondsinitialDelay
- delay before the first timer cycle run in millisecondspublic WebTimer(java.lang.String name, long delay, long initialDelay)
name
- internal thread namedelay
- delay between timer cycles in millisecondsinitialDelay
- delay before the first timer cycle run in millisecondspublic WebTimer(java.lang.String delay, java.awt.event.ActionListener listener)
delay
- delay between timer cycleslistener
- action listenerparseDelay(String)
public WebTimer(long delay, java.awt.event.ActionListener listener)
delay
- delay between timer cycles in millisecondslistener
- action listenerpublic WebTimer(java.lang.String name, java.lang.String delay, java.awt.event.ActionListener listener)
name
- internal thread namedelay
- delay between timer cycleslistener
- action listenerparseDelay(String)
public WebTimer(java.lang.String name, long delay, java.awt.event.ActionListener listener)
name
- internal thread namedelay
- delay between timer cycles in millisecondslistener
- action listenerpublic WebTimer(long delay, long initialDelay, java.awt.event.ActionListener listener)
delay
- delay between timer cycles in millisecondsinitialDelay
- delay before the first timer cycle run in millisecondslistener
- action listenerpublic WebTimer(java.lang.String name, java.lang.String delay, java.lang.String initialDelay, java.awt.event.ActionListener listener)
name
- internal thread namedelay
- delay between timer cyclesinitialDelay
- delay before the first timer cycle runlistener
- action listenerparseDelay(String)
public WebTimer(java.lang.String name, long delay, long initialDelay, java.awt.event.ActionListener listener)
name
- internal thread namedelay
- delay between timer cycles in millisecondsinitialDelay
- delay before the first timer cycle run in millisecondslistener
- action listenerMethod Detail |
---|
public long getInitialDelay()
public java.lang.String getInitialStringDelay()
public WebTimer setInitialDelay(java.lang.String initialDelay)
initialDelay
- delay before the first timer cycle run
public WebTimer setInitialDelay(long initialDelay)
initialDelay
- delay before the first timer cycle run in milliseconds
public long getDelay()
public java.lang.String getStringDelay()
public WebTimer setDelay(java.lang.String delay)
delay
- delay between timer cycles
public WebTimer setDelay(long delay)
delay
- delay between timer cycles in milliseconds
public boolean isRepeats()
public WebTimer setRepeats(boolean repeats)
repeats
- whether timer should repeat its cycles or not
public boolean isCoalesce()
public WebTimer setCoalesce(boolean coalesce)
coalesce
- whether each action should be fired from a separate invoke and wait call or not
public boolean isUseEventDispatchThread()
public WebTimer setUseEventDispatchThread(boolean useEventDispatchThread)
useEventDispatchThread
- whether actions should be fired from Event Dispatch Thread or not
public java.lang.String getActionCommand()
public WebTimer setActionCommand(java.lang.String actionCommand)
actionCommand
- action command for fired events
public int getCyclesLimit()
public WebTimer setCyclesLimit(int cyclesLimit)
cyclesLimit
- timer cycles execution limit
public java.lang.String getName()
public WebTimer setName(java.lang.String name)
name
- internal timer thread name
public long getCycleTimePassed()
public long getCycleTimeLeft()
public int getCycleCount()
public int getCycleNumber()
public boolean isLastCycle()
public WebTimer start()
public WebTimer stop()
public WebTimer restart()
public WebTimer restart(long delay)
delay
- delay between timer cycles
public WebTimer restart(long initialDelay, long delay)
initialDelay
- delay before the first timer cycle rundelay
- delay between timer cycles
public WebTimer restart(java.lang.String delay)
delay
- delay between timer cycles
public WebTimer restart(java.lang.String initialDelay, java.lang.String delay)
initialDelay
- delay before the first timer cycle rundelay
- delay between timer cycles
public boolean isRunning()
protected void startExec()
protected boolean shouldContinue(int cycle, int id)
cycle
- cycle numberid
- thread ID
protected void setAlive(int id, boolean alive)
id
- thread IDalive
- whether thread is alive or notprotected void cleanUp(int id)
id
- thread IDprotected void stopExec()
public WebTimer addActionListener(java.awt.event.ActionListener listener)
listener
- new action listener
public WebTimer removeActionListener(java.awt.event.ActionListener listener)
listener
- action listener
public java.util.List<java.awt.event.ActionListener> getListeners()
public void fireActionPerformed()
protected java.awt.event.ActionEvent createActionEvent()
public java.lang.String toString()
toString
in class java.lang.Object
public static WebTimer delay(java.lang.String delay, java.awt.event.ActionListener listener)
delay
- delay between timer cycleslistener
- action listener
parseDelay(String)
public static WebTimer delay(long delay, java.awt.event.ActionListener listener)
delay
- delay between timer cycles in millisecondslistener
- action listener
public static WebTimer delay(java.lang.String name, java.lang.String delay, java.awt.event.ActionListener listener)
name
- thread namedelay
- delay between timer cycleslistener
- action listener
parseDelay(String)
public static WebTimer delay(java.lang.String name, long delay, java.awt.event.ActionListener listener)
name
- thread namedelay
- delay between timer cycles in millisecondslistener
- action listener
public static WebTimer delay(java.lang.String delay, boolean useEventDispatchThread, java.awt.event.ActionListener listener)
delay
- delay between timer cyclesuseEventDispatchThread
- whether actions should be fired from Event Dispatch Thread or notlistener
- action listener
parseDelay(String)
public static WebTimer delay(long delay, boolean useEventDispatchThread, java.awt.event.ActionListener listener)
delay
- delay between timer cycles in millisecondsuseEventDispatchThread
- whether actions should be fired from Event Dispatch Thread or notlistener
- action listener
public static WebTimer delay(java.lang.String name, java.lang.String delay, boolean useEventDispatchThread, java.awt.event.ActionListener listener)
name
- thread namedelay
- delay between timer cyclesuseEventDispatchThread
- whether actions should be fired from Event Dispatch Thread or notlistener
- action listener
parseDelay(String)
public static WebTimer delay(java.lang.String name, long delay, boolean useEventDispatchThread, java.awt.event.ActionListener listener)
name
- thread namedelay
- delay between timer cycles in millisecondsuseEventDispatchThread
- whether actions should be fired from Event Dispatch Thread or notlistener
- action listener
public static WebTimer repeat(java.lang.String delay, java.awt.event.ActionListener listener)
delay
- delay between timer cycleslistener
- action listener
parseDelay(String)
public static WebTimer repeat(java.lang.String delay, int cyclesLimit, java.awt.event.ActionListener listener)
delay
- delay between timer cyclescyclesLimit
- timer cycles execution limitlistener
- action listener
parseDelay(String)
public static WebTimer repeat(long delay, java.awt.event.ActionListener listener)
delay
- delay between timer cycles in millisecondslistener
- action listener
public static WebTimer repeat(long delay, int cyclesLimit, java.awt.event.ActionListener listener)
delay
- delay between timer cycles in millisecondscyclesLimit
- timer cycles execution limitlistener
- action listener
public static WebTimer repeat(java.lang.String name, java.lang.String delay, java.awt.event.ActionListener listener)
name
- thread namedelay
- delay between timer cycleslistener
- action listener
parseDelay(String)
public static WebTimer repeat(java.lang.String name, java.lang.String delay, int cyclesLimit, java.awt.event.ActionListener listener)
name
- thread namedelay
- delay between timer cyclescyclesLimit
- timer cycles execution limitlistener
- action listener
parseDelay(String)
public static WebTimer repeat(java.lang.String name, long delay, java.awt.event.ActionListener listener)
name
- thread namedelay
- delay between timer cycles in millisecondslistener
- action listener
public static WebTimer repeat(java.lang.String name, long delay, int cyclesLimit, java.awt.event.ActionListener listener)
name
- thread namedelay
- delay between timer cycles in millisecondscyclesLimit
- timer cycles execution limitlistener
- action listener
public static WebTimer repeat(java.lang.String delay, boolean useEventDispatchThread, java.awt.event.ActionListener listener)
delay
- delay between timer cyclesuseEventDispatchThread
- whether actions should be fired from Event Dispatch Thread or notlistener
- action listener
parseDelay(String)
public static WebTimer repeat(java.lang.String delay, int cyclesLimit, boolean useEventDispatchThread, java.awt.event.ActionListener listener)
delay
- delay between timer cyclescyclesLimit
- timer cycles execution limituseEventDispatchThread
- whether actions should be fired from Event Dispatch Thread or notlistener
- action listener
parseDelay(String)
public static WebTimer repeat(long delay, boolean useEventDispatchThread, java.awt.event.ActionListener listener)
delay
- delay between timer cycles in millisecondsuseEventDispatchThread
- whether actions should be fired from Event Dispatch Thread or notlistener
- action listener
public static WebTimer repeat(long delay, int cyclesLimit, boolean useEventDispatchThread, java.awt.event.ActionListener listener)
delay
- delay between timer cycles in millisecondscyclesLimit
- timer cycles execution limituseEventDispatchThread
- whether actions should be fired from Event Dispatch Thread or notlistener
- action listener
public static WebTimer repeat(java.lang.String name, java.lang.String delay, boolean useEventDispatchThread, java.awt.event.ActionListener listener)
name
- thread namedelay
- delay between timer cyclesuseEventDispatchThread
- whether actions should be fired from Event Dispatch Thread or notlistener
- action listener
parseDelay(String)
public static WebTimer repeat(java.lang.String name, java.lang.String delay, int cyclesLimit, boolean useEventDispatchThread, java.awt.event.ActionListener listener)
name
- thread namedelay
- delay between timer cyclescyclesLimit
- timer cycles execution limituseEventDispatchThread
- whether actions should be fired from Event Dispatch Thread or notlistener
- action listener
parseDelay(String)
public static WebTimer repeat(java.lang.String name, long delay, boolean useEventDispatchThread, java.awt.event.ActionListener listener)
name
- thread namedelay
- delay between timer cycles in millisecondsuseEventDispatchThread
- whether actions should be fired from Event Dispatch Thread or notlistener
- action listener
public static WebTimer repeat(java.lang.String name, long delay, int cyclesLimit, boolean useEventDispatchThread, java.awt.event.ActionListener listener)
name
- thread namedelay
- delay between timer cycles in millisecondscyclesLimit
- timer cycles execution limituseEventDispatchThread
- whether actions should be fired from Event Dispatch Thread or notlistener
- action listener
public static WebTimer repeat(long delay, long initialDelay, java.awt.event.ActionListener listener)
delay
- delay between timer cycles in millisecondsinitialDelay
- delay before the first timer cycle run in millisecondslistener
- action listener
public static WebTimer repeat(long delay, long initialDelay, int cyclesLimit, java.awt.event.ActionListener listener)
delay
- delay between timer cycles in millisecondsinitialDelay
- delay before the first timer cycle run in millisecondscyclesLimit
- timer cycles execution limitlistener
- action listener
public static WebTimer repeat(java.lang.String name, long delay, long initialDelay, java.awt.event.ActionListener listener)
name
- thread namedelay
- delay between timer cycles in millisecondsinitialDelay
- delay before the first timer cycle run in millisecondslistener
- action listener
public static WebTimer repeat(java.lang.String name, long delay, long initialDelay, int cyclesLimit, java.awt.event.ActionListener listener)
name
- thread namedelay
- delay between timer cycles in millisecondsinitialDelay
- delay before the first timer cycle run in millisecondscyclesLimit
- timer cycles execution limitlistener
- action listener
public static WebTimer repeat(long delay, long initialDelay, boolean useEventDispatchThread, java.awt.event.ActionListener listener)
delay
- delay between timer cycles in millisecondsinitialDelay
- delay before the first timer cycle run in millisecondsuseEventDispatchThread
- whether actions should be fired from Event Dispatch Thread or notlistener
- action listener
public static WebTimer repeat(long delay, long initialDelay, int cyclesLimit, boolean useEventDispatchThread, java.awt.event.ActionListener listener)
delay
- delay between timer cycles in millisecondsinitialDelay
- delay before the first timer cycle run in millisecondscyclesLimit
- timer cycles execution limituseEventDispatchThread
- whether actions should be fired from Event Dispatch Thread or notlistener
- action listener
public static WebTimer repeat(java.lang.String name, long delay, long initialDelay, boolean useEventDispatchThread, java.awt.event.ActionListener listener)
name
- thread namedelay
- delay between timer cycles in millisecondsinitialDelay
- delay before the first timer cycle run in millisecondsuseEventDispatchThread
- whether actions should be fired from Event Dispatch Thread or notlistener
- action listener
public static WebTimer repeat(java.lang.String name, long delay, long initialDelay, int cyclesLimit, boolean useEventDispatchThread, java.awt.event.ActionListener listener)
name
- thread namedelay
- delay between timer cycles in millisecondsinitialDelay
- delay before the first timer cycle run in millisecondscyclesLimit
- timer cycles execution limituseEventDispatchThread
- whether actions should be fired from Event Dispatch Thread or notlistener
- action listener
public static long parseDelay(java.lang.String delay) throws DelayFormatException
delay
- string delay
DelayFormatException
public static java.lang.String toStringDelay(long delay)
delay
- delay to process
public static void invokeAndWait(java.lang.Runnable runnable) throws java.lang.InterruptedException, java.lang.reflect.InvocationTargetException
runnable
- runnable
java.lang.InterruptedException
java.lang.reflect.InvocationTargetException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |