2 // AIOutlineViewAnimation.m
5 // Created by Evan Schoenberg on 6/9/07.
8 #import "AIOutlineViewAnimation.h"
9 #import "AIAnimatingListOutlineView.h"
11 @interface AIAnimatingListOutlineView (AIOutlineViewAnimationDelegate)
12 - (void)animation:(AIOutlineViewAnimation *)animation didSetCurrentValue:(float)currentValue forDict:(NSDictionary *)animatingRowsDict;
15 @interface AIOutlineViewAnimation (PRIVATE)
16 - (id)initWithDictionary:(NSDictionary *)inDict delegate:(AIAnimatingListOutlineView *)inOutlineView;
20 * @class AIOutlineViewAnimation
21 * @brief NSAnimation subclass for AIOutlineView's animations
23 * This NSAnimation subclass is a simple subclass to let the outline view handle changes in progress
24 * along a non-blocking ease-in/ease-out animation.
25 * AIOutlineView should release the AIOutlineViewAnimation when the animation is complete.
27 @implementation AIOutlineViewAnimation
28 + (AIOutlineViewAnimation *)listObjectAnimationWithDictionary:(NSDictionary *)inDict delegate:(AIAnimatingListOutlineView *)inOutlineView
30 return [[[self alloc] initWithDictionary:inDict delegate:inOutlineView] autorelease];
33 - (id)initWithDictionary:(NSDictionary *)inDict delegate:(AIAnimatingListOutlineView *)inOutlineView
35 if ((self = [super initWithDuration:LIST_OBJECT_ANIMATION_DURATION animationCurve:NSAnimationEaseInOut])) {
36 dict = [inDict retain];
38 [self setDelegate:inOutlineView];
39 [self setAnimationBlockingMode:NSAnimationNonblocking];
53 * @brief We want to run our animation no matter what's going on
55 - (NSArray *)runLoopModesForAnimating
57 return [NSArray arrayWithObjects:NSDefaultRunLoopMode, NSModalPanelRunLoopMode, NSEventTrackingRunLoopMode, nil];
61 * @brief When progress updates, inform the delegate
63 - (void)setCurrentProgress:(NSAnimationProgress)progress
65 [super setCurrentProgress:progress];
67 [[self delegate] animation:self didSetCurrentValue:[self currentValue] forDict:dict];