public void mouseClicked(MouseEvent e) {
        
        int x = e.getX();
        int y = e.getY();
        
        // Find the Agent they've clicked on.
        
        for (int i = 0; i < agents.size(); i++) {
            
            Agent agent = (Agent)agents.elementAt(i);
            int agentX = 0;
            int agentY = 0;
            if (real == true) {
                agentX = agent.getX();
                agentY = agent.getY();
            } else {
                int radius = (getWidth() - 10)/2;
                agentX = agent.getGraphX() + radius + 5;
                agentY = agent.getGraphY() + radius + 5;
            }
            
            // Send its properties to the reporting script. 
            // This is kept separate incase we want a different interface 
            // or reporting format.
            
            if (((x > agentX - 3) && (x < agentX + 3)) && ((y > agentY - 3) && (y < agentY + 3))) {
                report(agent.getName(), agent.getValue(), agent.getAttributes());
            }
        }
    }