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

public class ASTBrush extends SimpleNode 
{
	int brush;
	
	/*************************************************

					Constructors

	*************************************************/
	
	public ASTBrush(int id) 
	{
    	super(id);
  	}

  	public ASTBrush(drawphase3 p, int id) 
  	{
    	super(p, id);
  	}
  	
  	/*************************************************

	Method to loop through all the children of the brush
	node and print their SVG code to the console

	*************************************************/
  	
  	public void generate()
  	{
  		int i, k = jjtGetNumChildren();
  		
  		brush = ((ASTInt) jjtGetChild(0)).val;
  		
  		if(brush==0)
  		{
  		   	for (i = 0; i < k; i++)
  		   	{
        		System.out.println(jjtGetChild(i).generateSVG());
        	
        	}
        }
        else
        {
        	for (i = 1; i < k; i++)
        	{
        		jjtGetChild(i).generate();
        	}
        }
  	}
  	
  	/*************************************************

	Loops through all the children as above but returns
	string to produce the SVG file

	*************************************************/
  	
  	public String generateSVG()
  	{
  		int i, k = jjtGetNumChildren();
  		String temp ="";
  		
  		brush = ((ASTInt) jjtGetChild(0)).val;
  		
  		if(brush==0)
  		{
  			for (i = 0; i < k; i++)
     		{
        		temp = temp + jjtGetChild(i).generateSVG();
        	}
        }
        
        else
        {
        	for (i = 1; i < k; i++)
     		{
        		temp = temp + jjtGetChild(i).generateSVG();
        	}
        }
  		
  		return temp;
  	}
  	
  	/*************************************************

	Methods required by Node interface

	*************************************************/
   
   	public String getColour()
   	{
  		return null;
  	}
  	
  	/*************************************************

	Returns the value of the brush

	*************************************************/
  	
  	public int getBrush()
  	{
  		brush = ((ASTInt) jjtGetChild(0)).val;
  		
  		System.out.println(brush);
  		
  		return brush;
  	}
  	
  	/*************************************************

	Returns the node type for distingushing between brush,
	colour, offset, scale and repeat

	*************************************************/
  	
  	public String getParentType()
  	{
  		String type = "brush";
  		
  		return type;
  	}
  	
  	public int getOffsetX()
  	{
  		return 0;
  	}
  
  	public int getOffsetY()
	{
  		return 0;
  	}
  	
  	public int getScaleX()
  	{
  		return 0;
  	}
  
  	public int getScaleY()
  	{
  		return 0;
  	}
  	
  	public int getRepeatX()
  	{
  		return 0;
  	}
  	
  	public int getRepeatY()
  	{
  		return 0;
  	}
  	
  	public int getNoRepeat()
  	{
  		return 0;
  	}


}
