Traversing nested managers

Once a manager has been added in a manager, it is no different from any other graphic object. Nevertheless, the manager contains a set of methods that allow you to have quick access to the managers added in a manager and to the manager hierarchy in general.
You can obtain an enumeration of the managers present in a submanager using the method getManagers and a count of how many managers are present with the method getManagersCount.
The same methods can be applied to a particular layer: getManagers and getManagersCount.
Note that these methods will return the submanagers at the first level of the hierarchy only. Using these methods is much more efficient than traversing the list of all objects present in a manager.
You can also traverse up the hierarchy of managers, using the method getParent.
In the simple example (see Example: Adding a nested manager) the following line would return toplevel :
subManager.getParent()
For a manager at the top level, this method returns null .