Example Graphics Object Interaction
In this diagram, Window 1 is the main window for the program. Window
2 is some pop-up window (a clone pop-up window, for example). Not all
graphics objects are represented. Not intended for children under 3
years of age.
- Keyboard or Mouse Controller sends an event to the Model. In this example, we will say that there was a mouse action resizing a clone.
- Model Sends the event to the top level window (Window 1).
- Since the mouse event is within the window's coordinates, Win 1 sends the event to the object at the specified location (the clone). (If the coordinates were not within the window, Win 1 would return a "Try again" message to the Model.)
- After doing internal processing of the event, the clone graphics object returns an ActionEvent to the window, indicating that the clone needs to be updated in the database.
- The window has no authority to handle the desired action (database update) so it passes the ActionEvent back to the Model.
- The model, seeing that the window handled the event, stops going through the window list and handles the requested database update.
- The database tells the model that all views (windows) need to be updated for some particular object.
- The model updates all views (windows) except the one that requested the database update. In this case, the update came from Window 1, so Window 1 is up-to-date and the model only sends an update message to Window 2.
- Window 2 updates its display if necessary and then returns an empty message as it does not need to initiate further action.