import java.awt.*;

public class VarInit extends Canvas
{
	Graphics graphic;
	int Ospeed,Wspeed,PulseTime,busy;
	String s;
	public void VarInit()
	{
		this.busy = 0;
		this.Wspeed = 0;
		this.Ospeed = 0;
		this.PulseTime = 0;
		this.repaint(0);
	}
	public void paint(Graphics g)
	{
		Graphics graphic = g.create();
		graphic.setColor(Color.black);
		//control.drawRect(1,1,499,98);
		graphic.drawLine(10,2,10,100);
		graphic.drawLine(5,Ospeed,15,Ospeed);
		s = Integer.toString(Ospeed);
		graphic.drawString("Object Speed:",16,25);
		graphic.drawString(s + " meters / Second",16,50);
		graphic.drawString("Press Here To Engage",30,50);
		this.show();
	
	}
	public boolean handleEvent(Event e)
	{
		//System.out.println(e);
		if((e.target == this) & ((e.id == 506) || (e.id == 501)))
		{
			if ((e.x <=15) & (e.x >=5))
			{
				if (e.y <= 0)
					this.Ospeed = 0;
				else
					this.Ospeed = e.y * 100;
				this.repaint();
			}
			else if ((e.x <= 45) & (e.x >= 16))
				this.busy = 1;
				
			return true;
		}

		else return false;
	}

}