| Advanced Features > Nested Managers and Nested Graphers > Content-Changed Events in Nested Managers |
Content-Changed Events in Nested Managers |
INDEX
PREVIOUS
NEXT
|
When the content of the manager changes, for example, when an object is added or removed or when the bounding box of an object changes, the manager will fire a ManagerContentChangedEvent event. Any class can listen for the modification of the content of the manager by implementing the ManagerContentChangedListener interface. This mechanism is described in Listener for the Content of the Manager.
Registering such a listener in a manager using the method addManagerContentChangedListener of the manager allows the listener to receive Content Changed events only for modifications that are taking place in the manager where the listener is registered. A listener registered using this method will not be notified, for example, when a new graphic object is added in a submanager.
In order to receive all Content Changed events of a hierarchy of nested managers, the IlvManager class allows you to register a global listener, with the methods:
void addManagerTreeContentChangedListener (ManagerContentChangedListener listener) void removeManagerTreeContentChangedListener (ManagerContentChangedListener listener)
Such a listener registered at the top-level manager of a hierarchy will receive all the Content Changed events of the hierarchy. To distinguish which submanager has sent the event, you can then use the method getManager on the event; the event is an instance of the class ManagerContentChangedEvent and contains the method:
IlvManager getManager()
| Copyright © 1987-2007 ILOG S.A. All rights reserved. Documentation homepage. Legal terms. | PREVIOUS NEXT |