Simple finite state machine used to implement a drawing tool.