- java.lang.Object
-
- java.awt.geom.Line2D
-
- java.awt.geom.Line2D.Float
-
- All Implemented Interfaces:
-
Shape,Serializable,Cloneable
- Enclosing class:
- Line2D
public static class Line2D.Float 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()200新新新新200新新200新200新新200新200新新200新新200新新200新新200新新200新新新200新新200doublegetX2()X-doublegetY1()新新新新200新新200新新200新新200新新200新新200新新200新新新200新新200新新200新新200doublegetY2()以双精度返回终点的Y坐标。voidsetLine(double x1, double y1, double x2, double y2)将此Line2D的终点的位置设置为指定的双坐标。voidsetLine(float x1, float y1, float x2, float 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的终点的位置设置为指定的双坐标。
-
setLine
public void setLine(float x1, float y1, float x2, float y2)将此Line2D的终点的位置设置为指定的浮点坐标。- 参数
-
x1-x1的X坐标 -
y1-y1的Y坐标 -
x2- 终点的X坐标 -
y2- 终点的Y坐标 - 从以下版本开始:
- 1.2
-
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()
-
-