All Packages Class Hierarchy This Package Previous Next Index
Class sg.Rectangle
java.lang.Object
|
+----sg.Quadrilateral
|
+----sg.Trapezoid
|
+----sg.Parallelogram
|
+----sg.Rectangle
- public class Rectangle
- extends Parallelogram
Creates an object representing a rectangle.
The rectangle is determined by four points (p1, p2, p3, p4). p1
is assumed to be the upper left hand corner and the other points are
assumed to be listed in clockwise order.
For simplicity, the top and bottom with end points (p1,p2) and (p3,p4) of
the parallelogram are assumed to be horizontal and the sides are assumed
vertical.
-
Rectangle(Pixel, Pixel, Pixel, Pixel)
- Four-parameter constructor.
Rectangle
public Rectangle(Pixel pt1,
Pixel pt2,
Pixel pt3,
Pixel pt4)
- Four-parameter constructor. Parallelogram constructor assures
that top and bottom are parallel and this constructor does the
same for the sides.
All Packages Class Hierarchy This Package Previous Next Index