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

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

  public ASTSquare(drawphase2 p, int id) {
    super(p, id);
  }
  
  public String getType()
  {
    return "Square";
  }  

  /*-----------------------------------------------*/
  /* Returns drawn square as 4 lines               */
  /*-----------------------------------------------*/
  public String getString()
  {
    int xbottom = ((ASTInt) jjtGetChild(1)).val + (((ASTInt) jjtGetChild(2)).val - ((ASTInt) jjtGetChild(0)).val);
    int offsetX = getOffsetX();
    int offsetY = getOffsetY();
    String colour = getColour();
    int brush = getBrush();

    String square = "{\n" + 
    formatLine(((ASTInt) jjtGetChild(0)).val,xbottom,((ASTInt) jjtGetChild(0)).val,((ASTInt) jjtGetChild(1)).val,colour,brush,offsetX,offsetY)+"\n"+
    formatLine(((ASTInt) jjtGetChild(0)).val,((ASTInt) jjtGetChild(1)).val,((ASTInt) jjtGetChild(2)).val,((ASTInt) jjtGetChild(1)).val,colour,brush,offsetX,offsetY)+"\n"+
    formatLine(((ASTInt) jjtGetChild(2)).val,((ASTInt) jjtGetChild(1)).val,((ASTInt) jjtGetChild(2)).val,xbottom,colour,brush,offsetX,offsetY)+"\n"+
    formatLine(((ASTInt) jjtGetChild(2)).val,xbottom,((ASTInt) jjtGetChild(0)).val,xbottom,colour,brush,offsetX,offsetY)+
    "\n}";

    return square; 
  }
}
