fr.inria.insitu.glite.activities
Class ActivityScheduler

java.lang.Object
  extended by fr.inria.insitu.glite.activities.ActivityScheduler

public class ActivityScheduler
extends Object

ActivityScheduler is responsible for maintaining a list of activities. Most users will not need to use the ActivityScheduler directly, instead you should look at:

Version:
1.0
Author:
Jesse Grosjean

Constructor Summary
ActivityScheduler()
          Creates an ActivityScheduler given a LiteComponent.
 
Method Summary
 void addActivity(Activity activity)
          Adds an activity.
 void addActivity(Activity activity, boolean processLast)
          Add this activity to the scheduler.
 boolean getAnimating()
           
 long getCurrentTime()
           
static ActivityScheduler getInstance()
           
 LiteComponent getRoot()
           
 void processActivities(long currentTime)
          Process all scheduled activities for the given time.
 void removeActivity(Activity activity)
          Removes a specified activity.
 void removeAllActivities()
          Removes all the activities.
 void setRoot(LiteComponent root)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ActivityScheduler

public ActivityScheduler()
Creates an ActivityScheduler given a LiteComponent.

Method Detail

getInstance

public static ActivityScheduler getInstance()
Returns:
the instance

addActivity

public void addActivity(Activity activity)
Adds an activity.

Parameters:
activity - the activity

addActivity

public void addActivity(Activity 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.

Parameters:
activity - the activity
processLast - true if the activity should run last

removeActivity

public void removeActivity(Activity activity)
Removes a specified activity.

Parameters:
activity - the activity to remove

removeAllActivities

public void removeAllActivities()
Removes all the activities.


getCurrentTime

public long getCurrentTime()
Returns:
the currentTime.

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.

Parameters:
currentTime - the current time.

getAnimating

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

getRoot

public LiteComponent getRoot()
Returns:
the root

setRoot

public void setRoot(LiteComponent root)
Parameters:
root - the root to set


Copyright © 2006 by Jean-Daniel Fekete and INRIA, France All rights reserved.