本文整理匯總了Java中org.eclipse.draw2d.IFigure.getClientArea方法的典型用法代碼示例。如果您正苦於以下問題:Java IFigure.getClientArea方法的具體用法?Java IFigure.getClientArea怎麽用?Java IFigure.getClientArea使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.eclipse.draw2d.IFigure
的用法示例。
在下文中一共展示了IFigure.getClientArea方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: layout
import org.eclipse.draw2d.IFigure; //導入方法依賴的package包/類
@Override
public void layout(IFigure parent) {
data = new WorkingData();
Rectangle relativeArea = parent.getClientArea();
data.area = transposer.t(relativeArea);
Iterator<?> iterator = parent.getChildren().iterator();
int dx;
// Calculate the hints to be passed to children
int wHint = -1;
int hHint = -1;
if (isHorizontal()) {
wHint = parent.getClientArea().width;
} else {
hHint = parent.getClientArea().height;
}
initVariables(parent);
initRow();
while (iterator.hasNext()) {
IFigure f = (IFigure)iterator.next();
Dimension pref = transposer.t(getChildSize(f, wHint, hHint));
Rectangle r = new Rectangle(0, 0, pref.width, pref.height);
r.x = data.rowX;
r.y = data.rowY;
dx = r.width + getMinorSpacing();
data.rowX += dx;
data.rowWidth += dx;
data.rowHeight = Math.max(data.rowHeight, r.height);
data.row[data.rowCount] = f;
data.bounds[data.rowCount] = r;
data.rowCount++;
}
data.rowWidth += margin;
data.rowHeight += margin;
if (data.rowCount != 0) {
layoutRow(parent);
}
data = null;
}