- java.lang.Object
-
- java.awt.geom.Line2D
-
- java.awt.geom.Line2D.Double
-
- All Implemented Interfaces:
-
Shape,Serializable,Cloneable
- Enclosing class:
- Line2D
public static class Line2D.Double extends Line2D implements Serializable
用双坐标指定的线段。- 从以下版本开始:
- 1.2
- 另请参见:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class java.awt.geom.Line2D
Line2D.Double, Line2D.Float
-
-
方法摘要
所有方法 接口方法 具体的方法 Modifier and Type 方法 描述 Rectangle2DgetBounds2D()返回Shape比getBounds方法更高精度和更准确的边界框。Point2DgetP1()返回开始Point2D如此Line2D。Point2DgetP2()返回结束Point2D如此Line2D。doublegetX1()以双精度返回起始点的X坐标。doublegetX2()以双精度返回终点的X坐标。doublegetY1()以双精度返回起始点的Y坐标。doublegetY2()以双精度返回终点的Y坐标。voidsetLine(double x1, double y1, double x2, double y2)将此Line2D的终点的位置设置为指定的双坐标。-
Methods inherited from class java.awt.geom.Line2D
clone, contains, contains, contains, contains, getBounds, getPathIterator, getPathIterator, intersects, intersects, intersectsLine, intersectsLine, linesIntersect, ptLineDist, ptLineDist, ptLineDist, ptLineDistSq, ptLineDistSq, ptLineDistSq, ptSegDist, ptSegDist, ptSegDist, ptSegDistSq, ptSegDistSq, ptSegDistSq, relativeCCW, relativeCCW, relativeCCW, setLine, setLine
-
-
-
-
方法详细信息
-
getX1
public double getX1()
200新新新新200新新200新200新新200新200新新200新新200新新200新新200新新200新新新200新新200
-
getY1
public double getY1()
新新新新200新新200新新200新新200新新200新新200新新200新新新200新新200新新200新新200
-
getP1
public Point2D getP1()
返回开始Point2D如此Line2D。
-
getY2
public double getY2()
以双精度返回终点的Y坐标。
-
getP2
public Point2D getP2()
返回Point2D的结尾Line2D。
-
setLine
public void setLine(double x1, double y1, double x2, double y2)将此Line2D的终点的位置设置为指定的双坐标。
-
getBounds2D
public Rectangle2D getBounds2D()
返回Shape比getBounds方法更高精度和更准确的边界框。 请注意,不保证返回的Rectangle2D是封闭的最小边界框Shape,只表示Shape完全在指定的范围内Rectangle2D。 该方法返回的边界框通常比getBounds方法返回的getBounds更小,因为溢出问题永远不会失败,因为返回值可以是使用双精度值存储维度的Rectangle2D的实例。请注意, definition of insideness可能导致shape的定义轮廓上的
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()
-
-