Example Graphics Object Interaction

[IMAGE: Message Flow Diagram 1]

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.

  1. 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.
  2. Model Sends the event to the top level window (Window 1).
  3. 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.)
  4. 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.
  5. The window has no authority to handle the desired action (database update) so it passes the ActionEvent back to the Model.
  6. The model, seeing that the window handled the event, stops going through the window list and handles the requested database update.
  7. The database tells the model that all views (windows) need to be updated for some particular object.
  8. 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.
  9. Window 2 updates its display if necessary and then returns an empty message as it does not need to initiate further action.