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

  1. #import "drawundo.h"
  2.  
  3. @interface MoveGraphicsChange(PrivateMethods)
  4.  
  5. - (BOOL)subsumeIdenticalChange:change;
  6.  
  7. @end
  8.  
  9. @implementation MoveGraphicsChange
  10.  
  11. - initGraphicView:aGraphicView vector:(NSPoint)aVector
  12. {
  13.     [super initGraphicView:aGraphicView];
  14.     redoVector.x = aVector.x;
  15.     redoVector.y = aVector.y;
  16.     undoVector.x = -redoVector.x;
  17.     undoVector.y = -redoVector.y;
  18.  
  19.     return self;
  20. }
  21.  
  22. - (NSString *)changeName
  23. {
  24.     return MOVE_OP;
  25. }
  26.  
  27. - (Class)changeDetailClass
  28. {
  29.     return [MoveChangeDetail class];
  30. }
  31.  
  32. - (NSPoint)undoVector
  33. {
  34.     return undoVector;
  35. }
  36.  
  37. - (NSPoint)redoVector
  38. {
  39.     return redoVector;
  40. }
  41.  
  42. - (BOOL)subsumeIdenticalChange:change
  43. {
  44.     MoveGraphicsChange    *moveChange;
  45.     
  46.     moveChange = (MoveGraphicsChange *)change;
  47.     undoVector.x += moveChange->undoVector.x;
  48.     undoVector.y += moveChange->undoVector.y;
  49.     redoVector.x += moveChange->redoVector.x;
  50.     redoVector.y += moveChange->redoVector.y;
  51.     
  52.     return YES;
  53. }
  54.  
  55. @end
  56.