public class Rect extends Object implements Serializable
Constructor and Description |
---|
Rect(int x,
int y,
int width,
int height)
根据给定的 X 轴坐标、Y 轴坐标、宽和高构造一个矩形。
|
Modifier and Type | Method and Description |
---|---|
boolean |
contains(int x,
int y)
检查此矩形是否包含指定位置 (x,y) 上的点。
|
boolean |
contains(Point point)
检查此矩形是否包含指定的点。
|
boolean |
contains(Rect rect)
检查此矩形是否完全包含指定的矩形。
|
boolean |
equals(Object obj) |
Point |
getCenter()
返回矩形的中心。
|
int |
getHeight()
返回矩形的高。
|
int |
getWidth()
返回矩形的宽。
|
int |
getX()
返回矩形的 x 轴坐标。
|
int |
getY()
返回矩形的 y 轴坐标。
|
int |
hashCode() |
boolean |
isEmpty()
决定矩形是否为空。
|
String |
toString() |
public Rect(int x, int y, int width, int height)
x
- x 轴坐标y
- y 轴坐标width
- 宽height
- 高
public int getX()
public int getY()
public int getWidth()
public int getHeight()
public Point getCenter()
public boolean isEmpty()
true
;否则为 false
public boolean contains(int x, int y)
x
- 指定的 X 轴坐标y
- 指定的 Y 轴坐标true
。
public boolean contains(Point point)
point
- 要测试的点true
。
public boolean contains(Rect rect)
rect
- 要测试的矩形true
。
Copyright 2009-2012 Micro Focus. All Rights Reserved.