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

/**************************************************************

File				: ASTSquare.java
Auther				: M. Spiller
Registration #		: Y0259667
Date				: Thursday 13th november 2003
Unit				: CMP-2A25 Programming - Software Development Techniques
Description			: Square class containing square generate method

**************************************************************/

import java.io.*;

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

	public ASTSquare(DrawPhase3 p, int id) 
	{
		super(p, id);
	}

	public void generate(FileWriter SVGFile, int Xsc, int Ysc, int X, 
						int Y, String colour, int brush)
    {
        int x1 = ((ASTInt)jjtGetChild(0)).val;//left
        int y1 = ((ASTInt)jjtGetChild(1)).val;//top
        int x2 = ((ASTInt)jjtGetChild(2)).val;//right
        int y2 = y1 + (x2 - x1);//bottom
		//calls draw method with values 
        DrawRectangle(SVGFile,Xsc , Ysc, X, Y, colour, brush, x1, y1, x2, y2);
    }
}
