public static class Ellipse2D.Float extends Ellipse2D implements Serializable
Float类定义了一个在
float精度中
float的椭圆。
Ellipse2D.Double, Ellipse2D.Float| Modifier and Type | Field and Description |
|---|---|
float |
height
这个
Ellipse2D的整体高度。
|
float |
width
这个
Ellipse2D的整体宽度。
|
float |
x
此Ellipse2D框架矩形左上角的X
Ellipse2D 。
|
float |
y
这个Ellipse2D框架矩形左上角的Y
Ellipse2D 。
|
| Constructor and Description |
|---|
Float()
构造一个新的
Ellipse2D ,初始化为位置(0,0)和大小(0,0)。
|
Float(float x, float y, float w, float h)
构造并初始化一个
Ellipse2D从指定的坐标。
|
| Modifier and Type | Method and Description |
|---|---|
Rectangle2D |
getBounds2D()
Shape比
getBounds方法返回一个高精度和更准确的边界框。
|
double |
getHeight()
返回
double精度框架矩形的高度。
|
double |
getWidth()
返回
double精度的框架矩形的宽度。
|
double |
getX()
以double精度返回框架矩形左上角的
double坐标。
|
double |
getY()
返回double精度中框架矩形左上角的
double坐标。
|
boolean |
isEmpty()
确定是否
RectangularShape是空的。
|
void |
setFrame(double x, double y, double w, double h)
设置此的框架矩形的位置和大小
Shape到指定的矩形的值。
|
void |
setFrame(float x, float y, float w, float h)
设置此的框架矩形的位置和大小
Shape到指定的矩形的值。
|
contains, contains, equals, getPathIterator, hashCode, intersectsclone, contains, contains, getBounds, getCenterX, getCenterY, getFrame, getMaxX, getMaxY, getMinX, getMinY, getPathIterator, intersects, setFrame, setFrame, setFrameFromCenter, setFrameFromCenter, setFrameFromDiagonal, setFrameFromDiagonalpublic float x
Ellipse2D 。
public float y
Ellipse2D 。
public float width
Ellipse2D的整体宽度。
public float height
Ellipse2D的整体高度。
public Float()
Ellipse2D ,初始化为位置(0,0)和大小(0,0)。
public Float(float x,
float y,
float w,
float h)
Ellipse2D从指定的坐标。
x - 框架矩形左上角的X坐标
y - 框架矩形左上角的Y坐标
w - 框架矩形的宽度
h - 框架矩形的高度
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 boolean isEmpty()
RectangularShape是空的。
当RectangularShape为空时,它不包含任何区域。
isEmpty在
RectangularShape
true如果RectangularShape是空的;
false否则。
public void setFrame(float x,
float y,
float w,
float h)
Shape到指定的矩形的值。
x - 指定矩形左上角的X坐标
y - 指定矩形左上角的Y坐标
w - 指定矩形形状的宽度
h - 指定
h的高度
public void setFrame(double x,
double y,
double w,
double h)
Shape到指定的矩形的值。
setFrame在
RectangularShape
x - 指定矩形左上角的X坐标
y - 指定矩形左上角的Y坐标
w - 指定矩形形状的宽度
h - 指定
h的高度
RectangularShape.getFrame()
public Rectangle2D getBounds2D()
Shape比getBounds方法更高精度和更准确的边界框。
需要注意的是没有保证返回Rectangle2D是最小的边框包围Shape ,只表示Shape完全在指定的范围内Rectangle2D 。
通过此方法返回的边界框通常比通过返回的更紧密getBounds方法,而且永远不会因为溢出问题,因为返回值可以是实例Rectangle2D一个使用双精度值存储尺寸。
请注意, definition of insideness可能导致在返回的bounds对象中可能不会将shape定义轮廓上的点shape包含的情况,但仅在原始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.