&& layoutData.preferredSize <= 1.0) {
northHeight = (int) (height * layoutData.preferredSize);
}
height += northHeight;
if (layoutData.hasDecoratorPanel()) {
final DecoratorPanel decPanel = layoutData.decoratorPanel;
height += (decPanel.getOffsetHeight() - north.getOffsetHeight());
}
}
height += spacing;
}
if (south != null) {
BorderLayoutData layoutData = (BorderLayoutData) getLayoutData(south);
if (layoutData.collapse) {
height += WidgetHelper.getPreferredSize(southCollapsedImageButton).height;
} else {
int southHeight = (int) layoutData.preferredSize;
if (layoutData.preferredSize == -1.0) {
southHeight = WidgetHelper.getPreferredSize(south).height;
} else if (layoutData.preferredSize > 0.0
&& layoutData.preferredSize <= 1.0) {
southHeight = (int) (height * layoutData.preferredSize);
}
height += southHeight;
if (layoutData.hasDecoratorPanel()) {
final DecoratorPanel decPanel = layoutData.decoratorPanel;
height += (decPanel.getOffsetHeight() - south.getOffsetHeight());
}
}
height += spacing;
}
Dimension westSize = null;
if (west != null) {
BorderLayoutData layoutData = (BorderLayoutData) getLayoutData(west);
if (layoutData.collapse) {
width += WidgetHelper.getPreferredSize(westCollapsedImageButton).width;
} else {
int westWidth = (int) layoutData.preferredSize;
if (layoutData.preferredSize == -1.0) {
westWidth = WidgetHelper.getPreferredSize(west).width;
} else if (layoutData.preferredSize > 0.0
&& layoutData.preferredSize <= 1.0) {
westWidth = (int) (width * layoutData.preferredSize);
}
width += (int) Math.round(westWidth);
if (layoutData.hasDecoratorPanel()) {
final DecoratorPanel decPanel = layoutData.decoratorPanel;
width += (decPanel.getOffsetWidth() - west.getOffsetWidth());
}
}
width += spacing;
}
Dimension eastSize = null;
if (east != null) {
BorderLayoutData layoutData = (BorderLayoutData) getLayoutData(east);
if (layoutData.collapse) {
width += WidgetHelper.getPreferredSize(eastCollapsedImageButton).width;
} else {
int eastWidth = (int) layoutData.preferredSize;
if (layoutData.preferredSize == -1.0) {
eastWidth = WidgetHelper.getPreferredSize(east).width;
} else if (layoutData.preferredSize > 0.0
&& layoutData.preferredSize <= 1.0) {
eastWidth = (int) (width * layoutData.preferredSize);
}
width += (int) Math.round(eastWidth);
if (layoutData.hasDecoratorPanel()) {
final DecoratorPanel decPanel = layoutData.decoratorPanel;
width += (decPanel.getOffsetWidth() - east.getOffsetWidth());
}
}
width += spacing;
}
Dimension centerSize = WidgetHelper.getPreferredSize(center);
width += centerSize.width;
if (west != null && westSize == null) {
westSize = WidgetHelper.getPreferredSize(west);
}
if (east != null && eastSize == null) {
eastSize = WidgetHelper.getPreferredSize(east);
}
if (west != null && east != null) {
height += Math.max(Math.max(westSize.height, eastSize.height),
centerSize.height);
} else if (west != null) {
height += Math.max(westSize.height, centerSize.height);
} else if (east != null) {
height += Math.max(eastSize.height, centerSize.height);
} else {
height += centerSize.height;
}
BorderLayoutData layoutData = (BorderLayoutData) getLayoutData(center);
if (layoutData != null && layoutData.hasDecoratorPanel()) {
final DecoratorPanel decPanel = layoutData.decoratorPanel;
width += (decPanel.getOffsetWidth() - center.getOffsetWidth());
height += (decPanel.getOffsetHeight() - center.getOffsetHeight());
}
result.width = width;
result.height = height;