Line2D represents a line segment in (x,y)
coordinate space.
This class is only the abstract superclass for all objects that store a 2D line segment. The actual storage representation of the coordinates is left to the subclass.
| Modifier and Type | Class and Description |
|---|---|
| public static class | Line2D.
A line segment specified with double coordinates. |
| public static class | Line2D.
A line segment specified with float coordinates. |
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public Object | Returns: a clone of this instance.Overrides java. Creates a new object of the same class as this object. |
| public boolean | Returns: false because a Line2D contains
no area.the X coordinate of the specified point to be tested x, double the Y coordinate of the specified point to be tested y)Implements java. Tests if a specified coordinate is inside the boundary of this
|
| public boolean | Returns: false because a Line2D contains
no area.the specified p)Point2D to be testedImplements java. Tests if a given |
| public boolean | Returns: false because a Line2D contains
no area.the X coordinate of the upper-left corner of the
specified rectangular area x, double the Y coordinate of the upper-left corner of the
specified rectangular area y, double the width of the specified rectangular area w, double the height of the specified rectangular area h)Implements java. Tests if the interior of this |
| public boolean | Returns: false because a Line2D contains
no area.the specified r)Rectangle2D to be testedImplements java. Tests if the interior of this |
| public Rectangle | getBounds()
Implements java. Returns an integer |
| public abstract Point2D | |
| public abstract Point2D | |
| public PathIterator | getPathIterator(AffineTransform
the specified at)AffineTransformImplements java. Returns an iteration object that defines the boundary of this
|
| public PathIterator | Returns: aPathIterator that defines the boundary of the
flattened Line2Dthe specified at, double AffineTransformthe maximum amount that the control points for a
given curve can vary from colinear before a subdivided
curve is replaced by a straight line connecting the
end points. Since a flatness)Line2D object is
always flat, this parameter is ignored.Implements java. Returns an iteration object that defines the boundary of this
flattened |
| public abstract double | Returns: the X coordinate of the start point of thisLine2D object.Returns the X coordinate of the start point in double precision. |
| public abstract double | Returns: the X coordinate of the end point of thisLine2D object.Returns the X coordinate of the end point in double precision. |
| public abstract double | Returns: the Y coordinate of the start point of thisLine2D object.Returns the Y coordinate of the start point in double precision. |
| public abstract double | Returns: the Y coordinate of the end point of thisLine2D object.Returns the Y coordinate of the end point in double precision. |
| public boolean | intersects(double x, double y, double w, double h)
Implements java. Tests if the interior of the |
| public boolean | intersects(Rectangle2D r)
Implements java. Tests if the interior of the |
| public boolean | Returns: true if this line segment and the specified line segment
intersect each other; false otherwise.the X coordinate of the start point of the
specified line segment x1, double the Y coordinate of the start point of the
specified line segment y1, double the X coordinate of the end point of the
specified line segment x2, double the Y coordinate of the end point of the
specified line segment y2)Tests if the line segment from |
| public boolean | Returns: true if this line segment and the specified line
segment intersect each other;
false otherwise.the specified l)Line2DTests if the specified line segment intersects this line segment. |
| public static boolean | Returns: true if the first specified line segment
and the second specified line segment intersect
each other; false otherwise.the X coordinate of the start point of the first
specified line segment x1, double the Y coordinate of the start point of the first
specified line segment y1, double the X coordinate of the end point of the first
specified line segment x2, double the Y coordinate of the end point of the first
specified line segment y2, double the X coordinate of the start point of the second
specified line segment x3, double the Y coordinate of the start point of the second
specified line segment y3, double the X coordinate of the end point of the second
specified line segment x4, double the Y coordinate of the end point of the second
specified line segment y4)Tests if the line segment from |
| public static double | Returns: a double value that is the distance from the specified point to the specified line.the X coordinate of the start point of the specified line x1, double the Y coordinate of the start point of the specified line y1, double the X coordinate of the end point of the specified line x2, double the Y coordinate of the end point of the specified line y2, double the X coordinate of the specified point being
measured against the specified line px, double the Y coordinate of the specified point being
measured against the specified line py)Returns the distance from a point to a line. |
| public double | Returns: a double value that is the distance from a specified point to the current line.the X coordinate of the specified point being
measured against this line px, double the Y coordinate of the specified point being
measured against this line py)Returns the distance from a point to this line. |
| public double | Returns: a double value that is the distance from a specifiedPoint2D to the current line.the specified pt)Point2D being measuredReturns the distance from a |
| public static double | Returns: a double value that is the square of the distance from the specified point to the specified line.the X coordinate of the start point of the specified line x1, double the Y coordinate of the start point of the specified line y1, double the X coordinate of the end point of the specified line x2, double the Y coordinate of the end point of the specified line y2, double the X coordinate of the specified point being
measured against the specified line px, double the Y coordinate of the specified point being
measured against the specified line py)Returns the square of the distance from a point to a line. |
| public double | Returns: a double value that is the square of the distance from a specified point to the current line.the X coordinate of the specified point being
measured against this line px, double the Y coordinate of the specified point being
measured against this line py)Returns the square of the distance from a point to this line. |
| public double | Returns: a double value that is the square of the distance from a specifiedPoint2D to the current
line.the specified pt)Point2D being measured
against this lineReturns the square of the distance from a specified
|
| public static double | Returns: a double value that is the distance from the specified point to the specified line segment.the X coordinate of the start point of the
specified line segment x1, double the Y coordinate of the start point of the
specified line segment y1, double the X coordinate of the end point of the
specified line segment x2, double the Y coordinate of the end point of the
specified line segment y2, double the X coordinate of the specified point being
measured against the specified line segment px, double the Y coordinate of the specified point being
measured against the specified line segment py)Returns the distance from a point to a line segment. |
| public double | Returns: a double value that is the distance from the specified point to the current line segment.the X coordinate of the specified point being
measured against this line segment px, double the Y coordinate of the specified point being
measured against this line segment py)Returns the distance from a point to this line segment. |
| public double | |
| public static double | Returns: a double value that is the square of the distance from the specified point to the specified line segment.the X coordinate of the start point of the
specified line segment x1, double the Y coordinate of the start point of the
specified line segment y1, double the X coordinate of the end point of the
specified line segment x2, double the Y coordinate of the end point of the
specified line segment y2, double the X coordinate of the specified point being
measured against the specified line segment px, double the Y coordinate of the specified point being
measured against the specified line segment py)Returns the square of the distance from a point to a line segment. |
| public double | Returns: a double value that is the square of the distance from the specified point to the current line segment.the X coordinate of the specified point being
measured against this line segment px, double the Y coordinate of the specified point being
measured against this line segment py)Returns the square of the distance from a point to this line segment. |
| public double | Returns: a double value that is the square of the distance from the specifiedPoint2D to the current
line segment.the specified pt)Point2D being measured against
this line segment.Returns the square of the distance from a |
| public static int | Returns: an integer that indicates the position of the third specified coordinates with respect to the line segment formed by the first two specified coordinates.the X coordinate of the start point of the
specified line segment x1, double the Y coordinate of the start point of the
specified line segment y1, double the X coordinate of the end point of the
specified line segment x2, double the Y coordinate of the end point of the
specified line segment y2, double the X coordinate of the specified point to be
compared with the specified line segment px, double the Y coordinate of the specified point to be
compared with the specified line segment py)Returns an indicator of where the specified point
|
| public int | Returns: an integer that indicates the position of the specified coordinates with respect to thisLine2Dthe X coordinate of the specified point
to be compared with this px, double Line2Dthe Y coordinate of the specified point
to be compared with this py)Line2DReturns an indicator of where the specified point
|
| public int | Returns: an integer that indicates the position of the specifiedPoint2D with respect to this Line2Dthe specified p)Point2D to be compared
with this Line2DReturns an indicator of where the specified |
| public abstract void | setLine(double
the X coordinate of the start point x1, double the Y coordinate of the start point y1, double the X coordinate of the end point x2, double the Y coordinate of the end point y2)Sets the location of the end points of this |
| public void | |
| public void |