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

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

  public ASTRectangle(drawsimple p, int id) {
    super(p, id);
  }
  
  public void generate()
  {
     // assign the values of the childeren to integer
     // variables c1 to c4 this simplifiys the typing
     // required in the expressions below 
  
     int c1 = ((ASTInt) jjtGetChild(0)).val;
     int c2 = ((ASTInt) jjtGetChild(1)).val;
     int c3 = ((ASTInt) jjtGetChild(2)).val;
     int c4 = ((ASTInt) jjtGetChild(3)).val;
     
     // print the SVG lines that make up the rectangle
     System.out.println("<line x1=\"" + c1 +
        "\" y1=\"" + c2 +
        "\" x2=\"" + (c1 + (c3 - c1)) +
        "\" y2=\"" + c2 +
        "\" stroke=\"black\" stroke-width=\"1\"/>");
     System.out.println("<line x1=\"" + (c1 + (c3 - c1) +
        "\" y1=\"" + c2 +
        "\" x2=\"" + (c1 + (c3 - c1)) +
        "\" y2=\"" + (c2 + (c4 - c2)) +
        "\" stroke=\"black\" stroke-width=\"1\"/>");
     System.out.println("<line x1=\"" + (c1 + (c3 - c1) +
        "\" y1=\"" + (c2 + (c4 - c2)) +
        "\" x2=\"" + (c1) +
        "\" y2=\"" + c +
        "\" stroke=\"black\" stroke-width=\"1\"/>");
     System.out.println("<line x1=\"" + (c1) +
        "\" y1=\"" + (c2 + (c4 - c2)) +
        "\" x2=\"" + c1 +
        "\" y2=\"" + c2 +
        "\" stroke=\"black\" stroke-width=\"1\"/>");
  }
}
