// Aaron Eller
// CSCI 15a 
// Lab wed 1-2
// 2/16/00
//Project 4


import java.awt.*;
import java.applet.Applet;

	public class Target2 extends Applet
  {
	public void paint (Graphics page)
	{
		int circle = 140, xaxis= 105, yaxis= 85, points=100, size=50, column=1, row=1 ;	

		setBackground (Color.blue);
		//Draw a checker board		
		drawLine1 ( page, column, row, size);
		drawLine2 ( page, column, ++row, size);
		drawLine1 ( page, column, ++row, size);
		drawLine2 ( page, column, ++row, size);
		drawLine1 ( page, column, ++row, size);

		//Draws a target
		page.setColor (Color.black);
		page.drawString (" AARON L. ELLER" , 125, 45);//prints name
		drawCircle ( page, xaxis, yaxis, Color.blue, circle, points-75);
		drawCircle ( page, xaxis+15, yaxis+15, Color.yellow, circle-30,points-50);
		drawCircle ( page, xaxis+30, yaxis+30, Color.blue, circle-60, points-25);
		drawCircle ( page, xaxis+45, yaxis+45, Color.red, circle-90, points);

	}
	
	  private void drawLine1 (Graphics page, int column, int row, int size)		
		
	{
		//This will draw 5 boxes to make a line
		drawSquare ( page,  column, row,  size, Color.red);
		drawSquare ( page, ++column , row, size, Color.black);
		drawSquare ( page, ++column, row,  size, Color.red);
		drawSquare ( page, ++column , row, size, Color.black);
		drawSquare ( page, ++column, row, size, Color.red);		

	}

	 private void drawLine2 (Graphics page, int column, int row, int size)		
		
	{
		//This will draw another 5 boxes with the colors switched
		drawSquare ( page,   column, row,  size, Color.black);
		drawSquare ( page, ++column, row, size, Color.red);
		drawSquare ( page, ++column, row,  size, Color.black);
		drawSquare ( page, ++column, row, size, Color.red);
		drawSquare ( page, ++column, row, size, Color.black);		

	}

	  private void drawSquare (Graphics page, int column, int row, int size, Color Square_Color )
	{
		//This will draw a square box
		page.setColor (Square_Color);
		page.fillRect (column*size, row*size, size, size);
		page.setColor (Color.yellow);
		page.drawRect (column*size, row*size, size, size);
		
	}

	  private void drawCircle (Graphics page,int xaxis, int yaxis, Color Circle_Color, int circle, int points)
	{
		//Draws a circle and prints value
		page.setColor (Circle_Color);
		page.fillOval (xaxis, yaxis, circle, circle);
		page.setColor (Color.black);
		page.drawString ( ""+points, xaxis+((circle-10)/2), yaxis+15);
	}



  }//end of Target program
