com.swfm.mica.core
Class MiPartModifierThread

java.lang.Object
  extended byjava.lang.Thread
      extended bycom.swfm.mica.core.MiPartModifierThread
All Implemented Interfaces:
java.lang.Runnable

public class MiPartModifierThread
extends java.lang.Thread

Version:
%I% %G%
Author:
Michael L. Davis

Field Summary
   
Constructor Summary
MiPartModifierThread(MiCanvas canvas)
          Constructs a new MiPartModifierThread for the given canvas.
 
Method Summary
 MiCanvas getCanvas()
          Gets the canvas this thread runs on.
 boolean isStopped()
           
 MiPartModifierThread makeNewRunningThread()
          Convience method that calls the associated canvas's makeNewRunningThread method.
 void notifyAllThreads()
          Convience method that calls the associated canvas's notifySelf method.
 void stopThread()
          Frees all access locks the calling thread has on the associated canvas, and the stops the calling thread.
 void waitThread()
          Frees all access locks the calling thread has on the associated canvas, wait on the canvas for a notify event, and then get all the access locks back again, and return.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, run, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MiPartModifierThread

public MiPartModifierThread(MiCanvas canvas)
Constructs a new MiPartModifierThread for the given canvas.

Parameters:
canvas - the canvas this thread will run on.
Method Detail

getCanvas

public MiCanvas getCanvas()
Gets the canvas this thread runs on.

Returns:
the associated canvas

waitThread

public void waitThread()
Frees all access locks the calling thread has on the associated canvas, wait on the canvas for a notify event, and then get all the access locks back again, and return. This is used to allow another thread access to the associated canvas, which then does it's thing, and when done calls notifyAllThreads to notify threads like this one that they can start running again.

See Also:
MiCanvas, notifyAllThreads(), MiCanvas.notifySelf()

stopThread

public void stopThread()
Frees all access locks the calling thread has on the associated canvas, and the stops the calling thread.

See Also:
MiCanvas, waitThread()

isStopped

public boolean isStopped()

makeNewRunningThread

public MiPartModifierThread makeNewRunningThread()
Convience method that calls the associated canvas's makeNewRunningThread method.

Returns:
The new thread
See Also:
MiCanvas.makeNewRunningThread()

notifyAllThreads

public void notifyAllThreads()
Convience method that calls the associated canvas's notifySelf method.

See Also:
MiCanvas.notifySelf()