public class TickTimer extends Object
| Constructor and Description |
|---|
TickTimer()
Constructs a new timer with the onTick method invoked within Swing's EDT.
|
TickTimer(boolean synchronizeWithSwing)
Constructs a new timer with a given method of synchronization with
Swing's EDT.
|
TickTimer(String name)
Constructs a new timer with a given name and the onTick method invoked
within Swing's EDT
|
TickTimer(String name,
boolean synchronizeWithSwing)
Constructs a new timer with a given name and a given method of
synchronization with Swing's EDT.
|
| Modifier and Type | Method and Description |
|---|---|
long |
getTickPeriod()
Gets the time period (in milliseconds) in which the onTick method is
executed.
|
boolean |
isEnabled()
Returns whether tick timer is enabled
|
boolean |
isSynchronizedWithSwing()
Returns whether the onTick method is invoked within Swing's EDT.
|
protected void |
onTick()
Called periodically by the pane.
|
void |
setEnabled(boolean enabled)
Sets activity of the tick timer.
|
void |
setTickPeriod(long tickPeriod)
Sets the time period (in milliseconds) in which the onTick method is
executed.
|
public TickTimer()
public TickTimer(String name)
name - the desired name of this tick timer. The name is used in error
messages when an exception from onTick is caught.public TickTimer(boolean synchronizeWithSwing)
synchronizeWithSwing - true, for onTick invoked within Swing's EDT, false otherwisepublic TickTimer(String name, boolean synchronizeWithSwing)
name - the desired name of this tick timer. The name is used in error
messages when an exception from onTick is caught.synchronizeWithSwing - true, for onTick invoked within Swing's EDT, false otherwisepublic long getTickPeriod()
public void setTickPeriod(long tickPeriod)
tickPeriod - the tick period in milliseconds.public boolean isSynchronizedWithSwing()
public boolean isEnabled()
public void setEnabled(boolean enabled)
enabled - true, to enabled, false to disable timer fuctionalityprotected void onTick()
Copyright © 2017. All rights reserved.