Inheritance diagram for edu.cmu.hcii.calo.view.task.TaskSubpaneView:
Public Member Functions | |
TaskSubpaneView (String title, int normalCount, TaskFilter filter) | |
Constructs a TaskSubpaneView with the given normal task count and task taskFilter. | |
int | countShownTasks () |
Returns the number of tasks that can be shown in the subpane. | |
TaskFilter | getFilter () |
Gets the filter currently being applied to this subpane if there is one, or null otherwise. | |
boolean | isCollapsed () |
Returns whether this subpane is currently collapsed. | |
boolean | isShowingAll () |
Returns whether this subpane is currently showing all tasks (i.e., maximized). | |
boolean | isValid () |
Called by Swing to determine whether to revalidate the layout of this component. | |
void | paint (Graphics graphics) |
Paints the subpane normally, then superimposes a drop target indicator if a drag is currently in progress that would result in the dragging task being dropped between two other tasks. | |
void | paintComponent (Graphics graphics) |
Paints the subpane's background, including a nice pretty gradient along the bottom to match the one painted by the title view. | |
void | setCollapsed (boolean isCollapsed) |
Sets whether this subpane is collapsed. | |
void | setFilter (TaskFilter filter) |
Sets the filter used in this subpane. | |
void | setShowingAll (boolean isShowingAll) |
Sets whether this subpane is showing all tasks (i.e., maximized). | |
void | updateTasks () |
Updates the state of all task views in this subpane, without actually updating the subpane itself. | |
Static Public Member Functions | |
static void | main (String[] args) |
A test program that creates and shows a TaskSubpaneView. | |
Static Public Attributes | |
static final double | ANIMATION_DURATION = 0.75 |
The duration of subpane animations, in seconds. | |
Protected Member Functions | |
void | clearDrop () |
Resets all the subpane state relating to drag and drop and repaints the subpane so that no drop target is drawn. | |
boolean | doAnimations () |
Should be implemented to record the positions of all the components in the view so they can be animated from their old positions, and then create and start the necessary Animation objects to perform these animations. | |
void | doUpdate () |
Lays out all the TaskManager's tasks in order of descending priority. | |
void | prepareAnimations () |
Should be implemented to record the positions of all the components in the view so they can be animated to their new positions later. | |
void | safeUpdateAnimation (Animation a) |
Should be implemented to process an updated animation, just like AnimationListener.animationDidUpdate(Animation). | |
void | setDropBetween (TaskView previousSibling, TaskView nextSibling) |
Sets the drag-and-drop related state of this subpane based on the views passed, and repaints the subpane to show the drop target indicator. | |
Protected Attributes | |
String | title |
The title of this subpane. | |
Package Attributes | |
int | normalCount = 0 |
The number of items that should be shown in this view when it is in the "normal" state. | |
JButton | moreLink |
The link at the bottom of the subpane that allows the user to see more or fewer items. | |
Private Member Functions | |
void | setup () |
Sets up the appearance of the view. | |
Private Attributes | |
boolean | isShowingAll = false |
Whether or not this subpane is maximized, that is, showing all tasks (rather than just the first few). | |
TaskWatcher | taskWatcher |
The TaskWatcher that helps us keep track of what's going on in the subpane between updates. | |
TaskSubpaneTitleView | titleView |
The title view for this subpane. | |
Filtering | |
Fields used in filtering tasks within the subpane. | |
int | numFilteredTasks |
The number of tasks that made it through both the base filter and any additional filter. | |
TaskFilter | baseFilter |
The TaskFilter that is used to determine which tasks show up in this subpane before any other filter is applied. | |
TaskFilter | filter |
An additional filter to be applied on top of the base filter for this subpane. | |
Drag and Drop | |
Fields used when dealing with drag-and-drop of task views within the subpane. | |
TaskView | viewAboveDropTarget |
The view that is directly above the current drop target, or null if the drop target is the first view. | |
TaskView | viewBelowDropTarget |
The view that is directly below the current drop target, or null if the drop target is the last view. | |
Classes | |
class | TaskViewDragListener |
A ComponentListener that listens for moving TaskViews when a drag is in progress, and determines what the drop target would be if the user were to drop the TaskView. More... | |
class | TaskViewDropListener |
A PropertyChangeListener that listens for TaskViewPropertyNames.DRAGGING_PROPERTY_NAME events coming from a task view that indicate that the view is no longer being dragged, and performs the drop operation on the appropriate component. More... | |
class | TaskViewExpansionListener |
A PropertyChangeListener that listens for TaskViewPropertyNames.EXPANDED_PROPERTY_NAME property change events coming from task views and causes the subpane to redo its layout. More... | |
class | TaskWatcher |
A helper class that remembers the previous state of the TaskManager and the mappings between Tasks and TaskViews. More... |
edu.cmu.hcii.calo.view.task.TaskSubpaneView.TaskSubpaneView | ( | String | title, | |
int | normalCount, | |||
TaskFilter | filter | |||
) |
Constructs a TaskSubpaneView with the given normal task count and task taskFilter.
It will be populated with tasks from the TaskManager. Note that an item will be shown in the maximized state as long as it matches the taskFilter, and in normal mode only if it both matches the taskFilter and is one of the normalCount
highest-priority tasks that match the taskFilter.
title | the title of this subpane | |
normalCount | the number of tasks to show in the normal state | |
filter | the task taskFilter to use for this subpane |
static void edu.cmu.hcii.calo.view.task.TaskSubpaneView.main | ( | String[] | args | ) | [static] |
A test program that creates and shows a TaskSubpaneView.
args | command-line args; don't bother passing any |
void edu.cmu.hcii.calo.view.task.TaskSubpaneView.clearDrop | ( | ) | [protected] |
Resets all the subpane state relating to drag and drop and repaints the subpane so that no drop target is drawn.
int edu.cmu.hcii.calo.view.task.TaskSubpaneView.countShownTasks | ( | ) |
Returns the number of tasks that can be shown in the subpane.
This does NOT take into account tasks that may not be visible due to being "below the fold" or because the subpane is collapsed, but does take into account whether the subpane is filtered. This method will always return the number of tasks that would be shown in the subpane if it were maximized.
boolean edu.cmu.hcii.calo.view.task.TaskSubpaneView.doAnimations | ( | ) | [protected, virtual] |
Should be implemented to record the positions of all the components in the view so they can be animated from their old positions, and then create and start the necessary Animation objects to perform these animations.
Implements edu.cmu.hcii.calo.view.AnimatedPane.
void edu.cmu.hcii.calo.view.task.TaskSubpaneView.doUpdate | ( | ) | [protected, virtual] |
Lays out all the TaskManager's tasks in order of descending priority.
Implements edu.cmu.hcii.calo.view.AnimatedPane.
TaskFilter edu.cmu.hcii.calo.view.task.TaskSubpaneView.getFilter | ( | ) |
Gets the filter currently being applied to this subpane if there is one, or null
otherwise.
boolean edu.cmu.hcii.calo.view.task.TaskSubpaneView.isCollapsed | ( | ) |
Returns whether this subpane is currently collapsed.
true
if the subpane is collapsed, false
otherwise Returns whether this subpane is currently showing all tasks (i.e., maximized).
true
if the subpane is showing all tasks, false
otherwise boolean edu.cmu.hcii.calo.view.task.TaskSubpaneView.isValid | ( | ) |
Called by Swing to determine whether to revalidate the layout of this component.
We override it to return true
whenever there are animations in progress, which prevents Swing from redoing the layout and putting things where they don't belong.
void edu.cmu.hcii.calo.view.task.TaskSubpaneView.paint | ( | Graphics | graphics | ) |
Paints the subpane normally, then superimposes a drop target indicator if a drag is currently in progress that would result in the dragging task being dropped between two other tasks.
graphics | the graphics context to paint into |
Reimplemented from edu.cmu.hcii.calo.view.AnimatedPane.
void edu.cmu.hcii.calo.view.task.TaskSubpaneView.paintComponent | ( | Graphics | graphics | ) |
Paints the subpane's background, including a nice pretty gradient along the bottom to match the one painted by the title view.
graphics | the graphics context to paint into |
Reimplemented from edu.cmu.hcii.calo.view.TranslucentView.
void edu.cmu.hcii.calo.view.task.TaskSubpaneView.prepareAnimations | ( | ) | [protected, virtual] |
Should be implemented to record the positions of all the components in the view so they can be animated to their new positions later.
prepareAnimations() is called from update() before doUpdate() is invoked, so the component positions are unchanged from what they were before the update.
Implements edu.cmu.hcii.calo.view.AnimatedPane.
void edu.cmu.hcii.calo.view.task.TaskSubpaneView.safeUpdateAnimation | ( | Animation | a | ) | [protected, virtual] |
Should be implemented to process an updated animation, just like AnimationListener.animationDidUpdate(Animation).
This method exists because AnimatedPane performs some automatic setup and teardown in animationDidUpdate(Animation), and calls safeUpdateAnimation(Animation) in between.
a | the animation that is updating |
Implements edu.cmu.hcii.calo.view.AnimatedPane.
void edu.cmu.hcii.calo.view.task.TaskSubpaneView.setCollapsed | ( | boolean | isCollapsed | ) |
Sets whether this subpane is collapsed.
isCollapsed | whether or not this subpane is collapsed |
void edu.cmu.hcii.calo.view.task.TaskSubpaneView.setDropBetween | ( | TaskView | previousSibling, | |
TaskView | nextSibling | |||
) | [protected] |
Sets the drag-and-drop related state of this subpane based on the views passed, and repaints the subpane to show the drop target indicator.
previousSibling | the view above the drop target | |
nextSibling | the view below the drop target |
void edu.cmu.hcii.calo.view.task.TaskSubpaneView.setFilter | ( | TaskFilter | filter | ) |
Sets the filter used in this subpane.
Pass null
to clear the filter.
filter | the filter to set |
void edu.cmu.hcii.calo.view.task.TaskSubpaneView.setShowingAll | ( | boolean | isShowingAll | ) |
Sets whether this subpane is showing all tasks (i.e., maximized).
isShowingAll | true if the subpane should show all tasks, false otherwise |
void edu.cmu.hcii.calo.view.task.TaskSubpaneView.setup | ( | ) | [private] |
Sets up the appearance of the view.
void edu.cmu.hcii.calo.view.task.TaskSubpaneView.updateTasks | ( | ) |
Updates the state of all task views in this subpane, without actually updating the subpane itself.
final double edu.cmu.hcii.calo.view.task.TaskSubpaneView.ANIMATION_DURATION = 0.75 [static] |
The duration of subpane animations, in seconds.
String edu.cmu.hcii.calo.view.task.TaskSubpaneView.title [protected] |
The title of this subpane.
boolean edu.cmu.hcii.calo.view.task.TaskSubpaneView.isShowingAll = false [private] |
Whether or not this subpane is maximized, that is, showing all tasks (rather than just the first few).
int edu.cmu.hcii.calo.view.task.TaskSubpaneView.normalCount = 0 [package] |
The number of items that should be shown in this view when it is in the "normal" state.
The TaskWatcher that helps us keep track of what's going on in the subpane between updates.
The title view for this subpane.
JButton edu.cmu.hcii.calo.view.task.TaskSubpaneView.moreLink [package] |
The link at the bottom of the subpane that allows the user to see more or fewer items.
The number of tasks that made it through both the base filter and any additional filter.
The TaskFilter that is used to determine which tasks show up in this subpane before any other filter is applied.
An additional filter to be applied on top of the base filter for this subpane.
The view that is directly above the current drop target, or null
if the drop target is the first view.
The view that is directly below the current drop target, or null
if the drop target is the last view.