home *** CD-ROM | disk | FTP | other *** search
/ Nebula 1995 August / NEBULA.mdf / SourceCode / AlexNeXTSTEPSource / Source / Chapter7_Views / Shapes / SquareView.m < prev   
Encoding:
Text File  |  1993-04-14  |  573 b   |  31 lines

  1. /* Generated by Project Builder */
  2.  
  3. #import <appkit/appkit.h>
  4. #import "SquareView.h"
  5.  
  6. @implementation SquareView
  7.  
  8. -drawSelf: (NXRect *)rects :(int)rectCount
  9. {
  10.     // erase current drawing
  11.     [super erase];
  12.     // translate axes to current offsets
  13.     PStranslate(x, y);
  14.     // rotate axes to current angle
  15.     PSrotate(angle);
  16.     // scale axes to current values
  17.     PSscale(xScale, yScale);
  18.     // draw a square that's 5 by 5 units
  19.     PSmoveto(-5, -5);
  20.     PSrlineto(10, 0);
  21.     PSrlineto(0, 10);
  22.     PSrlineto(-10, 0);
  23.     PSclosepath();
  24.     // set color to white
  25.     PSsetgray(1.0);
  26.     PSfill();
  27.     return self;
  28. }
  29.  
  30. @end
  31.