home *** CD-ROM | disk | FTP | other *** search
/ OpenStep 4.2J (Developer) / os42jdev.iso / NextDeveloper / Examples / AppKit / Draw / graphicsUndo.subproj / ResizeGraphicsChange.m < prev    next >
Text File  |  1995-11-28  |  700b  |  48 lines

  1. #import "drawundo.h"
  2.  
  3. @interface ResizeGraphicsChange(PrivateMethods)
  4.  
  5. - (void)undoDetails;
  6. - (void)redoDetails;
  7.  
  8. @end
  9.  
  10. @implementation ResizeGraphicsChange
  11.  
  12. - initGraphicView:aGraphicView graphic:aGraphic
  13. {
  14.     [super initGraphicView:aGraphicView];
  15.     graphic = aGraphic;
  16.     return self;
  17. }
  18.  
  19. - (NSString *)changeName
  20. {
  21.     return RESIZE_OP;
  22. }
  23.  
  24. - (void)saveBeforeChange
  25. {
  26.     graphics = [[NSMutableArray alloc] init];
  27.     [graphics addObject:graphic];
  28.     oldBounds = [graphic bounds]; 
  29. }
  30.  
  31. - (Class)changeDetailClass
  32. {
  33.     return nil;
  34. }
  35.  
  36. - (void)undoDetails
  37. {
  38.     newBounds = [graphic bounds];
  39.     [graphic setBounds:oldBounds]; 
  40. }
  41.  
  42. - (void)redoDetails
  43. {
  44.     [graphic setBounds:newBounds]; 
  45. }
  46.  
  47. @end
  48.