public final class Rectangle extends Object
Provides a rectangle.
Modifier and Type | Field and Description |
---|---|
static Rectangle |
EMPTY
An empty rectangle.
|
Constructor and Description |
---|
Rectangle(double x,
double y,
double width,
double height)
Initializes a new instance of the
Rectangle class. |
Modifier and Type | Method and Description |
---|---|
double |
getBottom()
Gets a Y-coordinate of the lower-right corner.
|
double |
getHeight()
Gets a height of the rectangle.
|
double |
getLeft()
Gets a X-coordinate of the upper-left corner.
|
double |
getRight()
Gets a X-coordinate of the lower-right corner.
|
double |
getTop()
Gets a X-coordinate of the upper-left corner.
|
double |
getWidth()
Gets a width of the rectangle.
|
public static final Rectangle EMPTY
An empty rectangle.
public Rectangle(double x, double y, double width, double height)
Initializes a new instance of the Rectangle
class.
x
- X-coordinate of the upper-left corner.y
- Y-coordinate of the upper-left corner.width
- Width of the rectangle.height
- Height of the rectangle.public double getLeft()
Gets a X-coordinate of the upper-left corner.
public double getTop()
Gets a X-coordinate of the upper-left corner.
public double getRight()
Gets a X-coordinate of the lower-right corner.
public double getBottom()
Gets a Y-coordinate of the lower-right corner.
public double getWidth()
Gets a width of the rectangle.
public double getHeight()
Gets a height of the rectangle.
Copyright © 2018. All rights reserved.