de.cau.cs.kieler.core.kivi.internal
Class EffectsWorker

java.lang.Object
  extended by java.lang.Thread
      extended by de.cau.cs.kieler.core.kivi.internal.EffectsWorker
All Implemented Interfaces:
Runnable

public class EffectsWorker
extends Thread

Worker thread that handles the execution of effects.

Rating red

Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
EffectsWorker()
          Default constructor, sets thread name as effects.
 
Method Summary
 void addEffectsListener(IEffectsListener listener)
          Add an effects listener to the worker.
 void enqueueEffect(IEffect effect)
          Enqueue a single effect for execution.
 int getQueueSize()
          Get the current size of the queue.
 void removeEffectsListener(IEffectsListener listener)
          Remove an effects listener from the worker.
 void run()
          When an object implementing interface Runnable is used to create a thread, starting the thread causes the object's run method to be called in that separately executing thread.
 void undoEffect(IEffect effect)
          Undo a single effect.
 
Methods inherited from class java.lang.Thread
currentThread, getName, getPriority, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, setDaemon, setName, setPriority, sleep, start, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EffectsWorker

public EffectsWorker()
Default constructor, sets thread name as effects.

Method Detail

run

public void run()
Description copied from interface: Runnable
When an object implementing interface Runnable is used to create a thread, starting the thread causes the object's run method to be called in that separately executing thread.

Specified by:
run in interface Runnable
Overrides:
run in class Thread

getQueueSize

public int getQueueSize()
Get the current size of the queue.

Returns:
size of the queue as an integer

enqueueEffect

public void enqueueEffect(IEffect effect)
Enqueue a single effect for execution.

Parameters:
effect - the effect to execute

undoEffect

public void undoEffect(IEffect effect)
Undo a single effect.

Parameters:
effect - the effect to undo

addEffectsListener

public void addEffectsListener(IEffectsListener listener)
Add an effects listener to the worker.

Parameters:
listener - the listener to add

removeEffectsListener

public void removeEffectsListener(IEffectsListener listener)
Remove an effects listener from the worker.

Parameters:
listener - the listener to remove