edu.umd.cs.piccolo.activities
Class PActivityScheduler

java.lang.Object
  extended by edu.umd.cs.piccolo.activities.PActivityScheduler

public class PActivityScheduler
extends java.lang.Object

PActivityScheduler is responsible for maintaining a list of activities. It is given a chance to process these activities from the PRoot's processInputs() method. Most users will not need to use the PActivityScheduler directly, instead you should look at:

Version:
1.0
Author:
Jesse Grosjean

Constructor Summary
PActivityScheduler(PRoot rootNode)
           
 
Method Summary
 void addActivity(PActivity activity)
           
 void addActivity(PActivity activity, boolean processLast)
          Add this activity to the scheduler.
 java.util.List getActivitiesReference()
           
protected  javax.swing.Timer getActivityTimer()
           
 boolean getAnimating()
          Return true if any of the scheduled activities return true to the message isAnimation();
 PRoot getRoot()
           
 void processActivities(long currentTime)
          Process all scheduled activities for the given time.
 void removeActivity(PActivity activity)
           
 void removeAllActivities()
           
protected  void startActivityTimer()
           
protected  void stopActivityTimer()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PActivityScheduler

public PActivityScheduler(PRoot rootNode)
Method Detail

getRoot

public PRoot getRoot()

addActivity

public void addActivity(PActivity activity)

addActivity

public void addActivity(PActivity activity,
                        boolean processLast)
Add this activity to the scheduler. Sometimes it's useful to make sure that an activity is run after all other activities have been run. To do this set processLast to true when adding the activity.


removeActivity

public void removeActivity(PActivity activity)

removeAllActivities

public void removeAllActivities()

getActivitiesReference

public java.util.List getActivitiesReference()

processActivities

public void processActivities(long currentTime)
Process all scheduled activities for the given time. Each activity is given one "step", equivalent to one frame of animation.


getAnimating

public boolean getAnimating()
Return true if any of the scheduled activities return true to the message isAnimation();


startActivityTimer

protected void startActivityTimer()

stopActivityTimer

protected void stopActivityTimer()

getActivityTimer

protected javax.swing.Timer getActivityTimer()


Copyright 2005 by University of Maryland, College Park, MD 20742, USA All rights reserved.

Web Accessibility