|
||||||||||
| PREV CLASS Documentation homepage NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public static interface IlvManagerView.FitAreaCalculator
This interface can be used to fit the transformer of the manager view
so that a certain area of the manager is visible in the view.
It is passed to the method
IlvManagerView.fitTransformerToArea(Insets, FitAreaCalculator, int).
The following example shows how to make all selected objects visible in the view by using this interface:
IlvManagerView.FitAreaCalculator fcalc =
new IlvManagerView.FitAreaCalculator() {
public IlvRect getAreaToFit(IlvManagerView view) {
IlvGraphicEnumeration e = view.getManager().getSelectedObjects(true);
IlvRect rect = null;
while (e.hasMoreElements()) {
IlvGraphic g = e.nextElement();
IlvManager m = (IlvManager)g.getGraphicBag();
IlvRect bbox = g.boundingBox(m.getDrawingTransformer(view));
if (rect == null)
rect = bbox;
else
rect.add(bbox);
}
if (rect == null)
// nothing selected, fallback: fit to all
return view.computeBBox();
else
return rect;
}
};
managerView.fitTransformerToArea(null, fcalc, 10);
| Method Summary | |
|---|---|
IlvRect |
getAreaToFit(IlvManagerView view)
Returns the rectangle in view coordinates that should be made visible in the view when calling IlvManagerView.fitTransformerToArea(Insets, FitAreaCalculator, int). |
| Method Detail |
|---|
IlvRect getAreaToFit(IlvManagerView view)
IlvManagerView.fitTransformerToArea(Insets, FitAreaCalculator, int).
|
||||||||||
| PREV CLASS Documentation homepage NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||