// Box: rectangle shape representation 	
	
import java.awt.*;	
	
public class Box extends GeometricObject {	
	// instance variables 	
	int length;	
	int height;	
	
	// Box(): default constructor 	
	public Box() {	
		this(0, 0, new Point(), Color.BLACK);	
	}	
	
	// Box(): specific constructor 	
	public Box(int l, int h, Point p, Color c) {	
		setLength(l);	
		setHeight(h);	
		setPosition(p);	
		setColor(c);	
	}	
	
	// getLength(): get the rectangle length 	
	public int getLength() {	
		return length;	
	}	
	
	// getHeight(): get the rectangle height 	
	public int getHeight() {	
		return height;	
	}	
	
	// setLength(): set the rectangle length to l 	
	public void setLength(int l) {	
		length = l;	
	}	
	
	// setHeight(): get the rectangle height to h 	
	public void setHeight(int h) {	
		height = h;	
	}	
	
	// paint(): render the rectangle to graphics context g 	
	public void paint(Graphics g) {	
		Point p = getPosition();	
		Color c = getColor();	
		int   l = getLength();	
		int   h = getHeight();	
	
		g.setColor(c);	
		g.fillRect((int) p.getX(), (int) p.getY(), l, h);	
	}	
}	
	
