/*
 * @(#)ShapeDrawCommands.java	1.0 11-Apr-07
 *
 * IIT Bombay, 
 * Licensed under a Creative Commons Attribution-Noncommercial-Share Alike 2.5 License.
 */
package classes.shapes.commands;

import types.Command;
import interfaces.IShapeCommand;
import interfaces.IShapeDrawer;

/**
 * Encapsulates the shape drawing commands and uses <tt>IShapeDrawer</tt>
 * to draw the shapes.<br>
 * Also act as the real object to draw the shapes.
 *
 * @author  Prathab, Mukesh
 * @version 1.0, 22-Mar-07
 * @see interfaces.IShapeCommand
 * @see interfaces.IShapeDrawer
 * @see types.Command
 */
public class ShapeDrawCommands implements IShapeCommand {
	private IShapeDrawer shapeDrawer = null;
	
	
	public ShapeDrawCommands(IShapeDrawer shapeDrawer) {
		this.shapeDrawer = shapeDrawer;
	}

	/**
	 * Executes the <tt>Command</tt> object
	 * @param command <tt>Command</tt> object that to be executed
	 * @see interfaces.IShapeCommand#execute(types.Command)
	 */
	public void execute(Command command) {
		shapeDrawer.setCommandObject(command);
		shapeDrawer.drawShape();

	}

}
