final UIDL childUIDL = (UIDL) it.next();
final Paintable child = client.getPaintable(childUIDL);
Widget widget = (Widget) child;
// Create container for component
ChildComponentContainer childComponentContainer = getComponentContainer(widget);
if (childComponentContainer == null) {
// This is a new component
childComponentContainer = createChildContainer(widget);
}
addOrMoveChild(childComponentContainer, pos++);
/*
* Components which are to be expanded in the same orientation as
* the layout are rendered later when it is clear how much space
* they can use
*/
if (!Util.isCached(childUIDL)) {
FloatSize relativeSize = Util.parseRelativeSize(childUIDL);
childComponentContainer.setRelativeSize(relativeSize);
}
if (childComponentContainer.isComponentRelativeSized(orientation)) {
relativeSizeComponents.add(childComponentContainer);
relativeSizeComponentUIDL.add(childUIDL);
} else {
if (isDynamicWidth()) {
childComponentContainer.renderChild(childUIDL, client, -1);
} else {
childComponentContainer.renderChild(childUIDL, client,
activeLayoutSize.getWidth());
}
if (sizeHasChangedDuringRendering && Util.isCached(childUIDL)) {
// notify cached relative sized component about size
// chance
client.handleComponentRelativeSize(childComponentContainer
.getWidget());
}
}
uidlWidgets.add(widget);
}
// w.mark("Rendering of "
// + (uidlWidgets.size() - relativeSizeComponents.size())
// + " absolute size components done");
/*
* Remove any children after pos. These are the ones that previously
* were in the layout but have now been removed
*/
removeChildrenAfter(pos);
// w.mark("Old children removed");
/* Fetch alignments and expand ratio from UIDL */
updateAlignmentsAndExpandRatios(uidl, uidlWidgets);
// w.mark("Alignments and expand ratios updated");
/* Fetch widget sizes from rendered components */
updateWidgetSizes();
// w.mark("Widget sizes updated");
recalculateLayout();
// w.mark("Layout size calculated (" + activeLayoutSize +
// ") offsetSize: "
// + getOffsetWidth() + "," + getOffsetHeight());
/* Render relative size components */
for (int i = 0; i < relativeSizeComponents.size(); i++) {
ChildComponentContainer childComponentContainer = relativeSizeComponents
.get(i);
UIDL childUIDL = relativeSizeComponentUIDL.get(i);
if (isDynamicWidth()) {
childComponentContainer.renderChild(childUIDL, client, -1);
} else {
childComponentContainer.renderChild(childUIDL, client,
activeLayoutSize.getWidth());
}
if (Util.isCached(childUIDL)) {
/*
* We must update the size of the relative sized component if
* the expand ratio or something else in the layout changes
* which affects the size of a relative sized component
*/
client.handleComponentRelativeSize(childComponentContainer
.getWidget());
}
// childComponentContainer.updateWidgetSize();
}
// w.mark("Rendering of " + (relativeSizeComponents.size())
// + " relative size components done");
/* Fetch widget sizes for relative size components */
for (ChildComponentContainer childComponentContainer : widgetToComponentContainer
.values()) {
/* Update widget size from DOM */
childComponentContainer.updateWidgetSize();
}
// w.mark("Widget sizes updated");
/*