Inheritance diagram for edu.cmu.hcii.calo.view.TaskSubpaneView:
Public Member Functions | ||||
TaskSubpaneView (String title, int normalCount, TaskFilter filter) | ||||
Constructs a TaskSubpaneView with the given normal task count and task filter. | ||||
void | markTaskShouldAnimate (Task t) | |||
Dimension | getPreferredScrollableViewportSize () | |||
int | getScrollableBlockIncrement (Rectangle visibleRect, int orientation, int direction) | |||
boolean | getScrollableTracksViewportHeight () | |||
boolean | getScrollableTracksViewportWidth () | |||
int | getScrollableUnitIncrement (Rectangle visibleRect, int orientation, int direction) | |||
Dimension | recomputePreferredSize () | |||
Should be implemented to return the preferred size of the container given its content. | ||||
SubpaneState | getState () | |||
Accessor method for state. | ||||
void | setState (SubpaneState theState) | |||
Setter method for state. | ||||
void | doLayout () | |||
TaskFilter | getFilter () | |||
Accessor method for filter. | ||||
void | setFilter (TaskFilter filter) | |||
Setter method for filter. | ||||
void | animationDidUpdate (final Animation a) | |||
Called by the AnimationManager when an animation is updated. | ||||
Dimension | getPreferredSize () | |||
Calls recomputePreferredSize() and returns the result, unless we have at least one animation in progress, in which case the value returned will be what recomputePreferredSize() returned the last time it was called. | ||||
void | paint (Graphics g) | |||
Calls super.paint() unless ignorePaintRequests is true, in which case we draw our stored buffer instead. | ||||
void | update () | |||
Causes this view to synchronize itself with the TaskManager. | ||||
void | validate () | |||
Calls super.validate() unless we have at least one animation in progress, in which case no validation is performed. | ||||
void | animationDidUpdate (Animation a) | |||
Called when a given Animation for which this class is a listener has updated its state. | ||||
Static Public Member Functions | ||||
static void | main (String[] args) | |||
A test program that creates and shows a TaskSubpaneView. | ||||
Static Public Attributes | ||||
static final String | SUBPANE_STATE_PROPERTY = "SubpaneState" | |||
PropertyChange key for subpane state. | ||||
Protected Member Functions | ||||
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 | 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 | safeUpdateAnimation (Animation a) | |||
Should be implemented to process an updated animation, just like AnimationListener.animationDidUpdate(Animation). | ||||
void | decrementNumAnimating () | |||
Subtracts one from the number of running animations. | ||||
int | getNumAnimating () | |||
Gets the number of animations that have successfully started running. | ||||
int | getTotalAnimations () | |||
Gets the total number of animations that must complete before the entire set of animations should be declared finished. | ||||
void | incrementNumAnimating () | |||
Adds one to the number of running animations. | ||||
void | setIgnorePaintRequests (boolean ignorePaintRequests) | |||
Determines whether or not the view should ignore requests to paint itself. | ||||
void | setNumAnimating (int numAnimating) | |||
Sets the number of animations that have successfully started running. | ||||
void | setTotalAnimations (int totalAnimations) | |||
Sets the total number of animations that must complete before the entire set of animations should be declared finished. | ||||
Dimension | getSystemPreferredSize () | |||
Package Attributes | ||||
JButton | moreLink | |||
The link at the bottom of the subpane that allows the user to see more or fewer items. | ||||
int | normalCount = 0 | |||
The number of items that should be shown in this view when it is in the "normal" state. | ||||
Static Package Attributes | ||||
static TaskSubpaneView | subpaneView | |||
Test instance. | ||||
Private Member Functions | ||||
void | setup () | |||
Sets up the appearance of the view. | ||||
boolean | shouldAnimateAddDelete (TaskView c) | |||
| ||||
void | setShouldAnimateAddDelete (Task t, boolean shouldAnimate) | |||
| ||||
Private Attributes | ||||
HashMap< Component, Rectangle > | oldRects | |||
Map containing the old bounds of the components before the current update. | ||||
SubpaneState | state = SubpaneState.NORMAL | |||
The current state of this subpane. | ||||
String | title | |||
The title of this subpane. | ||||
TaskFilter | filter | |||
The TaskFilter that is used to determine which tasks show up in this subpane. | ||||
TaskSubpaneTitleView | titleView | |||
The title view for this subpane. | ||||
Map< Task, Boolean > | addDeleteAnimateMap |
edu.cmu.hcii.calo.view.TaskSubpaneView.TaskSubpaneView | ( | String | title, | |
int | normalCount, | |||
TaskFilter | filter | |||
) |
Constructs a TaskSubpaneView with the given normal task count and task filter.
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 filter, and in normal mode only if it both matches the filter and is one of the normalCount
highest-priority tasks that match the filter.
title | the title of this subpane | |
normalCount | the number of tasks to show in the normal state | |
filter | the task filter to use for this subpane |
static void edu.cmu.hcii.calo.view.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.TaskSubpaneView.setup | ( | ) | [private] |
Sets up the appearance of the view.
void edu.cmu.hcii.calo.view.TaskSubpaneView.markTaskShouldAnimate | ( | Task | t | ) |
void edu.cmu.hcii.calo.view.TaskSubpaneView.doUpdate | ( | ) | [protected, virtual] |
Lays out all the TaskManager's tasks in order of descending priority.
Implements edu.cmu.hcii.calo.view.AnimatedPane.
void edu.cmu.hcii.calo.view.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.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.
boolean edu.cmu.hcii.calo.view.TaskSubpaneView.shouldAnimateAddDelete | ( | TaskView | c | ) | [private] |
void edu.cmu.hcii.calo.view.TaskSubpaneView.setShouldAnimateAddDelete | ( | Task | t, | |
boolean | shouldAnimate | |||
) | [private] |
Dimension edu.cmu.hcii.calo.view.TaskSubpaneView.getPreferredScrollableViewportSize | ( | ) |
int edu.cmu.hcii.calo.view.TaskSubpaneView.getScrollableBlockIncrement | ( | Rectangle | visibleRect, | |
int | orientation, | |||
int | direction | |||
) |
boolean edu.cmu.hcii.calo.view.TaskSubpaneView.getScrollableTracksViewportHeight | ( | ) |
boolean edu.cmu.hcii.calo.view.TaskSubpaneView.getScrollableTracksViewportWidth | ( | ) |
int edu.cmu.hcii.calo.view.TaskSubpaneView.getScrollableUnitIncrement | ( | Rectangle | visibleRect, | |
int | orientation, | |||
int | direction | |||
) |
Dimension edu.cmu.hcii.calo.view.TaskSubpaneView.recomputePreferredSize | ( | ) | [virtual] |
Should be implemented to return the preferred size of the container given its content.
This may be as simple as a call to super.getPreferredSize(), but in some layout managers this will cause a deferred validation which will interfere with the animation. If this occurs for you, you will need to calculate the preferred size manually by looking at the component positions.
Implements edu.cmu.hcii.calo.view.AnimatedPane.
void edu.cmu.hcii.calo.view.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.
Implements edu.cmu.hcii.calo.view.AnimatedPane.
SubpaneState edu.cmu.hcii.calo.view.TaskSubpaneView.getState | ( | ) |
Accessor method for state.
void edu.cmu.hcii.calo.view.TaskSubpaneView.setState | ( | SubpaneState | theState | ) |
Setter method for state.
theState | The new value for state |
void edu.cmu.hcii.calo.view.TaskSubpaneView.doLayout | ( | ) |
TaskFilter edu.cmu.hcii.calo.view.TaskSubpaneView.getFilter | ( | ) |
Accessor method for filter.
void edu.cmu.hcii.calo.view.TaskSubpaneView.setFilter | ( | TaskFilter | filter | ) |
Setter method for filter.
filter | the filter to set |
void edu.cmu.hcii.calo.view.AnimatedPane.animationDidUpdate | ( | final Animation | a | ) | [inherited] |
Called by the AnimationManager when an animation is updated.
Subclasses should NOT override this method to handle animations, and should instead implement safeUpdateAnimation(Animation).
a | the animation being updated |
Dimension edu.cmu.hcii.calo.view.AnimatedPane.getPreferredSize | ( | ) | [inherited] |
Calls recomputePreferredSize() and returns the result, unless we have at least one animation in progress, in which case the value returned will be what recomputePreferredSize() returned the last time it was called.
This prevents the preferred size to be recalculated based on components that are in the middle of moving from one place to another.
Note that under no circumstances will this call super.getPreferredSize(), as in some layout managers getPreferredSize will automatically invoke revalidate(), which causes race conditions and other related nastiness. If you know this is not the case for the layout manager you are using, simply implement recomputePreferredSize() to return super.getPreferredSize(). Otherwise, you can compute the preferred size manually to avoid this.
void edu.cmu.hcii.calo.view.AnimatedPane.paint | ( | Graphics | g | ) | [inherited] |
Calls super.paint() unless ignorePaintRequests is true, in which case we draw our stored buffer instead.
This ameliorates the effect of the views snapping to their eventual destination positions when validate is called just before the animation begins, though it does not completely eliminate the effect in all instances.
g | the Graphics instance to paint into |
void edu.cmu.hcii.calo.view.AnimatedPane.update | ( | ) | [inherited] |
Causes this view to synchronize itself with the TaskManager.
Specifically, the view first calls prepareAnimations() to allow the old positions of its components to be recorded. Next, it sets ignorePaintRequests to true if the view is visible onscreen, and calls doUpdate(). Then, validate() is called to recompute the positions of all the components in the view, and the view is resized to its preferred size. Lastly, doAnimations() is called to allow the new positions of the components to be recorded and the animations to be started.
void edu.cmu.hcii.calo.view.AnimatedPane.validate | ( | ) | [inherited] |
void edu.cmu.hcii.calo.view.AnimatedPane.decrementNumAnimating | ( | ) | [protected, inherited] |
Subtracts one from the number of running animations.
Exactly equivalent to setNumAnimating(getNumAnimating() - 1)
. You usually do not need to call this method; the number of animations will automatically be decremented by AnimatedPane when each animation finishes.
int edu.cmu.hcii.calo.view.AnimatedPane.getNumAnimating | ( | ) | [protected, inherited] |
Gets the number of animations that have successfully started running.
This number will change when you call setNumAnimating(int) or incrementNumAnimating(), and will also decrement automatically when animations finish.
int edu.cmu.hcii.calo.view.AnimatedPane.getTotalAnimations | ( | ) | [protected, inherited] |
Gets the total number of animations that must complete before the entire set of animations should be declared finished.
void edu.cmu.hcii.calo.view.AnimatedPane.incrementNumAnimating | ( | ) | [protected, inherited] |
Adds one to the number of running animations.
Exactly equivalent to setNumAnimating(getNumAnimating() + 1)
.
void edu.cmu.hcii.calo.view.AnimatedPane.setIgnorePaintRequests | ( | boolean | ignorePaintRequests | ) | [protected, inherited] |
Determines whether or not the view should ignore requests to paint itself.
If set to true
, AnimatedPane will make a cached buffer of the window contents as they appear right now, and any subsequent requests to paint will be fulfilled by using this buffer. Thus, there will be no flickering or "giant eraser" effect, but any changes to the layout will be hidden until you are ready to show them.
ignorePaintRequests | true to ignore paint requests, false to service them as usual. |
void edu.cmu.hcii.calo.view.AnimatedPane.setNumAnimating | ( | int | numAnimating | ) | [protected, inherited] |
Sets the number of animations that have successfully started running.
It is often more convenient to use incrementNumAnimating() instead.
numAnimating | the new number of running animations |
void edu.cmu.hcii.calo.view.AnimatedPane.setTotalAnimations | ( | int | totalAnimations | ) | [protected, inherited] |
Sets the total number of animations that must complete before the entire set of animations should be declared finished.
This should be called in doAnimations() so that AnimatedPane can determine when to begin servicing paint events again.
totalAnimations | the total number of animations to be run |
Dimension edu.cmu.hcii.calo.view.AnimatedPane.getSystemPreferredSize | ( | ) | [protected, inherited] |
void edu.cmu.hcii.calo.view.animation.AnimationListener.animationDidUpdate | ( | Animation | a | ) | [inherited] |
Called when a given Animation for which this class is a listener has updated its state.
This method will be called as often as possible while the Animation is running, and at least once when it has finished. A class can listen to more than one Animation at a time, in which case it should use the parameter to this method to determine which Animation has updated.
a | the Animation that has updated |
Implemented in edu.cmu.hcii.calo.test.AnimationTest, edu.cmu.hcii.calo.test.manual.AnimationDemo, and edu.cmu.hcii.calo.test.manual.PanelSwapDemo.
final String edu.cmu.hcii.calo.view.TaskSubpaneView.SUBPANE_STATE_PROPERTY = "SubpaneState" [static] |
PropertyChange key for subpane state.
TaskSubpaneView edu.cmu.hcii.calo.view.TaskSubpaneView.subpaneView [static, package] |
Test instance.
HashMap<Component, Rectangle> edu.cmu.hcii.calo.view.TaskSubpaneView.oldRects [private] |
Map containing the old bounds of the components before the current update.
SubpaneState edu.cmu.hcii.calo.view.TaskSubpaneView.state = SubpaneState.NORMAL [private] |
The current state of this subpane.
String edu.cmu.hcii.calo.view.TaskSubpaneView.title [private] |
The title of this subpane.
The TaskFilter that is used to determine which tasks show up in this subpane.
The title view for this subpane.
JButton edu.cmu.hcii.calo.view.TaskSubpaneView.moreLink [package] |
The link at the bottom of the subpane that allows the user to see more or fewer items.
int edu.cmu.hcii.calo.view.TaskSubpaneView.normalCount = 0 [package] |
The number of items that should be shown in this view when it is in the "normal" state.
Map<Task, Boolean> edu.cmu.hcii.calo.view.TaskSubpaneView.addDeleteAnimateMap [private] |