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.
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< TasklikeObject > | getAddedTasks () |
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< TasklikeObject > | getRemovedTasks () |
Gets a list of all the Tasks that have been removed from the TaskManager since the last time rememberCurrentTasks() was called. | |
List< TasklikeObject > | getReorderedTasks () |
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< TasklikeObject > | getFilteredTasks () |
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< TasklikeObject > | oldTasks = 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, TaskView > | taskMap = 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. |
edu.cmu.hcii.calo.view.task.TaskSubpaneView.TaskWatcher.TaskWatcher | ( | TaskFilter | filter | ) |
Constructs a new TaskWatcher.
filter | the filter to use when determining whether we need to know about changes to a Task |
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.
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.
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).
view | the view whose Rectangle should be remembered |
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.
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.
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).
task | the task to remember a view for |
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.
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.
view | the view to remember |
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.
The filter that determines which tasks are considered relevant.