public abstract class Line2D extends Object implements Shape, Cloneable
Line2D
represents a line segment in (x,y)
coordinate space. This class, like all of the Java 2D API, uses a
default coordinate system called user space in which the y-axis
values increase downward and x-axis values increase to the right. For
more information on the user space coordinate system, see the
Coordinate Systems section of the Java 2D Programmer's Guide.
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 |
---|---|
static class |
Line2D.Double
A line segment specified with double coordinates.
|
static class |
Line2D.Float
A line segment specified with float coordinates.
|
Modifier | Constructor and Description |
---|---|
protected |
Line2D()
This is an abstract class that cannot be instantiated directly.
|
Modifier and Type | Method and Description |
---|---|
Object |
clone()
Creates a new object of the same class as this object.
|
boolean |
contains(double x,
double y)
Tests if a specified coordinate is inside the boundary of this
Line2D . |
boolean |
contains(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(Point2D p)
Tests if a given
Point2D is inside the boundary of
this Line2D . |
boolean |
contains(Rectangle2D r)
Tests if the interior of this
Line2D entirely contains
the specified Rectangle2D . |
Rectangle |
getBounds()
Returns an integer |