home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OpenStep 4.2J (Developer)
/
os42jdev.iso
/
NextDeveloper
/
Examples
/
AppKit
/
Draw
/
graphicsUndo.subproj
/
ReorderGraphicsChange.m
< prev
next >
Wrap
Text File
|
1995-08-03
|
909b
|
43 lines
#import "drawundo.h"
@interface ReorderGraphicsChange(PrivateMethods)
- (void)undoDetails;
@end
@implementation ReorderGraphicsChange
- (void)saveBeforeChange
{
[super saveBeforeChange];
[changeDetails makeObjectsPerform:@selector(recordGraphicPositionIn:) withObject:[graphicView graphics]];
}
- (Class)changeDetailClass
{
return [OrderChangeDetail class];
}
- (void)undoDetails
{
int count, i;
id detail, graphic;
NSMutableArray *allGraphics;
count = [changeDetails count];
allGraphics = [graphicView graphics];
for (i = 0; i < count; i++) {
detail = [changeDetails objectAtIndex:i];
graphic = [detail graphic];
[allGraphics removeObject:graphic];
}
for (i = 0; i < count; i++) {
detail = [changeDetails objectAtIndex:i];
graphic = [detail graphic];
[allGraphics insertObject:graphic atIndex:[detail graphicPosition]];
}
}
@end