int newWidth = available + CoolItem.MINIMUM_WIDTH;
int newWidth = available + child.internalGetMinimumWidth();
int layoutItems () {	int y = 0, maxWidth = 0, width = getSize().x;	for (int row = 0; row < items.length; row++) {		int count = items[row].length;		int available = width - count * CoolItem.MINIMUM_WIDTH;		if (available < 0) available = count * CoolItem.MINIMUM_WIDTH;		int x = 0;		/* determine the height of the row */		int rowHeight = 0;		for (int i = 0; i < items[row].length; i++) {			CoolItem item = items[row][i];			if (item.control != null) {				rowHeight = Math.max(rowHeight, item.control.getSize().y);			}		}		rowHeight += 2 * CoolItem.MARGIN_HEIGHT;		if (row > 0) y += ROW_SPACING;			/* lay the items out */		for (int i = 0; i < count; i++) {			CoolItem child = items[row][i];			int newWidth = available + CoolItem.MINIMUM_WIDTH;			if (i + 1 < count) {				newWidth = Math.min(newWidth, child.requestedWidth);				available -= (newWidth - CoolItem.MINIMUM_WIDTH);			}			Rectangle oldBounds = child.getBounds();			Rectangle newBounds = new Rectangle(x, y, newWidth, rowHeight);			if (!oldBounds.equals(newBounds)) {				child.setBounds(newBounds.x, newBounds.y, newBounds.width, newBounds.height);				Rectangle damage = new Rectangle(0, 0, 0, 0);				/* Cases are in descending order from most area to redraw to least. */				if (oldBounds.y != newBounds.y) {					damage = newBounds;					damage.add(oldBounds);					/* Redraw the row separator as well. */					damage.y -= ROW_SPACING;					damage.height += 2 * ROW_SPACING;				}				else if (oldBounds.height != newBounds.height) {					/* 					 * Draw from the bottom of the gripper to the bottom of the new area.					 * (Bottom of the gripper is -3 from the bottom of the item).					 */					damage.y = newBounds.y + Math.min(oldBounds.height, newBounds.height) - 3;					damage.height = newBounds.y + newBounds.height + ROW_SPACING;					damage.x = oldBounds.x - CoolItem.MARGIN_WIDTH;					damage.width = oldBounds.width + CoolItem.MARGIN_WIDTH;				}				else if (oldBounds.x != newBounds.x) {					/* Redraw only the difference between the separators. */					damage.x = Math.min(oldBounds.x, newBounds.x);					damage.width = Math.abs(oldBounds.x - newBounds.x) + CoolItem.MINIMUM_WIDTH;					damage.y = oldBounds.y;					damage.height = oldBounds.height;				}				redraw(damage.x, damage.y, damage.width, damage.height, false);			}			x += newWidth;		}		maxWidth = Math.max(maxWidth, x);		y += rowHeight;	}	return y;}