public void mouseClicked(MouseEvent me)
	{
		if(isStarted)//don't allow changes while the animation is running
			return;
		//left click will create a state if it is not overlapping any other state.
		if(me.getButton() == MouseEvent.BUTTON1)
		{
			Point p = new Point(me.getX(),me.getY());
			boolean tooClose = false; //assume the click is not too close. then check.
			for(State s: machineStates)
				tooClose = (tooClose||s.isNear(p));
			if(!tooClose)
			{
				State s = new State("" + machineStates.size(), p);
				machineStates.add(s);
			}
		}
		//right-click inside a state will toggle that state as an accept state
		if(me.getButton() == MouseEvent.BUTTON3)
		{
			Point p = new Point(me.getX(),me.getY());
			for(State s: machineStates)
			{
				if(s.containsPoint(p))
				{
					s.setAccept();
					return;
				}
			}
		}
	}