public class Rectangle
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
private int |
height
Height (px)
|
private int |
width
Width (px)
|
private int |
x
X coordinate
|
private int |
y
Y coordinate
|
| Constructor and Description |
|---|
Rectangle()
Default constructor for Rectangle.
|
Rectangle(int x,
int y,
int width,
int height)
Constructs Rectangle with position and size.
|
| Modifier and Type | Method and Description |
|---|---|
int |
getHeight()
Gets the height (px).
|
int |
getWidth()
Gets the width (px).
|
int |
getX()
Gets the X coordinate.
|
int |
getY()
Gets the Y coordinate.
|
void |
setHeight(int height)
Sets the height (px).
|
void |
setWidth(int width)
Sets the width (px).
|
void |
setX(int x)
Sets the X coordinate.
|
void |
setY(int y)
Sets the Y coordinate.
|
private int x
private int y
private int width
private int height
public Rectangle()
public Rectangle(int x,
int y,
int width,
int height)
x - X coordinatey - Y coordinatewidth - Width (px)height - Height (px)public int getX()
public void setX(int x)
x - X coordinatepublic int getY()
public void setY(int y)
y - Y coordinatepublic int getWidth()
public void setWidth(int width)
width - Width (px)public int getHeight()
public void setHeight(int height)
height - Height (px)