|
Java Platform 1.2 Beta 4 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.geom.Line2D
This class is only the abstract superclass for all objects which store a 2D line segment. The actual storage representation of the coordinates is left to the subclass.
Inner Class Summary | |
static | Line2D.Double
A line segment specified with double coordinates. |
static | Line2D.Float
A line segment specified with float coordinates. |
Constructor Summary | |
Line2D()
This is an abstract class that cannot be instantiated directly. |
Method Summary | |
Object | clone()
Creates a new object of the same class as this object. |
boolean | contains(double x,
double y,
double w,
double h)
Test if the interior of the Shape entirely contains the given set of rectangular coordinates. |
boolean | contains(double x,
double y)
Test if a given coordinate is inside the boundary of the shape. |
boolean | contains(Point2D p)
Test if a given Point is inside the boundary of the shape. |
boolean | contains(Rectangle2D r)
Test if the interior of the Shape entirely contains the given Rectangle. |
Rectangle | getBounds()
Return the bounding box of the shape. |
abstract Point2D | getP1()
Returns the start point. |
abstract Point2D | getP2()
Returns the end point. |
PathIterator | getPathIterator(AffineTransform at,
double flatness)
Return an iteration object that defines the boundary of the flattened shape. |
PathIterator | getPathIterator(AffineTransform at)
Return an iteration object that defines the boundary of the shape. |
abstract double | getX1()
Returns the X coordinate of the start point in double precision. |
abstract double | getX2()
Returns the X coordinate of the end point in double precision. |
abstract double | getY1()
Returns the Y coordinate of the start point in double precision. |
abstract double | getY2()
Returns the Y coordinate of the end point in double precision. |
boolean | intersects(double x,
double y,
double w,
double h)
Test if the Shape intersects the interior of a given set of rectangular coordinates. |
boolean | intersects(Rectangle2D r)
Test if the Shape intersects the interior of a given Rectangle. |
boolean | intersectsLine(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(Line2D l)
Tests if the given line segment intersects this line segment. |
static boolean | linesIntersect(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). |
static double | ptLineDist(double X1,
double Y1,
double X2,
double Y2,
double PX,
double PY)
Returns the distance from a point to a line. |
double | ptLineDist(double PX,
double PY)
Returns the distance from a point to this line. |
double | ptLineDist(Point2D pt)
Returns the distance from a point to this line. |
static double | ptLineDistSq(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(double PX,
double PY)
Returns the square of the distance from a point to this line. |
double | ptLineDistSq(Point2D pt)
Returns the square of the distance from a point to this line. |
static double | ptSegDist(double X1,
double Y1,
double X2,
double Y2,
double PX,
double PY)
Returns the distance from a point to a line segment. |
double | ptSegDist(double PX,
double PY)
Returns the distance from a point to this line segment. |
double | ptSegDist(Point2D pt)
Returns the distance from a point to this line segment. |
static double | ptSegDistSq(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(double PX,
double PY)
Returns the square of the distance from a point to this line segment. |
double | ptSegDistSq(Point2D pt)
Returns the square of the distance from a point to this line segment. |
static int | relativeCCW(double X1,
double Y1,
double X2,
double Y2,
double PX,
double PY)
Return an indicator of where the specified point (PX, PY) lies with respect to the line segment from (X1, Y1) to (X2, Y2). |
int | relativeCCW(double PX,
double PY)
Return an indicator of where the specified point (PX, PY) lies with respect to this line segment. |
int | relativeCCW(Point2D p)
Return an indicator of where the specified point lies with respect to this line segment. |
abstract void | setLine(double X1,
double Y1,
double X2,
double Y2)
Sets the location of the endpoints of this line to the specified double coordinates. |
void | setLine(Line2D l)
Sets the location of the endpoints of this line to the same as those in the specified Line. |
void | setLine(Point2D p1,
Point2D p2)
Sets the location of the endpoints of this line to the specified Point coordinates. |
Methods inherited from class java.lang.Object | |
equals , finalize , getClass , hashCode , notify , notifyAll , toString , wait , wait , wait |
Constructor Detail |
protected Line2D()
Line2D.Float
,
Line2D.Double
Method Detail |
public abstract double getX1()
public abstract double getY1()
public abstract Point2D getP1()
public abstract double getX2()
public abstract double getY2()
public abstract Point2D getP2()
public abstract void setLine(double X1, double Y1, double X2, double Y2)
public void setLine(Point2D p1, Point2D p2)
public void setLine(Line2D l)
public static int relativeCCW(double X1, double Y1, double X2, double Y2, double PX, double PY)
public int relativeCCW(double PX, double PY)
public int relativeCCW(Point2D p)
public static boolean linesIntersect(double X1, double Y1, double X2, double Y2, double X3, double Y3, double X4, double Y4)
public boolean intersectsLine(double X1, double Y1, double X2, double Y2)
public boolean intersectsLine(Line2D l)
public static double ptSegDistSq(double X1, double Y1, double X2, double Y2, double PX, double PY)
X1
- the x coordinate of the beginning of the line segment
Y1
- the y coordinate of the beginning of the line segment
X2
- the x coordinate of the end of the line segment
Y2
- the y coordinate of the end of the line segment
PX
- the x coordinate of the point being measured
PY
- the y coordinate of the point being measuredpublic static double ptSegDist(double X1, double Y1, double X2, double Y2, double PX, double PY)
X1
- the x coordinate of the beginning of the line segment
Y1
- the y coordinate of the beginning of the line segment
X2
- the x coordinate of the end of the line segment
Y2
- the y coordinate of the end of the line segment
PX
- the x coordinate of the point being measured
PY
- the y coordinate of the point being measuredpublic double ptSegDistSq(double PX, double PY)
PX
- the x coordinate of the point being measured
PY
- the y coordinate of the point being measuredpublic double ptSegDistSq(Point2D pt)
pt
- the point being measuredpublic double ptSegDist(double PX, double PY)
PX
- the x coordinate of the point being measured
PY
- the y coordinate of the point being measuredpublic double ptSegDist(Point2D pt)
pt
- the point being measuredpublic static double ptLineDistSq(double X1, double Y1, double X2, double Y2, double PX, double PY)
X1
- the x coordinate of the beginning of the line
Y1
- the y coordinate of the beginning of the line
X2
- the x coordinate of the end of the line
Y2
- the y coordinate of the end of the line
PX
- the x coordinate of the point being measured
PY
- the y coordinate of the point being measuredpublic static double ptLineDist(double X1, double Y1, double X2, double Y2, double PX, double PY)
X1
- the x coordinate of the beginning of the line
Y1
- the y coordinate of the beginning of the line
X2
- the x coordinate of the end of the line
Y2
- the y coordinate of the end of the line
PX
- the x coordinate of the point being measured
PY
- the y coordinate of the point being measuredpublic double ptLineDistSq(double PX, double PY)
PX
- the x coordinate of the point being measured
PY
- the y coordinate of the point being measuredpublic double ptLineDistSq(Point2D pt)
pt
- the point being measuredpublic double ptLineDist(double PX, double PY)
PX
- the x coordinate of the point being measured
PY
- the y coordinate of the point being measuredpublic double ptLineDist(Point2D pt)
pt
- the point being measuredpublic boolean contains(double x, double y)
public boolean contains(Point2D p)
public boolean intersects(double x, double y, double w, double h)
public boolean intersects(Rectangle2D r)
public boolean contains(double x, double y, double w, double h)
public boolean contains(Rectangle2D r)
public Rectangle getBounds()
public PathIterator getPathIterator(AffineTransform at)
public PathIterator getPathIterator(AffineTransform at, double flatness)
public Object clone()
Cloneable
|
Java Platform 1.2 Beta 4 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |