Packages This Package Prev Next Index
public class java.awt.Polygon extends java.lang.Object (I-§1.12) { // Fields public int npoints; §1.35.1 public int xpoints[]; §1.35.2 public int ypoints[]; §1.35.3 // Constructors public Polygon(); §1.35.4 public Polygon(int xpoints[], int ypoints[], §1.35.5 int npoints); // Methods public void addPoint(int x, int y); §1.35.6 public Rectangle getBoundingBox(); §1.35.7 public boolean inside(int x, int y); §1.35.8 }A polygon consists of a list of , where each successive pair of coordinates defines a side of the polygon
public int npoints
public int xpoints[]
public int ypoints[]
public Polygon()
public Polygon(int xpoints[], int ypoints[], int npoints)
xpoints
-
an array of x coordinates
ypoints
-
an array of y coordinates
npoints
-
the total number of points in the polygon
public void addPoint(int x, int y)
x
-
the x coordinate of the point
y
-
the y coordinate of the point
public Rectangle getBoundingBox()
public boolean inside(int x, int y)
x
-
the xcoordinate of the point to be tested
y
-
the y coordinate of the point to be tested
Packages This Package Prev Next IndexJava API Document (HTML generated by dkramer on April 22, 1996)