|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.microemu.device.impl.Shape
org.microemu.device.impl.Polygon
public class Polygon
This class is intended for storing georaphical polygons such as boundary data for wards, coastlines etc.
Extracted from uk.ac.leeds.ccg.geotools.GeoPolygon
| Field Summary | |
|---|---|
int |
npoints
Number of points in polygon. |
int[] |
xpoints
Array of points. |
int[] |
ypoints
Array of points. |
| Constructor Summary | |
|---|---|
Polygon()
Create an empty polygon. |
|
Polygon(int[] xpoints,
int[] ypoints,
int npoints)
Construct a polygon with full details. |
|
Polygon(Polygon poly)
Construct a GeoPolygon based on an existing GeoPolygon. |
|
| Method Summary | |
|---|---|
void |
addPoint(int x,
int y)
Add a vertex to the polygon. |
boolean |
contains(int x,
int y)
Tests to see if a point is contained by this polygon. |
org.microemu.device.impl.Rectangle |
getBounds()
|
| Methods inherited from class org.microemu.device.impl.Shape |
|---|
clone |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public int npoints
public int[] xpoints
public int[] ypoints
| Constructor Detail |
|---|
public Polygon()
public Polygon(int[] xpoints,
int[] ypoints,
int npoints)
id - Polygon ID.xcent - X-coordinate of centroid.ycent - Y-coordinate of centroid.xpoints - Array of x values (npoints in size).ypoints - Array of y values (npoints in size).npoints - Number of points.public Polygon(Polygon poly)
poly - GeoPolygon to clone.| Method Detail |
|---|
public void addPoint(int x,
int y)
x - X-coordinate of point to add.y - Y-coordinate of point to add.public org.microemu.device.impl.Rectangle getBounds()
getBounds in class org.microemu.device.impl.Shape
public boolean contains(int x,
int y)
contains in class org.microemu.device.impl.Shapep - The GeoPoint to test.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||