
import java.awt.*;

//wheat
public class JoeyGraphics extends Object {
	
	Graphics g;
	
	public JoeyGraphics(Graphics g) { 
		this.g = g;
	}
	
	public void setColor(Color c) { 
		g.setColor(c);
	}


	public void drawIdLine(int id, int x1, int y1, int x2, int y2) {
		
		
		switch (id)	{
		case 0:
			drawWheat0Line(x1, y1, x2, y2);
			break;
		case 1:
			drawWheat1Line(x1, y1, x2, y2);
			break;
		case 2:
			drawWheat2Line(x1, y1, x2, y2);
			break;
		case 3:
			drawWheat3Line(x1, y1, x2, y2);
			break;
		case 4:
			drawWheat4Line(x1, y1, x2, y2);
			break;
		case 5:
			drawWheat5Line(x1, y1, x2, y2);
			break;
		case 6:
			drawWheat6Line(x1, y1, x2, y2);
			break;
		case 7:
			drawWheat7Line(x1, y1, x2, y2);
			break;
		case 8:
			drawWheat8Line(x1, y1, x2, y2);
			break;
		case 9:
			drawWheat9Line(x1, y1, x2, y2);
			break;
			
		default:
			g.drawLine(x1, y1, x2, y2);
		}	
		
	}

	public void drawWheat0Line(int x1, int y1, int x2, int y2) {

		double feet = 1;
		for (int t=0; t<15; t=t+1) {
			int s = t+1;
			float tempx1 = (float)(x1*(14-t)+ x2*t) /(float)14;
			float tempy1 = (float)(y1*(14-t)+ y2*t) /(float)14;
			float tempx2 = (float)(x1*(14-s)+ x2*s) /(float)14;
			float tempy2 = (float)(y1*(14-s)+ y2*s) /(float)14;
			g.drawLine((int)(tempx1-feet), (int)(tempy1+feet), 
					   (int)(tempx2 - (feet * 1.5)), (int)(tempy2 + (feet * 1.5)));
			feet = feet * 1.5;
		}
		
		

	}
	public void drawWheat1Line(int x1, int y1, int x2, int y2) {

		double feet = 9;

		for (int t=0; t<15; t=t+1) {
			int s = t+1;
			float tempx1 = (float)(x1*(14-t)+ x2*t) /(float)14;
			float tempy1 = (float)(y1*(14-t)+ y2*t) /(float)14;
			float tempx2 = (float)(x1*(14-s)+ x2*s) /(float)14;
			float tempy2 = (float)(y1*(14-s)+ y2*s) /(float)14;

			g.drawLine((int)(tempx1+feet), (int)(tempy1+feet), 
					   (int)(tempx2 + (feet * 1.5)), (int)(tempy2 + (feet * 1.5))); //signs
			feet = feet * 1.5;
		}

	}
	

	
	public void drawWheat2Line(int x1, int y1, int x2, int y2) {

		double feet = 1.26;

		for (int t=0; t<6; t=t+1) { 
			int s = t+1;
			float tempx1 = (float)(x1*(5-t)+ x2*t) /(float)5; 
			float tempy1 = (float)(y1*(5-t)+ y2*t) /(float)5;
			float tempx2 = (float)(x1*(5-s)+ x2*s) /(float)5;
			float tempy2 = (float)(y1*(5-s)+ y2*s) /(float)5;

			g.drawLine((int)(tempx1-feet), (int)(tempy1+feet), 
					   (int)(tempx2 - feet * feet), (int)(tempy2 + feet * feet)); 
			feet = feet * feet;
		}

	}
	
		
	public void drawWheat3Line(int x1, int y1, int x2, int y2) {
		double feet = 1;
		for (int t=0; t<5; t=t+1) { // 5 not 15
			int s = t+1;
			float tempx1 = (float)(x1*(4-t)+ x2*t) /(float)4; // 4 not 14
			float tempy1 = (float)(y1*(4-t)+ y2*t) /(float)4;
			float tempx2 = (float)(x1*(4-s)+ x2*s) /(float)4;
			float tempy2 = (float)(y1*(4-s)+ y2*s) /(float)4;
			g.drawLine((int)(tempx1+feet), (int)(tempy1+feet), 
					   (int)(tempx2 + (feet * 2.5)), (int)(tempy2 + (feet * 2.5))); // 2.5 not 1.5 and signs
			feet = feet * 2.5; // 2.5 not 1.5
		}


	}

		
	public void drawWheat4Line(int x1, int y1, int x2, int y2) {

		double feet = 20;

		for (int t=0; t<15; t=t+1) {
			int s = t+1;
			float tempx1 = (float)(x1*(14-t)+ x2*t) /(float)14;
			float tempy1 = (float)(y1*(14-t)+ y2*t) /(float)14;
			float tempx2 = (float)(x1*(14-s)+ x2*s) /(float)14;
			float tempy2 = (float)(y1*(14-s)+ y2*s) /(float)14;

			g.drawLine((int)(tempx1-feet), (int)(tempy1+feet), 
					   (int)(tempx2 - (feet * 1.1)), (int)(tempy2 + (feet * 1.1))); // 1.1 not 1.5
			feet = feet * 1.1; // 1.1 not 1.5
		}

	}
		
	public void drawWheat5Line(int x1, int y1, int x2, int y2) {

		double feet = 1;

		for (int t=0; t<9; t=t+1) { // t is 9 not 15
			int s = t+1;
			float tempx1 = (float)(x1*(8-t)+ x2*t) /(float)8; // here 8 not 14
			float tempy1 = (float)(y1*(8-t)+ y2*t) /(float)8;
			float tempx2 = (float)(x1*(8-s)+ x2*s) /(float)8;
			float tempy2 = (float)(y1*(8-s)+ y2*s) /(float)8;

			g.drawLine((int)(tempx1-feet), (int)(tempy1+feet), 
					   (int)(tempx2 - (feet * 1.5)), (int)(tempy2 + (feet * 1.5)));
			feet = feet * 1.5;
		}

	}
	
	public void drawWheat6Line(int x1, int y1, int x2, int y2) {

		double feet = 1;

		for (int t=0; t<5; t=t+1) {
			int s = t+1;
			float tempx1 = (float)(x1*(4-t)+ x2*t*t*t) /(float)4; //cube
			float tempy1 = (float)(y1*(4-t)+ y2*t*t*t) /(float)4;
			float tempx2 = (float)(x1*(4-s)+ x2*s*s*s) /(float)4;
			float tempy2 = (float)(y1*(4-s)+ y2*s*s*s) /(float)4;

			g.drawLine((int)(tempx1-feet), (int)(tempy1+feet), 
					   (int)(tempx2 - (feet * 1.3)), (int)(tempy2 + (feet * 1.3)));
			feet = feet * 1.3;
		}
		
	}
	
	public void drawWheat7Line(int x1, int y1, int x2, int y2) {

		double feet = 25; // feet is 3 not 1
		for (int t=0; t<5; t=t+1) {
			int s = t+1;
			float tempx1 = (float)(x1*(4-t)+ x2*t*2) /(float)4;
			float tempy1 = (float)(y1*(4-t)+ y2*t*2) /(float)4;
			float tempx2 = (float)(x1*(4-s)+ x2*s*3) /(float)4;
			float tempy2 = (float)(y1*(4-s)+ y2*s*3) /(float)4;
			g.drawLine((int)(tempx1-feet), (int)(tempy1+feet), 
					   (int)(tempx2 - (feet * 1.4)), (int)(tempy2 + (feet * 1.4)));
			feet = feet * 1.4;
		}

	}

	public void drawWheat8Line(int x1, int y1, int x2, int y2) {

		double feet = 1;

		for (int t=0; t<15; t=t+1) {
			int s = t+1;
			float tempx1 = (float)(x1*(14-t)- x2*t) /(float)14;
			float tempy1 = (float)(y1*(14-t)- y2*t) /(float)14;
			float tempx2 = (float)(x1*(14-s)- x2*s) /(float)14;
			float tempy2 = (float)(y1*(14-s)- y2*s) /(float)14;

			g.drawLine((int)(tempx1-feet), (int)(tempy1+feet), 
					   (int)(tempx2 - (feet * 1.9)), (int)(tempy2 + (feet * 1.9))); // 1.9 not 1.5
			feet = feet * 1.9; 
		}

	}
	
	public void drawWheat9Line(int x1, int y1, int x2, int y2) {	
		double one = 6;
		double two = 8;

		for (int t=0; t<4; t=t+1) {

			int s = t+4;
			float tempx1 = (float)(x1*(7-t)+ x2*t) /(float)7;
			float tempy1 = (float)(y1*(7-t)+ y2*t) /(float)7;
			float tempx2 = (float)(x1*(7-s)+ x2*s) /(float)7;
			float tempy2 = (float)(y1*(7-s)+ y2*s) /(float)7;
			g.drawLine((int)(tempx1-two), (int)(tempy1+one), (int)(tempx2 - (one * 2)), (int)(tempy2 + (two * 2)));
			one = one * 2;
			two = two * 2 ;
		}
	}
		
	
	public void drawWheat10Line(int x1, int y1, int x2, int y2) {


		double feet = 1;

		for (int t=0; t<15; t=t+1) {
			int s = t+9; // 3 not 1
			float tempx1 = (float)(x1*(14-t)+ x2*t) /(float)14;
			float tempy1 = (float)(y1*(14-t)+ y2*t) /(float)14;
			float tempx2 = (float)(x1*(14-s)+ x2*s) /(float)14;
			float tempy2 = (float)(y1*(14-s)+ y2*s) /(float)14;

			g.drawLine((int)(tempx1-feet), (int)(tempy1+feet), 
					   (int)(tempx2 - (feet * 1.5)), (int)(tempy2 + (feet * 1.5)));
			feet = feet * 1.5;
		}
	}


}
