/* Generated By:JJTree: Do not edit this line. ASTpolygon.java */

public class ASTpolygon extends SimpleNode {

  protected int j;

  public ASTpolygon(int id) {
    super(id);
  }

  public ASTpolygon(S p, int id) {
    super(p, id);
  }

  
  
  public void getSVG()
  { 
    int linewidth = jjtGetParent().getLineWidth();
    String col = jjtGetParent().getColour();
    int stampNumber = jjtGetParent().getStampNumber();
    int xOff = jjtGetParent().getXOff();
    int yOff = jjtGetParent().getYOff();
    int scaleX = jjtGetParent().getScaleX();
    int scaleY = jjtGetParent().getScaleY();
    int stampX = scaleX * jjtGetParent().getStampX();
    int stampY = scaleY * jjtGetParent().getStampY();
    j = jjtGetNumChildren();
    int[] childArray = new int[j];
  
    for(int l = 0;l<stampNumber;l++)
    {
       for(int k = 0;k<j-3;k=k+2)
       {
   	    System.out.println("<line stroke-width=\"" + linewidth + "\" stroke=\"" + col +"\" x1=\"" + ((scaleX*jjtGetChild(k).getParam())+xOff + (l*stampX)) + "\" y1=\"" + 
             ((scaleY * jjtGetChild(k+1).getParam())+yOff + (l*stampY)) + "\" x2=\"" + ((jjtGetChild(k+2).getParam()*scaleX)+xOff + (l*stampX)) 
             + "\" y2=\"" + ((jjtGetChild(k+3).getParam()*scaleY)+yOff + (l*stampY)) + "\"/>");
       }
 	
       System.out.println("<line stroke-width=\"" + linewidth + "\" stroke=\"" + col +"\" x1=\"" + ((scaleX*jjtGetChild(0).getParam())+xOff + (l*stampX)) + "\" y1=\"" + ((scaleY *jjtGetChild(1).getParam())+yOff + (l*stampY)) + 
                         "\" x2=\"" + ((scaleX*jjtGetChild(j-2).getParam())+xOff + (l*stampX)) + "\" y2=\"" + ((scaleY *jjtGetChild(j-1).getParam())+yOff + (l*stampY)) + "\"/>");

    }
  }
}
