The API you use to manipulate graphic objects stored
in a nested manager is the same as the one you use when working on
a top-level manager. For example, you use the
moveObject or
reshapeObject method of the
IlvManager
class
to move or reshape an object in a nested manager. You also use the
applyToObject method of
IlvManager
when
modifying a property of a graphic object that changes the bounding
box of a graphic object. The only difference for a nested manager
is that when a graphic object is stored in a nested manager, changing
its size or moving it can change the size of the manager itself, proceeding
recursively up the hierarchy of the manager.
The IlvManager
class provides
some convenient methods for working with graphic objects in nested
managers; these methods have a traverse
parameter
that when set to true
means that the method
applies also to nested managers in this manager.
You can access all the objects in the hierarchy of managers
using the following methods with the traverse
parameter
set to true
:
To return the total number of objects
in the hierarchy use the method:
int getCardinal(boolean traverse)
To return an enumeration of all objects
use the method:
IlvGraphicEnumeration getObjects(boolean traverse)
You can locate an object under a certain
point using:
IlvGraphic getObject(IlvPoint p, IlvManagerView view, boolean traverse)
Finally, you traverse the hierarchy
of objects to apply a function:
void map(IlvApplyObject f, Object arg, boolean traverse)
This method applies the function f
to
all objects of the hierarchy when the traverse
parameter
is set to true
.
void mapIntersects(IlvApplyObject f, Object arg,IlvRect rect, IlvTransformer
t, boolean traverse)
This method applies the function to all graphic objects
that intersects the specified rectangle in the hierarchy of nested
managers.
void mapInside(IlvApplyObject f, Object arg, IlvRect rect, IlvTransformer t,
boolean traverse)
This method applies the function to all graphic objects
that are inside the specified rectangle in the hierarchy of the nested
manager.
Some methods allow you to deal with selection and deselection
of objects in a hierarchy of nested managers. This is explained in
Selection in nested managers.