import java.awt.event.*;
import Project1;

/*
	This class was created for two main reasons, the first was that I really
didn't understand the idea of being able to create a "on-the-fly" subclass
(created in the new() call.  The other reason was that I had originally intended
to create an EventServer() class that would send out Mouse and Time events to
registered listeners. 
*/

public class MouseEventServer extends MouseAdapter
{
	Project1 p;

	public MouseEventServer(Project1 proj)
	{
		p = proj;
	}

/*
	Again, this is a kludge, and should pass the event up to the interested
client (the Project1 class).  In fact, I could probably copy this file into the
server and make it much better looking as a subclass of Project1
*/

	public void mouseClicked(MouseEvent e)
	{
		Sprite inQuestion = p.query(e.getX(),e.getY());
		if (inQuestion != null) inQuestion.action();
	}

}
