public class MotionKiller extends TimerTask
Modifier and Type | Field and Description |
---|---|
protected int |
cycle |
protected boolean |
enabled |
static boolean |
INITIALLY_ENABLED |
protected int |
maxCycle |
protected com.touchgraph.graphlayout.TGPanel |
tgPanel |
protected long |
waitUntil1 |
protected long |
waitUntil2 |
Constructor and Description |
---|
MotionKiller(com.touchgraph.graphlayout.TGPanel tgPanel,
long millis)
Create a MotionKiller for the given tgPanel, scheduled to run every
'millis' number of milliseconds after creation.
|
Modifier and Type | Method and Description |
---|---|
boolean |
getEnabled() |
void |
run()
This method is called on schedula by the timer.
|
void |
setEnabled(boolean enabled)
Enables/disables this motion killer.
|
protected void |
setMaxCycle(int maxCycle) |
void |
waitFor(long duration1,
long duration2)
Wait for 'duration1' milliseconds before slowing down the motion,
then wait for 'duration2' milliseconds before stopping the motion,
|
cancel, scheduledExecutionTime
public static final boolean INITIALLY_ENABLED
protected com.touchgraph.graphlayout.TGPanel tgPanel
protected long waitUntil1
protected long waitUntil2
protected int cycle
protected int maxCycle
protected boolean enabled
public MotionKiller(com.touchgraph.graphlayout.TGPanel tgPanel, long millis)
tgPanel
- The TGPanel for which to stop the motion.millis
- The milliseconds between every time the motion is stoppedpublic void waitFor(long duration1, long duration2)
public void run()
public void setEnabled(boolean enabled)
public boolean getEnabled()
protected void setMaxCycle(int maxCycle)