Line2D (Java Platform SE 8 ) (original) (raw)
Modifier and Type
Method
Description
[Object](../../../java/lang/Object.html "class in java.lang")
[clone](../../../java/awt/geom/Line2D.html#clone--)()
Creates a new object of the same class as this object.
boolean
[contains](../../../java/awt/geom/Line2D.html#contains-double-double-)(double x, double y)
Tests if a specified coordinate is inside the boundary of thisLine2D
.
boolean
[contains](../../../java/awt/geom/Line2D.html#contains-double-double-double-double-)(double x, double y, double w, double h)
Tests if the interior of this Line2D
entirely contains the specified set of rectangular coordinates.
boolean
[contains](../../../java/awt/geom/Line2D.html#contains-java.awt.geom.Point2D-)([Point2D](../../../java/awt/geom/Point2D.html "class in java.awt.geom") p)
Tests if a given Point2D
is inside the boundary of this Line2D
.
boolean
[contains](../../../java/awt/geom/Line2D.html#contains-java.awt.geom.Rectangle2D-)([Rectangle2D](../../../java/awt/geom/Rectangle2D.html "class in java.awt.geom") r)
Tests if the interior of this Line2D
entirely contains the specified Rectangle2D
.
[Rectangle](../../../java/awt/Rectangle.html "class in java.awt")
[getBounds](../../../java/awt/geom/Line2D.html#getBounds--)()
Returns an integer Rectangle that completely encloses theShape
.
abstract [Point2D](../../../java/awt/geom/Point2D.html "class in java.awt.geom")
[getP1](../../../java/awt/geom/Line2D.html#getP1--)()
Returns the start Point2D
of this Line2D
.
abstract [Point2D](../../../java/awt/geom/Point2D.html "class in java.awt.geom")
[getP2](../../../java/awt/geom/Line2D.html#getP2--)()
Returns the end Point2D
of this Line2D
.
[PathIterator](../../../java/awt/geom/PathIterator.html "interface in java.awt.geom")
[getPathIterator](../../../java/awt/geom/Line2D.html#getPathIterator-java.awt.geom.AffineTransform-)([AffineTransform](../../../java/awt/geom/AffineTransform.html "class in java.awt.geom") at)
Returns an iteration object that defines the boundary of thisLine2D
.
[PathIterator](../../../java/awt/geom/PathIterator.html "interface in java.awt.geom")
[getPathIterator](../../../java/awt/geom/Line2D.html#getPathIterator-java.awt.geom.AffineTransform-double-)([AffineTransform](../../../java/awt/geom/AffineTransform.html "class in java.awt.geom") at, double flatness)
Returns an iteration object that defines the boundary of this flattened Line2D
.
abstract double
[getX1](../../../java/awt/geom/Line2D.html#getX1--)()
Returns the X coordinate of the start point in double precision.
abstract double
[getX2](../../../java/awt/geom/Line2D.html#getX2--)()
Returns the X coordinate of the end point in double precision.
abstract double
[getY1](../../../java/awt/geom/Line2D.html#getY1--)()
Returns the Y coordinate of the start point in double precision.
abstract double
[getY2](../../../java/awt/geom/Line2D.html#getY2--)()
Returns the Y coordinate of the end point in double precision.
boolean
[intersects](../../../java/awt/geom/Line2D.html#intersects-double-double-double-double-)(double x, double y, double w, double h)
Tests if the interior of the Shape
intersects the interior of a specified rectangular area.
boolean
[intersects](../../../java/awt/geom/Line2D.html#intersects-java.awt.geom.Rectangle2D-)([Rectangle2D](../../../java/awt/geom/Rectangle2D.html "class in java.awt.geom") r)
Tests if the interior of the Shape
intersects the interior of a specified Rectangle2D
.
boolean
[intersectsLine](../../../java/awt/geom/Line2D.html#intersectsLine-double-double-double-double-)(double x1, double y1, double x2, double y2)
Tests if the line segment from (x1,y1)
to(x2,y2)
intersects this line segment.
boolean
[intersectsLine](../../../java/awt/geom/Line2D.html#intersectsLine-java.awt.geom.Line2D-)([Line2D](../../../java/awt/geom/Line2D.html "class in java.awt.geom") l)
Tests if the specified line segment intersects this line segment.
static boolean
[linesIntersect](../../../java/awt/geom/Line2D.html#linesIntersect-double-double-double-double-double-double-double-double-)(double x1, double y1, double x2, double y2, double x3, double y3, double x4, double y4)
Tests if the line segment from (x1,y1)
to(x2,y2)
intersects the line segment from (x3,y3)
to (x4,y4)
.
double
[ptLineDist](../../../java/awt/geom/Line2D.html#ptLineDist-double-double-)(double px, double py)
Returns the distance from a point to this line.
static double
[ptLineDist](../../../java/awt/geom/Line2D.html#ptLineDist-double-double-double-double-double-double-)(double x1, double y1, double x2, double y2, double px, double py)
Returns the distance from a point to a line.
double
[ptLineDist](../../../java/awt/geom/Line2D.html#ptLineDist-java.awt.geom.Point2D-)([Point2D](../../../java/awt/geom/Point2D.html "class in java.awt.geom") pt)
Returns the distance from a Point2D
to this line.
double
[ptLineDistSq](../../../java/awt/geom/Line2D.html#ptLineDistSq-double-double-)(double px, double py)
Returns the square of the distance from a point to this line.
static double
[ptLineDistSq](../../../java/awt/geom/Line2D.html#ptLineDistSq-double-double-double-double-double-double-)(double x1, double y1, double x2, double y2, double px, double py)
Returns the square of the distance from a point to a line.
double
[ptLineDistSq](../../../java/awt/geom/Line2D.html#ptLineDistSq-java.awt.geom.Point2D-)([Point2D](../../../java/awt/geom/Point2D.html "class in java.awt.geom") pt)
Returns the square of the distance from a specifiedPoint2D
to this line.
double
[ptSegDist](../../../java/awt/geom/Line2D.html#ptSegDist-double-double-)(double px, double py)
Returns the distance from a point to this line segment.
static double
[ptSegDist](../../../java/awt/geom/Line2D.html#ptSegDist-double-double-double-double-double-double-)(double x1, double y1, double x2, double y2, double px, double py)
Returns the distance from a point to a line segment.
double
[ptSegDist](../../../java/awt/geom/Line2D.html#ptSegDist-java.awt.geom.Point2D-)([Point2D](../../../java/awt/geom/Point2D.html "class in java.awt.geom") pt)
Returns the distance from a Point2D
to this line segment.
double
[ptSegDistSq](../../../java/awt/geom/Line2D.html#ptSegDistSq-double-double-)(double px, double py)
Returns the square of the distance from a point to this line segment.
static double
[ptSegDistSq](../../../java/awt/geom/Line2D.html#ptSegDistSq-double-double-double-double-double-double-)(double x1, double y1, double x2, double y2, double px, double py)
Returns the square of the distance from a point to a line segment.
double
[ptSegDistSq](../../../java/awt/geom/Line2D.html#ptSegDistSq-java.awt.geom.Point2D-)([Point2D](../../../java/awt/geom/Point2D.html "class in java.awt.geom") pt)
Returns the square of the distance from a Point2D
to this line segment.
int
[relativeCCW](../../../java/awt/geom/Line2D.html#relativeCCW-double-double-)(double px, double py)
Returns an indicator of where the specified point(px,py)
lies with respect to this line segment.
static int
[relativeCCW](../../../java/awt/geom/Line2D.html#relativeCCW-double-double-double-double-double-double-)(double x1, double y1, double x2, double y2, double px, double py)
Returns an indicator of where the specified point(px,py)
lies with respect to the line segment from(x1,y1)
to (x2,y2)
.
int
[relativeCCW](../../../java/awt/geom/Line2D.html#relativeCCW-java.awt.geom.Point2D-)([Point2D](../../../java/awt/geom/Point2D.html "class in java.awt.geom") p)
Returns an indicator of where the specified Point2D
lies with respect to this line segment.
abstract void
[setLine](../../../java/awt/geom/Line2D.html#setLine-double-double-double-double-)(double x1, double y1, double x2, double y2)
Sets the location of the end points of this Line2D
to the specified double coordinates.
void
[setLine](../../../java/awt/geom/Line2D.html#setLine-java.awt.geom.Line2D-)([Line2D](../../../java/awt/geom/Line2D.html "class in java.awt.geom") l)
Sets the location of the end points of this Line2D
to the same as those end points of the specified Line2D
.
void
[setLine](../../../java/awt/geom/Line2D.html#setLine-java.awt.geom.Point2D-java.awt.geom.Point2D-)([Point2D](../../../java/awt/geom/Point2D.html "class in java.awt.geom") p1,[Point2D](../../../java/awt/geom/Point2D.html "class in java.awt.geom") p2)
Sets the location of the end points of this Line2D
to the specified Point2D
coordinates.