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

public class ASTPolygon extends SimpleNode
{
	/*************************************************
	
					Constructors
	
	*************************************************/
	
	public ASTPolygon(int id) 
	{
    	super(id);
  	}

  	public ASTPolygon(drawphase1 p, int id) 
  	{
    	super(p, id);
  	}
  	
  	/*************************************************
	
	Method to loop around the number of co-ordinates of
	the polygon and create the indiviual lines. The line
	outside the loop is the final line that links the final
	co-ordinate with the first to complete the polygon
	
	*************************************************/  
    
  	public String generateSVG()
  	{
  		String temp = "";
  		int childSize = sizeOfChild();
  		
   		for(int i = 0; i < sizeOfChild()-2; i++)
   		{
   			temp = temp + ("<line");
   			temp = temp + (" x1=\"" + ((ASTInt) jjtGetChild(i)).val + "\"");
    		temp = temp + (" y1=\"" + ((ASTInt) jjtGetChild(i+1)).val + "\"");
   			temp = temp + (" x2=\"" + ((ASTInt) jjtGetChild(i+2)).val + "\"");
   			temp = temp + (" y2=\"" + ((ASTInt) jjtGetChild(i+3)).val + "\"");
   			temp = temp + (" stroke=\"black\" stroke-width=\"1\"/>\n");
   			i = i+1;
   		}

    	
    	temp = temp + ("<line");
    	temp = temp + (" x1=\"" + ((ASTInt) jjtGetChild(childSize-2)).val + "\"");
    	temp = temp + (" y1=\"" + ((ASTInt) jjtGetChild(childSize-1)).val + "\"");
    	temp = temp + (" x2=\"" + ((ASTInt) jjtGetChild(0)).val + "\"");
    	temp = temp + (" y2=\"" + ((ASTInt) jjtGetChild(1)).val + "\"");
    	temp = temp + (" stroke=\"black\" stroke-width=\"1\"/>");
    	
    	return temp;
    	
  	}
  	
  	/*************************************************
	
	Method implemented as part of Node interface 
	
	*************************************************/
  	
	public void generate()
  	{
    }
}
