- java.lang.Object
-
- java.awt.geom.RectangularShape
-
- java.awt.geom.Ellipse2D
-
- java.awt.geom.Ellipse2D.Double
-
- All Implemented Interfaces:
-
Shape,Serializable,Cloneable
- Enclosing class:
- Ellipse2D
public static class Ellipse2D.Double extends Ellipse2D implements Serializable
Double类定义了一个double精度指定的椭圆。- 从以下版本开始:
- 1.2
- 另请参见:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class java.awt.geom.Ellipse2D
Ellipse2D.Double, Ellipse2D.Float
-
-
方法摘要
所有方法 接口方法 具体的方法 Modifier and Type 方法 描述 Rectangle2DgetBounds2D()比getBounds方法返回Shape高精度和更准确的边界框。doublegetHeight()以double精度返回框架矩形的高度。doublegetWidth()以double精度返回框架矩形的宽度。doublegetX()返回double精度的成帧矩形左上角的X坐标。doublegetY()返回double精度的成帧矩形左上角的Y坐标。booleanisEmpty()确定RectangularShape是否为空。voidsetFrame(double x, double y, double w, double h)将此Shape的成帧矩形的位置和大小设置为指定的矩形值。-
Methods inherited from class java.awt.geom.Ellipse2D
contains, contains, equals, getPathIterator, hashCode, intersects
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from class java.awt.geom.RectangularShape
clone, contains, contains, getBounds, getCenterX, getCenterY, getFrame, getMaxX, getMaxY, getMinX, getMinY, getPathIterator, intersects, setFrame, setFrame, setFrameFromCenter, setFrameFromCenter, setFrameFromDiagonal, setFrameFromDiagonal
-
-
-
-
方法详细信息
-
getX
public double getX()
返回double精度的框架矩形左上角的X坐标。- Specified by:
-
getX在RectangularShape - 结果
- 框架矩形左上角的X坐标。
- 从以下版本开始:
- 1.2
-
getY
public double getY()
返回double精度的框架矩形左上角的Y坐标。- Specified by:
-
getY在RectangularShape - 结果
- 框架矩形左上角的Y坐标。
- 从以下版本开始:
- 1.2
-
getWidth
public double getWidth()
以double精度返回框架矩形的宽度。- Specified by:
-
getWidth在RectangularShape - 结果
- 框架矩形的宽度。
- 从以下版本开始:
- 1.2
-
getHeight
public double getHeight()
以double精度返回框架矩形的高度。- Specified by:
-
getHeight在RectangularShape - 结果
- 框架矩形的高度。
- 从以下版本开始:
- 1.2
-
isEmpty
public boolean isEmpty()
确定RectangularShape是否为空。 当RectangularShape为空时,它不包含任何区域。- Specified by:
-
isEmpty在RectangularShape - 结果
-
true如果RectangularShape是空的; 否则为false。 - 从以下版本开始:
- 1.2
-
setFrame
public void setFrame(double x, double y, double w, double h)将此Shape的成帧矩形的位置和大小设置为指定的矩形值。- Specified by:
-
setFrame在RectangularShape - 参数
-
x- 指定矩形左上角的X坐标 -
y- 指定矩形左上角的Y坐标 -
w- 指定矩形形状的宽度 -
h- 指定长方形的高度 - 从以下版本开始:
- 1.2
- 另请参见:
-
RectangularShape.getFrame()
-
getBounds2D
public Rectangle2D getBounds2D()
返回Shape高精度和更准确的边界框,比getBounds方法。 请注意,不保证返回的Rectangle2D是封闭的最小边界框Shape,只表示Shape完全在指定的范围内Rectangle2D。 此方法返回的边界通常比getBounds方法返回的getBounds更getBounds并且由于溢出问题而永远不会失败,因为返回值可以是使用双精度值存储维度的Rectangle2D的实例。请注意, definition of insideness可能导致
bounds对象定义轮廓上的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)- Specified by:
-
getBounds2D在接口Shape - 结果
-
的实例
Rectangle2D那是一个高精度边界框Shape。 - 从以下版本开始:
- 1.2
- 另请参见:
-
Shape.getBounds()
-
-