|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||
java.lang.Object
|
+--java.awt.Polygon
|
+--Polygon
This class represents a polygon described by its vertices. The polygon is closed by defauly (ie the last point is not connected to the first one.
| Inner classes inherited from class java.awt.Polygon |
java.awt.Polygon.PolygonPathIterator |
| 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.Polygon |
bounds,
npoints,
serialVersionUID,
xpoints,
ypoints |
| Fields inherited from interface GeometricObject |
CIRCLE,
ELLIPSE,
LINE,
POINT,
POLYGON,
RECTANGLE,
SQUARE |
| Constructor Summary | |
(package private) |
Polygon()
The constructor. |
(package private) |
Polygon(int[] xpoints,
int[] ypoints,
int npoints)
The constructor. |
(package private) |
Polygon(Line line)
The constructor. |
(package private) |
Polygon(Point[] points)
The constructor. |
(package private) |
Polygon(java.awt.Polygon p)
The constructor. |
(package private) |
Polygon(Polygon p)
The constructor. |
| Method Summary | |
void |
addPointDouble(double x,
double y)
add point for doubles |
int |
closestNeighborIndex(Point p)
Returns the index of the vertices that is closest to point p. |
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. |
void |
drawAngleAt(int i,
Point reference_point)
Draws an arc (angle) on the ith vertex (start from 0) using the current graphics context. |
double[] |
getAbsoluteAngles()
Returns an array containing the angles that each edge makes with the x axis. |
double[] |
getAbsolutePositiveAngles()
Returns an array containing the angles that each edge makes with the x axis. |
Polygon |
getDataPoints()
This method is used to get the original data points that forms this GeometricObject |
Line |
getEdge(int n)
This method returns the nth edge of this Polygon. |
java.awt.Rectangle |
getHorizontalBounds()
Supplied for completeness. |
double[] |
getMajorAngles()
Return the major angles in this polygon |
Polygon |
getPolygonalBounds()
This method should return a polygon that fully contains the current object. |
Rectangle |
getRectangularBounds()
Supplied for completeness. |
Rectangle |
getRectangularBounds(int steps)
Supplied for completeness. |
long |
getTimeStamp()
Returns the time stamp of the current Terminal |
java.lang.String |
getType()
Implement GeometricObject |
void |
normalize(double[] angle_set)
Normalize the polygon edges so that the angles they make with the x axis are chosen from the given angle set. |
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 |
Point |
pointAt(int i)
Returns the ith point in this Polygon |
boolean |
pointIsOn(Point p,
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 |
rotate(double theta)
This method rotates the polygon by theta radians CCW. |
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. |
java.lang.String |
toString()
Override toString |
boolean |
touches(GeometricObject object)
This method should return true if the input objects touch. |
boolean |
tryCombining(java.lang.Object o,
int tolerance)
Try combining the input object with this Polygon. |
| Methods inherited from class java.awt.Polygon |
addPoint,
calculateBounds,
contains,
contains,
contains,
contains,
contains,
contains,
getBoundingBox,
getBounds,
getBounds2D,
getCrossings,
getPathIterator,
getPathIterator,
inside,
intersects,
intersects,
translate,
updateBounds |
| Methods inherited from class java.lang.Object |
|
| Field Detail |
private Polygon points
public long time_stamp
public java.awt.Graphics graphics
| Constructor Detail |
Polygon()
Polygon(java.awt.Polygon p)
Polygon(Point[] points)
Polygon(int[] xpoints,
int[] ypoints,
int npoints)
Polygon(Polygon p)
Polygon(Line line)
| Method Detail |
public java.lang.String getType()
public void addPointDouble(double x,
double y)
public java.lang.String toString()
public void paint()
public void paintOriginal(java.awt.Graphics g)
public void paint(java.awt.Graphics g)
public boolean pointIsOn(Point p,
int radius)
public boolean pointIsOnOriginal(Point p,
int radius)
public int closestNeighborIndex(Point p)
public Point pointAt(int i)
public void drawAngleAt(int i,
Point reference_point)
public void setGraphicsContext(java.awt.Graphics g)
public boolean touches(GeometricObject object)
public java.awt.Rectangle getHorizontalBounds()
public Rectangle getRectangularBounds()
public boolean containsGeometricObject(GeometricObject object)
public Rectangle getRectangularBounds(int steps)
public Line getEdge(int n)
public Polygon getPolygonalBounds()
public void rotate(double theta)
public int spatialRelation(GeometricObject object)
public void setTimeStamp(long time_stamp)
public long getTimeStamp()
public void setDataPoints(Polygon points)
public Polygon getDataPoints()
public boolean containsGeometricObjects(GeometricObject[] objects)
public double[] getAbsoluteAngles()
public double[] getAbsolutePositiveAngles()
public boolean tryCombining(java.lang.Object o,
int tolerance)
public double[] getMajorAngles()
public void normalize(double[] angle_set)
|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||