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

public class ASTScaling extends SimpleNode 
{
	String Scaling;
	
	/*************************************************
	
					Constructors

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

  	public ASTScaling(drawphase3 p, int id) 
  	{
    	super(p, id);
  	}
  	
  	/*************************************************
	
	Loops round all the scale children and prints them
	to the console

	*************************************************/
  	
  	public void generate()
  	{
  		int scaleX = ((ASTInt) jjtGetChild(0)).val;
  		int scaleY = ((ASTInt) jjtGetChild(1)).val;
  		int combineScale = scaleX + scaleY;
  		
  		/*************************************************
	
		If the first child is not a scale element then begin
		the loop at the first child of the node

		*************************************************/
  		
  		if(combineScale==0)
  		{
  			for(int i = 0; i < jjtGetNumChildren(); i++)
  			{
  				System.out.println(jjtGetChild(i).generateSVG());
  			}
  		}
  		
		/*************************************************
	
		If the first child IS a scale element then begin the
		loop with the second child

		*************************************************/
  		
  		else
  		{
  			
  			for(int i = 2; i < jjtGetNumChildren(); i++)
  			{
  				
  				System.out.println(jjtGetChild(i).generateSVG());
  			}
  		}
  	}
  	
  	/*************************************************
	
	Method similar to above but returns a string instead
	of printing the code to the console

	*************************************************/
  	
  	public String generateSVG()
  	{
  		String temp = "";
  		
  		int scaleX = ((ASTInt) jjtGetChild(0)).val;
  		int scaleY = ((ASTInt) jjtGetChild(1)).val;
  		int combineScale = scaleX + scaleY;
  		
  		if(combineScale==0)
  		{
  			for(int i = 0; i < jjtGetNumChildren(); i++)
  			{
  				temp = temp + jjtGetChild(i).generateSVG();
  			}
  		}
  		
  		else
  		{
  			
  			for(int i = 2; i < jjtGetNumChildren(); i++)
  			{
  				
  				temp = temp + jjtGetChild(i).generateSVG();
  			}
  		}
  		
  		return temp;
  	}
  	
  	/*************************************************
	
	Methods required by Node interface

	*************************************************/
  	
  	/*************************************************
	
	Returns the type of node

	*************************************************/
  	
  	public String getParentType()
  	{
  		String type = "scale";
  		
  		return type;
  	}
  	
  	/*************************************************
	
	Returns scale value in the X direction

	*************************************************/
  	  	
  	public int getScaleX()
  	{
  		int scaleX = ((ASTInt) jjtGetChild(0)).val;
  		
  		return scaleX;
  	}
  	
  	/*************************************************
	
	Returns scale value in the Y direction

	*************************************************/
  	
  	public int getScaleY()
  	{
  		int scaleY = ((ASTInt) jjtGetChild(1)).val;
  		
  		return scaleY;
  	}
  	
  	public int getRepeatX()
  	{
  		return 0;
  	}
  	
  	public int getRepeatY()
  	{
  		return 0;
  	}
  	
  	public int getNoRepeat()
  	{
  		return 0;
  	}
  	
}
