public class Rectangle extends Object
Constructor and Description |
---|
Rectangle(double left,
double top,
double right,
double bottom)
Initializes a new instance of the
Rectangle class. |
Rectangle(Point position,
Size size)
Initializes a new instance of the
Rectangle class. |
Modifier and Type | Method and Description |
---|---|
double |
getBottom()
Gets the y-coordinate of the bottom edge of the rectangular area.
|
double |
getLeft()
Gets the x-coordinate of the left edge of the rectangular area.
|
Point |
getPosition()
Gets the coordinates of the upper-left corner of the rectangular area.
|
double |
getRight()
Gets the x-coordinate of the right egde of the rectangular area.
|
Size |
getSize()
Gets the size.
|
double |
getTop()
Gets the y-coordinate of the top edge of the rectangular area.
|
String |
toString() |
public Rectangle(double left, double top, double right, double bottom)
Rectangle
class.left
- The x-coordinate of the left edge of the rectangular area.top
- The y-coordinate of the top edge of the rectangular area.right
- The x-coordinate of the right edge of the rectangular area.bottom
- The y-coordinate of the bottom edge of the rectangular area.public double getLeft()
public double getTop()
public double getRight()
public double getBottom()
public Point getPosition()
Point
class that represents the coordinates of the upper-left corner of the rectangular area.public Size getSize()
Size
class that represents the size of the rectangular area.