Line2D.Float (Java SE 10 & JDK 10 )
-
-
Nested Class Summary
-
Nested classes/interfaces declared in class java.awt.geom.Line2D
Line2D.Double, Line2D.Float
-
-
Field Summary
Fields Modifier and Type Field Description floatx1The X coordinate of the start point of the line segment.
floatx2The X coordinate of the end point of the line segment.
floaty1The Y coordinate of the start point of the line segment.
floaty2The Y coordinate of the end point of the line segment.
-
Constructor Summary
Constructors Constructor Description Float()Constructs and initializes a Line with coordinates (0, 0) → (0, 0).
Float(float x1, float y1, float x2, float y2)Constructs and initializes a Line from the specified coordinates.
Float(Point2D p1, Point2D p2)Constructs and initializes a
Line2Dfrom the specifiedPoint2Dobjects.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Rectangle2DgetBounds2D()Returns a high precision and more accurate bounding box of the
Shapethan thegetBoundsmethod.Point2DgetP1()Returns the start
Point2Dof thisLine2D.Point2DgetP2()Returns the end
Point2Dof thisLine2D.doublegetX1()Returns the X coordinate of the start point in double precision.
doublegetX2()Returns the X coordinate of the end point in double precision.
doublegetY1()Returns the Y coordinate of the start point in double precision.
doublegetY2()Returns the Y coordinate of the end point in double precision.
voidsetLine(double x1, double y1, double x2, double y2)Sets the location of the end points of this
Line2Dto the specified double coordinates.voidsetLine(float x1, float y1, float x2, float y2)Sets the location of the end points of this
Line2Dto the specified float coordinates.-
Methods declared in 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
-
-