class SwingCanvas implements RSCanvas {

	public void drawRect(int left, int top, int right, int bottom,
			RSPaint paint) {
		SwingPaint p = (SwingPaint) paint;
		g.setColor(p.color);
		g.setStroke(p.stroke);

		int width = (right - left);
		int height = (bottom - top);
		
		switch (((SwingPaint)paint).paintStyle) {
		case FILL:
			g.fillRect(left, top, width, height);
			break;
		case FILL_AND_STROKE:
			g.fillRect(left, top, width, height);
			g.drawRect(left, top, width, height);
			break;
		case STROKE:
			g.drawRect(left, top, width, height);
			break;			
		}			
	}

	public  SwingCanvas(Component canvas, Graphics g);

}