|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.geom.Line2D
java.awt.geom.Line2D.Float
public static class Line2D.Float
This class defines a point in float
precision.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.awt.geom.Line2D |
---|
Line2D.Double, Line2D.Float |
Field Summary | |
---|---|
float |
x1
The x coordinate of the first point. |
float |
x2
The x coordinate of the second point. |
float |
y1
The y coordinate of the first point. |
float |
y2
The y coordinate of the second point. |
Constructor Summary | |
---|---|
Line2D.Float()
Construct the line segment (0,0)->(0,0). |
|
Line2D.Float(float x1,
float y1,
float x2,
float y2)
Construct the line segment with the specified points. |
|
Line2D.Float(Point2D p1,
Point2D p2)
Construct the line segment with the specified points. |
Method Summary | |
---|---|
Rectangle2D |
getBounds2D()
Return the exact bounds of this line segment. |
Point2D |
getP1()
Return the first point. |
Point2D |
getP2()
Return the second point. |
double |
getX1()
Return the x coordinate of the first point. |
double |
getX2()
Return the x coordinate of the second point. |
double |
getY1()
Return the y coordinate of the first point. |
double |
getY2()
Return the y coordinate of the second point. |
void |
setLine(double x1,
double y1,
double x2,
double y2)
Set this line to the given points. |
void |
setLine(float x1,
float y1,
float x2,
float y2)
Set this line to the given points. |
Methods inherited from 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 |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public float x1
public float y1
public float x2
public float y2
Constructor Detail |
---|
public Line2D.Float()
public Line2D.Float(float x1, float y1, float x2, float y2)
x1
- the x coordinate of the first pointy1
- the y coordinate of the first pointx2
- the x coordinate of the second pointy2
- the y coordinate of the second pointpublic Line2D.Float(Point2D p1, Point2D p2)
p1
- the first pointp2
- the second point
NullPointerException
- if either point is nullMethod Detail |
---|
public double getX1()
getX1
in class Line2D
public double getY1()
getY1
in class Line2D
public Point2D getP1()
getP1
in class Line2D
public double getX2()
getX2
in class Line2D
public double getY2()
getY2
in class Line2D
public Point2D getP2()
getP2
in class Line2D
public void setLine(double x1, double y1, double x2, double y2)
setLine
in class Line2D
x1
- the new x coordinate of the first pointy1
- the new y coordinate of the first pointx2
- the new x coordinate of the second pointy2
- the new y coordinate of the second pointpublic void setLine(float x1, float y1, float x2, float y2)
x1
- the new x coordinate of the first pointy1
- the new y coordinate of the first pointx2
- the new x coordinate of the second pointy2
- the new y coordinate of the second pointpublic Rectangle2D getBounds2D()
Shape.getBounds()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |