public static interface IlvManagerView.FitAreaCalculator
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);
| Modifier and Type | Method and Description |
|---|---|
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). |
IlvRect getAreaToFit(IlvManagerView view)
IlvManagerView.fitTransformerToArea(Insets, FitAreaCalculator, int).© Copyright 2024 Rogue Wave Software, Inc., a Perforce company.. All Rights Reserved.