|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||
java.lang.Object
|
+--java.awt.geom.Line2D
|
+--java.awt.geom.Line2D.Double
|
+--Line
This class represents a line described by its end-points p, q.
| Inner classes inherited from class java.awt.geom.Line2D |
java.awt.geom.Line2D.Double,
java.awt.geom.Line2D.Float |
| Field Summary | |
java.awt.Graphics |
graphics
Graphics context for this Geometric object. |
private Polygon |
points
The original data points |
long |
time_stamp
Time stamp of this object. |
| Fields inherited from class java.awt.geom.Line2D.Double |
x1,
x2,
y1,
y2 |
| Fields inherited from interface GeometricObject |
CIRCLE,
ELLIPSE,
LINE,
POINT,
POLYGON,
RECTANGLE,
SQUARE |
| Constructor Summary | |
(package private) |
Line()
The constructor. |
(package private) |
Line(double x1,
double y1,
double x2,
double y2)
The constructor. |
(package private) |
Line(Line line)
The constructor. |
(package private) |
Line(Point p,
Point q)
The constructor. |
| Method Summary | |
double |
chooseApproximateAngle(double[] angle_set)
Returns the angle that is closest to the angle that this line makes with the x axis from the input argument. |
boolean |
containsGeometricObject(GeometricObject object)
Returns false if the argument is not completely inside this object. |
boolean |
containsGeometricObjects(GeometricObject[] objects)
Returns false if the objects in the input array are completely inside this object. |
double |
getAngle()
Returns the angle of the object WRT the x axis in radians. |
double |
getCartesianAngle()
Returns the angle of the object WRT the x axis in radians. |
Polygon |
getDataPoints()
This method is used to get the original data points that forms this GeometricObject |
Point |
getIntersection(Line line)
Returns the intersection of the two infinite length lines described by this line and the argument. |
Polygon |
getPolygonalBounds()
This method should return a polygon that fully contains the current object. |
Rectangle |
getRectangularBounds()
Supplied for completeness. |
long |
getTimeStamp()
Returns the time stamp of the current Terminal |
java.lang.String |
getType()
Implement GeometricObject |
static boolean |
isLine(Polygon p)
Returns true if the input Polygon is a line. |
double |
length()
Returns the length of this line. |
void |
paint()
Draw the object |
void |
paint(java.awt.Graphics g)
Draw the object |
void |
paintOriginal(java.awt.Graphics g)
This method is used to paint the original data points that forms this GeometricObject |
void |
pointDown()
Swaps the first and the second points if needed so that the second point is below the first one. |
boolean |
pointIsOn(Point point,
int radius)
Returns true if the point is within +-radius distance from the curve defining the object. |
boolean |
pointIsOnOriginal(Point p,
int radius)
Returns true if the point is within +-radius distance from the original curve defining the object. |
void |
pointLeft()
Swaps the first and the second points if needed so that the second point is to the left of the first one. |
void |
pointRight()
Swaps the first and the second points if needed so that the second point is to the right of the first one. |
void |
pointUp()
Swaps the first and the second points if needed so that the second point is above the first one. |
void |
setDataPoints(Polygon points)
This method is used to set the original data points that forms this GeometricObject |
void |
setGraphicsContext(java.awt.Graphics g)
Set graphics context for this Geometric object. |
void |
setTimeStamp(long time_stamp)
Sets the time stamp of the current Terminal |
int |
spatialRelation(GeometricObject object)
This method should return the spatial relation of the input parameter with respect to this object. |
void |
swapPoints()
Swaps the first and the secons points. |
Polygon |
toPolygon()
This method is used to get the original data points that forms this GeometricObject |
java.lang.String |
toString()
Override toString |
boolean |
touches(GeometricObject object)
This method should return true if the input objects touch. |
| Methods inherited from class java.awt.geom.Line2D.Double |
getBounds2D,
getP1,
getP2,
getX1,
getX2,
getY1,
getY2,
setLine |
| 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 |
|
| Field Detail |
private Polygon points
public long time_stamp
public java.awt.Graphics graphics
| Constructor Detail |
Line(Line line)
Line()
Line(double x1,
double y1,
double x2,
double y2)
Line(Point p,
Point q)
| Method Detail |
public java.lang.String getType()
public java.lang.String toString()
public void paint()
public void paint(java.awt.Graphics g)
public void paintOriginal(java.awt.Graphics g)
public boolean pointIsOn(Point point,
int radius)
public boolean pointIsOnOriginal(Point p,
int radius)
public void setGraphicsContext(java.awt.Graphics g)
public boolean touches(GeometricObject object)
public Rectangle getRectangularBounds()
public boolean containsGeometricObject(GeometricObject object)
public Polygon getPolygonalBounds()
public int spatialRelation(GeometricObject object)
public double getCartesianAngle()
public double getAngle()
public static boolean isLine(Polygon p)
public void setTimeStamp(long time_stamp)
public long getTimeStamp()
public void swapPoints()
public void pointRight()
public void pointLeft()
public void pointUp()
public void pointDown()
public void setDataPoints(Polygon points)
public Polygon getDataPoints()
public Polygon toPolygon()
public double chooseApproximateAngle(double[] angle_set)
public boolean containsGeometricObjects(GeometricObject[] objects)
public double length()
public Point getIntersection(Line line)
throws GeometricComputationException
|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||