intermediate/PolygonExample

From ggc

Jump to: navigation, search

01 package intermediate;
02 //start auto-imports
03 import java.awt.geom.*;
04 import java.awt.*;
05 //end auto-imports
06 
07 
08 /**
09  * All about my application.
10  @author Jam Jenkins
11  */
12 public class PolygonExample
13 {
14   public static void main(String[] args)
15   {
16     int[] x={1221};
17     int[] y={1122};
18     Polygon poly=new Polygon(x, y, x.length);
19     PathIterator iter=poly.getPathIterator(null);
20     double[] coordinate=new double[6];
21     while(!iter.isDone())
22     {
23       int type=iter.currentSegment(coordinate);
24       System.out.println("("+coordinate[0]+
25                          ", "+coordinate[1]+") of type"+type);
26       iter.next();
27     }
28   }
29 }


Download/View intermediate/PolygonExample.java





Views
Personal tools
Add to 
del.icio.usAdd to 
diggAdd to 
FacebookAdd to 
favoritesAdd to 
GoogleAdd to 
MySpaceAdd to 
PrintAdd to 
SlashdotAdd to 
StumbleUponAdd to 
Twitter