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

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

  public ASTEllipse(drawphase1 p, int id) {
    super(p, id);
  }


/****************************************************
 The values inputted needed to match the correct
 syntax of the svg language for an ellipse. It 
 calculates each of these values and prints them out 
 along with the correct svg code.
****************************************************/

  public void generate()
  {
    int cx, cy, rx, ry;
    
    rx = ((((ASTInt) jjtGetChild(2)).val)- ((ASTInt) jjtGetChild(0)).val) /2;
    ry = ((((ASTInt) jjtGetChild(3)).val)- ((ASTInt) jjtGetChild(1)).val) /2;
    cx = ((ASTInt) jjtGetChild(0)).val + rx;
    cy = ((ASTInt) jjtGetChild(1)).val + ry;
  
    System.out.println
	  ("<ellipse cx=\"" + cx +
        "\" cy=\"" + cy +
        "\" rx=\"" + rx + 
        "\" ry=\"" + ry + 
        "\" fill=\"none\" stroke=\"black\" stroke-width=\"1\"/>");
  }
}

