public class HRectangle extends HObject
| 构造器和说明 |
|---|
HRectangle()
构造函数,相当于new HRectangle(0,0,0,0)。
|
HRectangle(double x,
double y,
double width,
double height)
构造函数。
|
| 限定符和类型 | 方法和说明 |
|---|---|
HRectangle |
clone()
返回一个新的 HRectangle 对象,其 x、y、width 和 height 属性的值与原始 Rectangle 对象的对应值相同。
|
boolean |
contains(double x,
double y,
boolean boundFlag)
确定由此 HRectangle 对象定义的矩形区域内是否包含指定的点。
|
boolean |
contains(HPoint p,
boolean boundFlag)
确定由此 HRectangle 对象定义的矩形区域内是否包含指定的点。
|
boolean |
containsRect(HRectangle rect)
确定此 HRectangle 对象内是否包含由 rect 参数指定的 HRectangle 对象。
|
boolean |
equals(HRectangle toCompare)
确定在 toCompare 参数中指定的对象是否等于此 HRectangle 对象。
|
void |
inflate(double dx,
double dy)
按指定量增加 HRectangle 对象的大小(以像素为单位)。
|
void |
inflate(HPoint p)
按指定量增加 HRectangle 对象的大小(以像素为单位)。
|
HRectangle |
intersection(HRectangle toIntersect)
如果在 toIntersect 参数中指定的 HRectangle 对象与此 HRectangle 对象相交,则返回交集区域作为 HRectangle 对象。
|
boolean |
intersects(HRectangle toIntersect)
确定在 toIntersect 参数中指定的对象是否与此 HRectangle 对象相交。
|
boolean |
isEmpty()
确定此 HRectangle 对象是否为空。
|
void |
offset(double dx,
double dy)
按指定量调整 HRectangle 对象的位置(由其左上角确定)。
|
void |
offset(HPoint p)
按指定量调整 HRectangle 对象的位置(由其左上角确定)。
|
void |
setEmpty()
将 Rectangle 对象的所有属性设置为 0。
|
java.lang.String |
toString() |
HRectangle |
union(HRectangle toUnion)
通过填充两个矩形之间的水平和垂直空间,将这两个矩形组合在一起以创建一个新的 HRectangle 对象。
|
public HRectangle(double x,
double y,
double width,
double height)
x - y - width - height - public HRectangle()
public HRectangle clone()
clone 在类中 java.lang.Objectpublic boolean contains(double x,
double y,
boolean boundFlag)
x - y - boundFlag - 是否考虑边界public boolean contains(HPoint p, boolean boundFlag)
p - boundFlag - 是否考虑边界public boolean containsRect(HRectangle rect)
rect - public boolean equals(HRectangle toCompare)
toCompare - public void inflate(double dx,
double dy)
dx - dy - public void inflate(HPoint p)
p - public HRectangle intersection(HRectangle toIntersect)
toIntersect - public boolean intersects(HRectangle toIntersect)
toIntersect - public boolean isEmpty()
public void offset(double dx,
double dy)
dx - dy - public void offset(HPoint p)
p - public void setEmpty()
public HRectangle union(HRectangle toUnion)
toUnion -