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

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

  public ASTcircle(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 = jjtGetChild(0).getParam();
      int ytop = jjtGetChild(1).getParam();
      int xright = jjtGetChild(2).getParam();
      int ybottom = xright-xleft+ytop;
      xleft = xOff + (xleft*scaleX);
      ytop = yOff + (ytop*scaleY);
      xright = xOff + (xright*scaleX);
      ybottom = yOff + (ybottom*scaleY);
  
     

      if(xleft>xright)
      {
         int temp = xleft;
         xleft = xright;
         xright = temp; 
      }
      if(ybottom<ytop)
      {
         int temp = ybottom;
         ybottom = ytop;
         ytop = temp; 
      }
      float xradius = ((float)((xright-xleft)/2));
      float yradius = ((float)((ybottom-ytop)/2));
 
      
  
      for(int k = 0;k<stampNumber;k++)
      {   
         System.out.println("<ellipse fill=\"none\" stroke-width=\"" + linewidth + "\" stroke=\""
               + col +"\" cx=\"" + (xradius+xleft+(k*stampX)) + "\" cy=\"" + (yradius + 
               ytop + (k*stampY)) + "\" rx=\"" + xradius + "\" ry=\"" + yradius + "\"/>");
      }

  }

}
