import java.awt.*;

class CanvasPlusDemo
{
	static public void main(String[] args)
	{
		CanvasPlus c = new CanvasPlus("CanvasPlus Demo");

		// lets put in some quadrant subdivision
		someCrosses(c);

		// then some lines
		someLines(c);

		// now some points for those lines
		somePoints(c);

		// throw in some circles for good measure
		someCircles(c);

		// and finally some rectangles
		someRectangles(c);

		try
		{
			System.out.println("Drawing...");
			c.draw();
		} catch (Exception e) {
			System.out.println(e.getMessage());
		}

		// won't exit without this
//		System.exit(0);
	}

	static private void someCrosses(CanvasPlus c)
	{
		c.setColor(Color.gray);
		c.addCross(512,512,512);
		c.addCross(256,256,256);
		c.addCross(256,768,256);
		c.addCross(128,896,128);
	}

	static private void somePoints(CanvasPlus c)
	{
		c.addPoint("Bob",90,1000);
		c.addPoint("Jim",150,800);
		c.addPoint("Frank",300,300);
		c.addPoint("Shane",100,475);
		c.addPoint("Garry",600,600);
		c.addPoint("Chris",900,100);
	}

	static private void someLines(CanvasPlus c)
	{
		c.setColor(Color.blue);
		c.addLine(90,1000,150,800);
		c.addLine(150,800,900,100);
		c.addLine(900,100,600,600);
		c.addLine(150,800,100,475);
		c.addLine(150,800,300,300);
	}

	static private void someCircles(CanvasPlus c)
	{
		c.setColor(Color.red);
		c.addCircle(90,1000,50);
		c.addCircle(600,600,200);
	}

	static private void someRectangles(CanvasPlus c)
	{
		c.setColor(Color.black);
		c.addRectangle(190,400,150,125);
		c.addRectangle(600,200,350,150);
	}
}
