public static class RoundRectangle2D.Float extends RoundRectangle2D implements Serializable
Float类定义了一个圆角矩形,全部在
float坐标中指定。
RoundRectangle2D.Double, RoundRectangle2D.Float| Modifier and Type | Field and Description |
|---|---|
float |
archeight
从角落圆弧的高度。
|
float |
arcwidth
从角落圆弧的宽度。
|
float |
height
这个
RoundRectangle2D的高度。
|
float |
width
这个宽度
RoundRectangle2D 。
|
float |
x
这个
RoundRectangle2D的X
RoundRectangle2D 。
|
float |
y
这个
RoundRectangle2D的Y
RoundRectangle2D 。
|
| Constructor and Description |
|---|
Float()
构造新的
RoundRectangle2D ,初始化为位置(0.0,0.0),大小(0.0,0.0)和半径为0.0的角弧。
|
Float(float x, float y, float w, float h, float arcw, float arch)
构造并初始化一个
RoundRectangle2D从指定的
float坐标。
|
| Modifier and Type | Method and Description |
|---|---|
double |
getArcHeight()
获取圆角圆弧的高度。
|
double |
getArcWidth()
获取从角落舍入的圆弧的宽度。
|
Rectangle2D |
getBounds2D()
返回
Shape比
getBounds方法更高精度和更准确的边界框。
|
double |
getHeight()
以
double精度返回框架矩形的高度。
|
double |
getWidth()
以
double格式返回框架矩形的宽度。
|
double |
getX()
以double精度返回框架矩形左上角的
double坐标。
|
double |
getY()
以double精度返回框架矩形左上角的
double坐标。
|
boolean |
isEmpty()
确定是否
RectangularShape是空的。
|
void |
setRoundRect(double x, double y, double w, double h, double arcw, double arch)
将此
RoundRectangle2D的位置,大小和拐角半径
RoundRectangle2D为指定的
double值。
|
void |
setRoundRect(float x, float y, float w, float h, float arcw, float arch)
将此
RoundRectangle2D的位置,大小和拐角半径
RoundRectangle2D为指定的
float值。
|
void |
setRoundRect(RoundRectangle2D rr)
将此
RoundRectangle2D设置为与指定的
RoundRectangle2D相同。
|
contains, contains, equals, getPathIterator, hashCode, intersects, setFrameclone, contains, contains, getBounds, getCenterX, getCenterY, getFrame, getMaxX, getMaxY, getMinX, getMinY, getPathIterator, intersects, setFrame, setFrame, setFrameFromCenter, setFrameFromCenter, setFrameFromDiagonal, setFrameFromDiagonalpublic float x
RoundRectangle2D的X
RoundRectangle2D 。
public float y
RoundRectangle2D的Y
RoundRectangle2D 。
public float width
RoundRectangle2D 。
public float height
RoundRectangle2D的高度。
public float arcwidth
public float archeight
public Float()
RoundRectangle2D ,初始化为位置(0.0,0.0),大小(0.0,0.0)和半径为0.0的角弧。
public Float(float x,
float y,
float w,
float h,
float arcw,
float arch)
RoundRectangle2D从指定的
float坐标。
x - 新建的RoundRectangle2D的X
RoundRectangle2D
y - 新建的RoundRectangle2D的Y
RoundRectangle2D
w - 设置新建的RoundRectangle2D的
RoundRectangle2D
h - 设置新建的RoundRectangle2D的
RoundRectangle2D
arcw - 用于围绕新构建的角落圆弧的宽度
RoundRectangle2D
arch - 弧形高度用于圆形的新构造的角落
RoundRectangle2D
public double getX()
double坐标。
getX在
RectangularShape
public double getY()
double坐标。
getY在类别
RectangularShape
public double getWidth()
double精度返回框架矩形的宽度。
getWidth在
RectangularShape
public double getHeight()
double精度框架矩形的高度。
getHeight在
RectangularShape
public double getArcWidth()
getArcWidth在类别
RoundRectangle2D
RoundRectangle2D的角落
RoundRectangle2D 。
public double getArcHeight()
getArcHeight在
RoundRectangle2D
RoundRectangle2D的角落圆弧的高度。
public boolean isEmpty()
RectangularShape是空的。
当RectangularShape为空时,不包含任何区域。
isEmpty在
RectangularShape
true如果RectangularShape是空的;
false否则。
public void setRoundRect(float x,
float y,
float w,
float h,
float arcw,
float arch)
RoundRectangle2D的位置,大小和拐角半径
RoundRectangle2D为指定的
float值。
x - 设置此
RoundRectangle2D的位置的X
RoundRectangle2D
y - 设置该位置的Y坐标
RoundRectangle2D
w - 要设置的宽度
RoundRectangle2D
h - 设置这个
RoundRectangle2D的高度
arcw - 设置此
RoundRectangle2D弧的
RoundRectangle2D
arch - 设置这个
RoundRectangle2D弧的
RoundRectangle2D
public void setRoundRect(double x,
double y,
double w,
double h,
double arcw,
double arch)
RoundRectangle2D的位置,大小和拐角半径
RoundRectangle2D为指定的
double值。
setRoundRect在
RoundRectangle2D
x - 设置此
RoundRectangle2D的位置的X
RoundRectangle2D
y - 设置此
RoundRectangle2D的位置的Y
RoundRectangle2D
w - 要设置的宽度
RoundRectangle2D
h - 设置此
RoundRectangle2D的高度
arcw - 设置此
RoundRectangle2D的弧的
RoundRectangle2D
arch - 设置这个
RoundRectangle2D弧的
RoundRectangle2D
public void setRoundRect(RoundRectangle2D rr)
RoundRectangle2D设置为与指定的
RoundRectangle2D相同。
setRoundRect在类别
RoundRectangle2D
rr - 指定的
RoundRectangle2D
public Rectangle2D getBounds2D()
Shape比getBounds方法更高精度和更准确的边界框。
需要注意的是没有保证返回Rectangle2D是最小的边框包围Shape ,只表示Shape完全在指定的范围内Rectangle2D 。
通过此方法返回的边界框通常比通过返回的更紧密getBounds方法,而且永远不会因为溢出问题,因为返回值可以是实例Rectangle2D一个使用双精度值存储尺寸。
需要注意的是definition of insideness可能会导致出现对的定义轮廓点的情况下shape可能不被认为包含在返回bounds对象,但只有在这些点也未审议了原有的情况下shape 。
如果一个point是在shape内,根据contains(point)方法,那么它必须在返回的Rectangle2D边界对象中,根据contains(point)方法的bounds 。 特别:
shape.contains(p)需要bounds.contains(p)
如果一个point不在shape ,那么它可能仍然包含在bounds对象中:
bounds.contains(p)并不代表shape.contains(p)
getBounds2D在界面
Shape
Rectangle2D那是一个高精度边界框
Shape 。
Shape.getBounds()
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.