edu.cmu.hcii.calo.view.task.TaskSubpaneView.TaskWatcher Class Reference

Collaboration diagram for edu.cmu.hcii.calo.view.task.TaskSubpaneView.TaskWatcher:

Collaboration graph
[legend]
List of all members.

Detailed Description

A helper class that remembers the previous state of the TaskManager and the mappings between Tasks and TaskViews.

This allows the subpane to determine what tasks have been added, removed, and reordered since the last update, which allows it to determine what it should animate and what it should not.

Author:
Brian Ellis


Public Member Functions

 TaskWatcher (TaskFilter filter)
 Constructs a new TaskWatcher.
void forgetRects ()
 Causes the TaskWatcher to forget about all the rects it has stored for various TaskViews.
void forgetViews ()
 Causes the TaskWatcher to forget about all the views it has stored for various Tasks.
List< TasklikeObjectgetAddedTasks ()
 Gets a list of all the Tasks that have been added to the TaskManager since the last time rememberCurrentTasks() was called.
Rectangle getRememberedRect (TaskView view)
 Returns the remembered Rectangle for the given TaskView, or null if we do not remember this view (that is, if rememberRect() has not been called with this view as the argument since the last time forgetRects() was called).
List< TasklikeObjectgetRemovedTasks ()
 Gets a list of all the Tasks that have been removed from the TaskManager since the last time rememberCurrentTasks() was called.
List< TasklikeObjectgetReorderedTasks ()
 Gets a list of all the Tasks that have been reordered within the TaskManager since the last time rememberCurrentTasks() was called.
TaskView getViewForTask (Task task)
 Returns the TaskView associated with the given Task, or null if we do not remember a view for this Task (that is, if rememberView() has not been called with this Task as the parameter since the last time forgetViews() was called).
void pruneViews ()
 Removes from the list of remembered views any views associated with Tasks that are no longer in the TaskManager.
void rememberCurrentTasks ()
 Causes subsequent calls to getAddedTasks(), getRemovedTasks(), and getReorderedTasks() to return the tasks that have been added, removed, or reordered (respectively) since the moment this method was called.
void rememberRect (TaskView view)
 Remembers the Rectangle defining the bounds of this view at the time this method is called.
void rememberView (TaskView view)
 Remembers the mapping between this view and its associated task.

Private Member Functions

List< TasklikeObjectgetFilteredTasks ()
 Gets a list of all relevant tasks in the TaskManager, where relevant is defined by the filter passed to this TaskWatcher in the constructor.

Private Attributes

ArrayList< TasklikeObjectoldTasks = new ArrayList<TasklikeObject>()
 The ordered list of relevant tasks that were in the TaskManager the last time rememberCurrentTasks() was called.
HashMap< Component, Rectangle > oldRects = new HashMap<Component, Rectangle>()
 The rectangles of all the views that have been remembered (using rememberRect()) since the last time forgetRects() was called.
HashMap< Task, TaskViewtaskMap = new HashMap<Task, TaskView>()
 The views associated with all the tasks that have been remembered (using rememberView()) since the last time forgetViews() was called.
TaskFilter taskFilter
 The filter that determines which tasks are considered relevant.


Constructor & Destructor Documentation

edu.cmu.hcii.calo.view.task.TaskSubpaneView.TaskWatcher.TaskWatcher ( TaskFilter  filter  ) 

Constructs a new TaskWatcher.

Parameters:
filter the filter to use when determining whether we need to know about changes to a Task


Member Function Documentation

void edu.cmu.hcii.calo.view.task.TaskSubpaneView.TaskWatcher.forgetRects (  ) 

Causes the TaskWatcher to forget about all the rects it has stored for various TaskViews.

void edu.cmu.hcii.calo.view.task.TaskSubpaneView.TaskWatcher.forgetViews (  ) 

Causes the TaskWatcher to forget about all the views it has stored for various Tasks.

List<TasklikeObject> edu.cmu.hcii.calo.view.task.TaskSubpaneView.TaskWatcher.getAddedTasks (  ) 

Gets a list of all the Tasks that have been added to the TaskManager since the last time rememberCurrentTasks() was called.

Returns:
the list of added tasks

List<TasklikeObject> edu.cmu.hcii.calo.view.task.TaskSubpaneView.TaskWatcher.getFilteredTasks (  )  [private]

Gets a list of all relevant tasks in the TaskManager, where relevant is defined by the filter passed to this TaskWatcher in the constructor.

Returns:
the list of relevant tasks

Rectangle edu.cmu.hcii.calo.view.task.TaskSubpaneView.TaskWatcher.getRememberedRect ( TaskView  view  ) 

Returns the remembered Rectangle for the given TaskView, or null if we do not remember this view (that is, if rememberRect() has not been called with this view as the argument since the last time forgetRects() was called).

Parameters:
view the view whose Rectangle should be remembered
Returns:
the Rectangle, or null if we don't remember it

List<TasklikeObject> edu.cmu.hcii.calo.view.task.TaskSubpaneView.TaskWatcher.getRemovedTasks (  ) 

Gets a list of all the Tasks that have been removed from the TaskManager since the last time rememberCurrentTasks() was called.

Returns:
the list of removed tasks

List<TasklikeObject> edu.cmu.hcii.calo.view.task.TaskSubpaneView.TaskWatcher.getReorderedTasks (  ) 

Gets a list of all the Tasks that have been reordered within the TaskManager since the last time rememberCurrentTasks() was called.

Note:
Reordering is defined as follows: A task has been reordered if:
  1. it exists in the TaskManager and also existed the last time rememberCurrentTasks() was called, and
  2. its index in the ordered list of all relevant tasks currently in the manager (including those that have since been added) is not equal to its index in the ordered list of all relevant tasks in the manager when rememberCurrentTasks() was called (including those that have since been removed).
Returns:
the list of reordered tasks

TaskView edu.cmu.hcii.calo.view.task.TaskSubpaneView.TaskWatcher.getViewForTask ( Task  task  ) 

Returns the TaskView associated with the given Task, or null if we do not remember a view for this Task (that is, if rememberView() has not been called with this Task as the parameter since the last time forgetViews() was called).

Parameters:
task the task to remember a view for
Returns:
the view for this task, or null if we don't remember a view for this task

void edu.cmu.hcii.calo.view.task.TaskSubpaneView.TaskWatcher.pruneViews (  ) 

Removes from the list of remembered views any views associated with Tasks that are no longer in the TaskManager.

void edu.cmu.hcii.calo.view.task.TaskSubpaneView.TaskWatcher.rememberCurrentTasks (  ) 

Causes subsequent calls to getAddedTasks(), getRemovedTasks(), and getReorderedTasks() to return the tasks that have been added, removed, or reordered (respectively) since the moment this method was called.

Remembering the current tasks causes TaskWatcher to forget about any previous tasks it might already have been remembering.

void edu.cmu.hcii.calo.view.task.TaskSubpaneView.TaskWatcher.rememberRect ( TaskView  view  ) 

Remembers the Rectangle defining the bounds of this view at the time this method is called.

Subsequent calls to getRememberedRect() with this view as the parameter will return this Rectangle.

Parameters:
view the view whose rectangle we should remember

void edu.cmu.hcii.calo.view.task.TaskSubpaneView.TaskWatcher.rememberView ( TaskView  view  ) 

Remembers the mapping between this view and its associated task.

Subsequent calls to getViewForTask() with this view's task as the parameter will return this view.

Parameters:
view the view to remember


Member Data Documentation

ArrayList<TasklikeObject> edu.cmu.hcii.calo.view.task.TaskSubpaneView.TaskWatcher.oldTasks = new ArrayList<TasklikeObject>() [private]

The ordered list of relevant tasks that were in the TaskManager the last time rememberCurrentTasks() was called.

HashMap<Component, Rectangle> edu.cmu.hcii.calo.view.task.TaskSubpaneView.TaskWatcher.oldRects = new HashMap<Component, Rectangle>() [private]

The rectangles of all the views that have been remembered (using rememberRect()) since the last time forgetRects() was called.

HashMap<Task, TaskView> edu.cmu.hcii.calo.view.task.TaskSubpaneView.TaskWatcher.taskMap = new HashMap<Task, TaskView>() [private]

The views associated with all the tasks that have been remembered (using rememberView()) since the last time forgetViews() was called.

TaskFilter edu.cmu.hcii.calo.view.task.TaskSubpaneView.TaskWatcher.taskFilter [private]

The filter that determines which tasks are considered relevant.


The documentation for this class was generated from the following file:
Generated on Mon Aug 13 15:06:27 2007 for CALO by  doxygen 1.5.2