Class SimMouseListener
java.lang.Object
SimMouseListener
- All Implemented Interfaces:
- EventListener, MouseListener
- class SimMouseListener
- extends Object
- implements MouseListener
Handle mouse clicks for the BallSimControl window.
- Version:
- 4/18/03, 4/19/94
- Author:
- Hal Perkins
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SimMouseListener
public SimMouseListener(SimModel world)
- Constructor for objects of class SimMouseListener
- Parameters:
world
- the model object containing the state of the system
mouseClicked
public void mouseClicked(MouseEvent e)
- Process mouse click by adding a new ball to the simulation at the location
of the click with a random color, size, and velocity
- Specified by:
mouseClicked
in interface MouseListener
- Parameters:
e
- the mouse click event
mouseEntered
public void mouseEntered(MouseEvent e)
- Specified by:
mouseEntered
in interface MouseListener
mouseExited
public void mouseExited(MouseEvent e)
- Specified by:
mouseExited
in interface MouseListener
mousePressed
public void mousePressed(MouseEvent e)
- Specified by:
mousePressed
in interface MouseListener
mouseReleased
public void mouseReleased(MouseEvent e)
- Specified by:
mouseReleased
in interface MouseListener