TOC
The Controller module

The Controller module has a superclass Controller.java, which implements all the event handling interfaces in the Java API and provides the interactions between itself and the AppletLogic module. The applet programmer can have a subclass, say MyAppletController.java inherite this superclass and implement the event handling needed in the applet program. This module receives the event triggered or input given by the end user and process them. After that it contacts with the AppetLogic module to modify the core data and key events in it.

Soppose I have an concrete applet logic class called MyAppletLogic.java, which inherites the AppletLogic.java in the framework. In the Controller.java class, if we want to receive the mouse events and do something to update the core data and states in the MyAppletLogic.java. We can implement the corresponding event handler method in MyAppletLogic.java class as the following.
 
 

//an event handler method in the MyAppletController.java class

//mouse event handler

public void mouseClicked(MouseEvent evnt){

//process mouse event

//call the appropriate methods in the AppletLogic module to update the core data in there

MyAppletLogic.someUpdatingMethod(mouse_event_parameters);

}
 
 

This way, the Controller module will grab the mouse events and process it and then call the appropriate methods in MyAppletLogic.java to update the core data and key states in it.