prefuse.activity
Class ActivityManager

java.lang.Object
  extended by java.lang.Thread
      extended by prefuse.activity.ActivityManager
All Implemented Interfaces:
java.lang.Runnable

public class ActivityManager
extends java.lang.Thread

The ActivityManager is responsible for scheduling and running timed activities that perform data processing and animation.

The AcivityManager runs in its own separate thread of execution, and one instance is used to schedule activities from any number of currently active visualizations. The class is implemented as a singleton; the single instance of this class is interacted with through static methods. These methods are called by an Activity's run methods, and so are made only package visible here.

Activity instances can be scheduled by using their Activity.run(), Activity.runAt(long), and Activity.runAfter(Activity) methods. These will automatically call the appropriate methods with the ActivityManager.

For Action instances, one can also register the actions with a Visualization and use the visualizations provided run methods to launch Actions in a convenient fashion. The interface, which is backed by an ActivityMap instance, also provides a useful level of indirection, allowing actions to be changed dynamically without changes to code in other locations.

Author:
jeffrey heer
See Also:
ActivityManager.ScheduleAfterActivity, Action

Nested Class Summary
 class ActivityManager.ScheduleAfterActivity
           
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Method Summary
static int activityCount()
          Returns the number of scheduled activities
 void run()
          Main scheduling thread loop.
static void stopThread()
          Stops the activity manager thread.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

stopThread

public static void stopThread()
Stops the activity manager thread. All scheduled actvities are canceled, and then the thread is then notified to stop running.


activityCount

public static int activityCount()
Returns the number of scheduled activities

Returns:
the number of scheduled activities

run

public void run()
Main scheduling thread loop. This is automatically started upon initialization of the ActivityManager.

Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread


Copyright © 2007 Regents of the University of California