public final class ViewRect
extends java.lang.Object
Constructor and Description |
---|
ViewRect(int x,
int y,
int width,
int height)
Constructor that initializes specified X and Y coordinates of the top-left corner plus width
and height values, in pixels, for the new
ViewRect object. |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object other)
Determines whether the specified
Object is equal to this ViewRect object. |
int |
getHeight()
Gets the current height, in pixels, of the
ViewRect . |
int |
getWidth()
Gets the current width, in pixels, of the
ViewRect . |
int |
getX()
Gets the current X-coordinate of the
ViewRect . |
int |
getY()
Gets the current Y-coordinate of the
ViewRect . |
int |
hashCode()
Calculates and returns a hash code value for the
ViewRect . |
boolean |
isValid()
Determines whether the
ViewRect object is valid. |
void |
setHeight(int height)
Sets a height, in pixels, for the
ViewRect . |
void |
setWidth(int width)
Sets a width, in pixels, for the
ViewRect . |
void |
setX(int x)
Sets an X-coordinate for the
ViewRect . |
void |
setY(int y)
Sets a Y-coordinate for the
ViewRect . |
public ViewRect(int x, int y, int width, int height)
ViewRect
object.x
- An initial X-coordinate for the left side of the rectangley
- An initial Y-coordinate for the top of the rectanglewidth
- An initial width for the rectangleheight
- An initial height for the rectanglepublic int getX()
ViewRect
.public int getY()
ViewRect
.public int getWidth()
ViewRect
.public int getHeight()
ViewRect
.public void setX(int x)
ViewRect
.x
- Desired X-coordinatepublic void setY(int y)
ViewRect
.y
- Desired Y-coordinatepublic void setWidth(int width)
ViewRect
.width
- Desired widthpublic void setHeight(int height)
ViewRect
.height
- Desired heightpublic boolean isValid()
ViewRect
object is valid.ViewRect
is valid, false otherwisepublic int hashCode()
ViewRect
.hashCode
in class java.lang.Object
public boolean equals(java.lang.Object other)
Object
is equal to this ViewRect
object.equals
in class java.lang.Object
other
- An Object
to compare with this ViewRect
object for equality