Modifier and Type | Interface and Description |
---|---|
static interface |
Timer.ActionListener
Deprecated.
Use
addTimerActionListener(Consumer) with lambda instead. |
static interface |
Timer.StopListener
Deprecated.
Use
addTimerStopListener(Consumer) with lambda instead. |
static class |
Timer.TimerActionEvent
Event fired on timer tick.
|
static class |
Timer.TimerStopEvent
Event fired on timer stop after
stop() call. |
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
NAME |
Modifier and Type | Method and Description |
---|---|
default void |
addActionListener(Timer.ActionListener listener)
Deprecated.
Use
addTimerActionListener(Consumer) instead |
default void |
addStopListener(Timer.StopListener listener)
Deprecated.
Use
addTimerStopListener(Consumer) instead |
Subscription |
addTimerActionListener(java.util.function.Consumer<Timer.TimerActionEvent> listener)
Adds
Timer.TimerActionEvent listener. |
Subscription |
addTimerStopListener(java.util.function.Consumer<Timer.TimerStopEvent> listener)
Adds
Timer.TimerStopEvent listener. |
int |
getDelay() |
boolean |
isRepeating() |
default void |
removeActionListener(Timer.ActionListener listener)
Deprecated.
Use
removeTimerActionListener(Consumer) instead |
default void |
removeStopListener(Timer.StopListener listener)
Deprecated.
Use
removeTimerStopListener(Consumer) instead |
void |
removeTimerActionListener(java.util.function.Consumer<Timer.TimerActionEvent> listener)
Deprecated.
Use subscription object instead
|
void |
removeTimerStopListener(java.util.function.Consumer<Timer.TimerStopEvent> listener)
Deprecated.
Use subscription object instead
|
void |
setDelay(int delayMs) |
void |
setRepeating(boolean repeating)
Sets repetitive mode for timer action.
|
void |
start()
Starts timer.
|
void |
stop()
Stops timer if it is running.
|
static final java.lang.String NAME
boolean isRepeating()
void setRepeating(boolean repeating)
repeating
- repeating flagint getDelay()
void setDelay(int delayMs)
delayMs
- delay in milliseconds.void start()
void stop()
Subscription addTimerActionListener(java.util.function.Consumer<Timer.TimerActionEvent> listener)
Timer.TimerActionEvent
listener.listener
- listenerSubscription addTimerStopListener(java.util.function.Consumer<Timer.TimerStopEvent> listener)
Timer.TimerStopEvent
listener.listener
- listener@Deprecated void removeTimerActionListener(java.util.function.Consumer<Timer.TimerActionEvent> listener)
Timer.TimerActionEvent
listener.listener
- listener@Deprecated void removeTimerStopListener(java.util.function.Consumer<Timer.TimerStopEvent> listener)
Timer.TimerStopEvent
listener.listener
- listener@Deprecated default void addActionListener(Timer.ActionListener listener)
addTimerActionListener(Consumer)
instead@Deprecated default void removeActionListener(Timer.ActionListener listener)
removeTimerActionListener(Consumer)
instead@Deprecated default void addStopListener(Timer.StopListener listener)
addTimerStopListener(Consumer)
instead@Deprecated default void removeStopListener(Timer.StopListener listener)
removeTimerStopListener(Consumer)
instead