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

public class ASTrectangle extends SimpleNode {
  public ASTrectangle(int id) {
    super(id);
  }

  public ASTrectangle(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();
    int xleft = xOff + (jjtGetChild(0).getParam()*scaleX);
    int ytop = yOff + (jjtGetChild(1).getParam()*scaleY);
    int xright = xOff + (jjtGetChild(2).getParam()*scaleX);
    int ybottom = yOff + (jjtGetChild(3).getParam()*scaleY);
    float halflinewidth = (float)(jjtGetParent().jjtGetParent().getLineWidth())/2;
    for(int k = 0;k<stampNumber;k++)
    { 
       if(scaleX<0)
       {
         halflinewidth = 0-halflinewidth;
       } 
       System.out.println("<line stroke-width=\"" + linewidth + "\" stroke=\"" + col +"\" x1=\"" + (xleft-halflinewidth+(k*stampX)) + "\" y1=\"" + (ytop+(k*stampY)) + "\" x2=\"" + (xright+halflinewidth+(k*stampX)) + "\" y2=\"" + (ytop+(k*stampY)) + "\"/>");
       System.out.println("<line stroke-width=\"" + linewidth + "\" stroke=\"" + col +"\" x1=\"" + (xright+halflinewidth+(k*stampX)) + "\" y1=\"" + (ybottom+(k*stampY)) + "\" x2=\"" + (xleft-halflinewidth+(k*stampX)) + "\" y2=\"" + (ybottom+(k*stampY)) + "\"/>");
       if(linewidth<0)
       {
         halflinewidth = 0-halflinewidth;
       }
       if(scaleY<0)
       {
         halflinewidth = 0-halflinewidth;
       }
         System.out.println("<line stroke-width=\"" + linewidth + "\" stroke=\"" + col +"\" x1=\"" + (xleft+(k*stampX)) + "\" y1=\"" + (ybottom+halflinewidth+(k*stampY)) + "\" x2=\"" + (xleft+(k*stampX)) + "\" y2=\"" + (ytop-halflinewidth+(k*stampY)) + "\"/>");
         System.out.println("<line stroke-width=\"" + linewidth + "\" stroke=\"" + col +"\" x1=\"" + (xright+(k*stampX)) + "\" y1=\"" + (ytop-halflinewidth+(k*stampY)) + "\" x2=\"" + (xright+(k*stampX)) + "\" y2=\"" + (ybottom+halflinewidth+(k*stampY)) + "\"/>");
       if(linewidth<0)
       {
         halflinewidth = 0-halflinewidth;
       }
     }
  }

}
