Defining and drawing a default frame and its margins

When a manager is nested, a frame can be drawn around the objects it contains.
A default frame is provided when you create a nested manager; the default frame is defined by the class IlvDefaultManagerFrame.
defaultmanagerframe.gif
Default manager frame

Defining the frame

The frame around a nested manager is defined by the interface IlvManagerFrame. The IlvManagerFrame interface defines the margin that will be added around the manager. It defines how the frame is drawn and how hit testing on the frame is performed.
To specify the frame that must be drawn around the manager, you use the following methods of the IlvManager class:
void setFrame(IlvManagerFrame frame)  
IlvManagerFrame getFrame()  
Note that you can remove the frame from the manager using the setFrame method with a null parameter.

Defining the margins

The following methods of the IlvManagerFrame interface define the margins that are added around the manager:
float getBottomMargin(IlvManager manager, IlvTransformer t)  
float getLeftMargin(IlvManager manager, IlvTransformer t)  
float getRightMargin(IlvManager manager, IlvTransformer t)  
float getTopMargin(IlvManager manager, IlvTransformer t)  
framemargins.gif
Manager frame margins

Drawing the default frame

The IlvManagerFrame interface provides a method to draw the frame:
void draw(IlvManager manager, IlvRect bbox, Graphics g, IlvTransformer t)  
This method provides the manager with its bounding box in the view coordinate system that already takes the margins into account. The IlvDefaultManagerFrame fills the background and makes a border around the manager. This class also puts a title at the top of the manager that corresponds to the name of the manager, as you can see in Manager frame margins.
If the frame implementation fills the background of the manager, the frame is an opaque frame and the following method must return true :
boolean isOpaque(IlvManager manager)  
The IlvDefaultManagerFrame object can be opaque or transparent.
  • If the frame is opaque, graphic objects under the nested manager are hidden. This disallows manipulation of these graphic objects.
  • If the frame is transparent, graphic objects under the nested manager are visible. This allows manipulation of the graphic objects, whether covered by the frame or not.