1 16 17 package org.apache.poi.hssf.usermodel; 18 19 22 public class HSSFPolygon 23 extends HSSFShape 24 { 25 int[] xPoints; 26 int[] yPoints; 27 int drawAreaWidth = 100; 28 int drawAreaHeight = 100; 29 30 HSSFPolygon( HSSFShape parent, HSSFAnchor anchor ) 31 { 32 super( parent, anchor ); 33 } 34 35 public int[] getXPoints() 36 { 37 return xPoints; 38 } 39 40 public int[] getYPoints() 41 { 42 return yPoints; 43 } 44 45 public void setPoints(int[] xPoints, int[] yPoints) 46 { 47 this.xPoints = cloneArray(xPoints); 48 this.yPoints = cloneArray(yPoints); 49 } 50 51 private int[] cloneArray( int[] a ) 52 { 53 int[] result = new int[a.length]; 54 for ( int i = 0; i < a.length; i++ ) 55 result[i] = a[i]; 56 57 return result; 58 } 59 60 65 public void setPolygonDrawArea( int width, int height ) 66 { 67 this.drawAreaWidth = width; 68 this.drawAreaHeight = height; 69 } 70 71 public int getDrawAreaWidth() 72 { 73 return drawAreaWidth; 74 } 75 76 public int getDrawAreaHeight() 77 { 78 return drawAreaHeight; 79 } 80 81 82 } 83 | Popular Tags |