rectangl Specification Sheet
Portable Object Compiler (c) 1997,98,99. All Rights Reserved.
Rectangle
Inherits from: Object
Class Description
Rectangle instances are pairs of Point objects. It is mostly Squeak and Stepstone ICpak101 compatible.
Method types
Creation
Motion
Comparing
Interrogation
Arithmetic
Printing
Methods
+new
Returns a new rectangle with origin and corner at (0,0).
+origin:pcorner:q
Returns a new rectangle with origin and corner set to p and q.
+origin:pextent:q
+origin:(int)x1:(int)y1corner:(int)x2:(int)y2
+origin:(int)x:(int)yextent:(int)w:(int)h
-free
Frees the origin and corner of the Point too.
-origin:p
-corner:q
-origin:pcorner:q
Sets origin and corner to p and q.
-extent:(int)w:(int)h
-extent:q
-origin:(int)x1:(int)y1
-corner:(int)x1:(int)y1
- (BOOL)contains:aPoint
Yes if inside, or on a border of, the rectangle.
- (unsigned)hash
- (BOOL)isEqual:aRectangle
Returns YES if aRectangle is some kind of rectangle, and if corner and origin are equal.
- (int)left
- (int)right
- (int)top
- (int)bottom
- (int)width
- (int)height
-origin
-topLeft
Same as origin.
-topRight
Answer the point at the top right corner of the receiver's top horizontal.
-topCenter
Answer the point at the center of the receiver's top horizontal.
-corner
-bottomLeft
Returns the point at the left edge of the bottom horizontal line of the receiver(or bottomLeft for short).
-bottomCenter
Answer the point at the center of the receiver's bottom horizontal.
-bottomRight
Same as corner.
-center
Return the point at the center of the receiver.
-leftCenter
Return the point at the center of the receiver's left vertical line.
-rightCenter
Return the point at the center of the receiver's left vertical line.
-extent
Return a new Point, set to the width and height of the rectangle.
-quickMerge:rect
Return the receiver if it encloses the given rectangle or the merge of the two rectangles if it doesn't. This method is an optimization to reduce extra rectangle creations.
-moveBy:aPoint
-translateBy:p
This method is like moveBy:, but returns a new rectangle instead of modifying the receiver.
-align:p1with:p2
Answer a rectangle that is translated by p2 - p1.
-printOn:(IOD)aFile