com.hdcookbook.grin.util
Class SetupManager

java.lang.Object
  extended by com.hdcookbook.grin.util.SetupManager
All Implemented Interfaces:
java.lang.Runnable

public class SetupManager
extends java.lang.Object
implements java.lang.Runnable

A SetupManager manages a low-priority thread that's used to set up GRIN features, by doing things like loading images. This way, image loading and other setup work can proceed in the background, while other features (that are already set up) animate or are otherwise active.

At present, all setup work is serialized into one thread, but a future extension might allow for concurrent execution of setup activity (e.g. for a dual-core system or suchlike).

Author:
Bill Foote (http://jovial.com)

Constructor Summary
SetupManager(int numFeatures)
          Create a SetupManager for setting up a maximum of numFeatures clients.
 
Method Summary
 void run()
          This isn't really public; it's only called by our worker thread.
 void scheduleSetup(SetupClient f)
           
 void start()
          Start providing service from this SetupManager.
 void stop()
          Stop providing service from this SetupManager.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SetupManager

public SetupManager(int numFeatures)
Create a SetupManager for setting up a maximum of numFeatures clients.

Method Detail

start

public void start()
Start providing service from this SetupManager. This must be balanced by a call to stop().

See Also:
stop()

stop

public void stop()
Stop providing service from this SetupManager. Once stopped, a manager cannot be re-started.

See Also:
start()

scheduleSetup

public void scheduleSetup(SetupClient f)

run

public void run()
This isn't really public; it's only called by our worker thread.

Specified by:
run in interface java.lang.Runnable