de.jreality.tools
Class Timer

java.lang.Object
  extended by javax.swing.Timer
      extended by de.jreality.tools.Timer
All Implemented Interfaces:
Serializable

public class Timer
extends Timer

This is a drop-in replacement for javax.swing.Timer, when using in jreality. Note that both timer queueing and the timer tasks are running in the tool system thread - to perform gui tasks you need to make sure that the action is performed in the EventDispatchThread.

The coalesce flag has no influence for this timer, since both queueing and execution happens in the same thread. Therefore, coalescing is implicitly true. NOTE: The timer will not do anything unless you call ToolUtility.attachTimer(...)!

Author:
Steffen Weissmann
See Also:
Serialized Form

Constructor Summary
Timer(int delay, ActionListener listener)
           
 
Method Summary
 void attach(AnimatorTool at)
           
 void attach(SceneGraphComponent cmp)
           
 void attach(ToolContext tc)
           
 void attach(ToolSystem ts)
           
 boolean isRunning()
          Returns true if the Timer is running.
 void start()
          Starts the Timer, causing it to start sending action events to its listeners.
 void stop()
          Stops the Timer, causing it to stop sending action events to its listeners.
 
Methods inherited from class javax.swing.Timer
addActionListener, getActionCommand, getActionListeners, getDelay, getInitialDelay, getListeners, getLogTimers, isCoalesce, isRepeats, removeActionListener, restart, setActionCommand, setCoalesce, setDelay, setInitialDelay, setLogTimers, setRepeats
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Timer

public Timer(int delay,
             ActionListener listener)
Method Detail

attach

public void attach(ToolSystem ts)

attach

public void attach(ToolContext tc)

attach

public void attach(AnimatorTool at)

attach

public void attach(SceneGraphComponent cmp)

start

public void start()
Starts the Timer, causing it to start sending action events to its listeners.

Overrides:
start in class Timer
See Also:
stop()

isRunning

public boolean isRunning()
Returns true if the Timer is running.

Overrides:
isRunning in class Timer
See Also:
start()

stop

public void stop()
Stops the Timer, causing it to stop sending action events to its listeners.

Overrides:
stop in class Timer
See Also:
start()