MATLAB Object-Oriented Programming

(Joyce) #1
Similarly, if you change the limits by assigning a value to the feobject.Lm property, the
feobject triggers a PostSet property event and the listener callbacks update the
graph.

feobject.Lm = [-8 3];

In this figure, the listeners are reenabled via the context menu for subplot 221. Because
the listener callback for the property PostSet event also updates the surface data, all
views are now synchronized

Implement UpdateGraph Event and Listener


The UpdateGraph event occurs when the MATLAB representation of the mathematical
function contained in the fcneval object is changed. The fcnview objects that contain
the surface graphs are listening for this event, so they can update the graphs to represent
the new function.

Define and Trigger UpdateGraph Event

The UpdateGraph event is a class-defined event. The fcneval class names the event
and calls notify when the event occurs.

11 Events — Sending and Responding to Messages

Free download pdf