public static class Ellipse2D.Double extends Ellipse2D implements Serializable
Double类定义了一个在
double精度中
double的椭圆。
Ellipse2D.Double, Ellipse2D.Float| Modifier and Type | Field and Description |
|---|---|
double |
height
总高
Ellipse2D 。
|
double |
width
这个
Ellipse2D的整体宽度。
|
double |
x
此Ellipse2D框架矩形左上角的X
Ellipse2D 。
|
double |
y
这个Ellipse2D框架矩形左上角的Y
Ellipse2D 。
|
| Constructor and Description |
|---|
Double()
构造一个新的
Ellipse2D ,初始化为位置(0,0)和大小(0,0)。
|
Double(double x, double y, double w, double 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到指定的矩形的值。
|
contains, contains, equals, getPathIterator, hashCode, intersectsclone, contains, contains, getBounds, getCenterX, getCenterY, getFrame, getMaxX, getMaxY, getMinX, getMinY, getPathIterator, intersects, setFrame, setFrame, setFrameFromCenter, setFrameFromCenter, setFrameFromDiagonal, setFrameFromDiagonalpublic double x
Ellipse2D 。
public double y
Ellipse2D 。
public double width
Ellipse2D的整体宽度。
public double height
Ellipse2D 。
public Double()
Ellipse2D ,初始化为位置(0,0)和大小(0,0)。
public Double(double x,
double y,
double w,
double 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(double x,
double y,
double w,
double h)
Shape到指定的矩形的值。
setFrame在
RectangularShape
x - 指定矩形左上角的X坐标
y - 指定矩形左上角的Y坐标
w - 指定矩形形状的宽度
h - 指定矩形形状的高度
RectangularShape.getFrame()
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.