MUIElement prev = null;
for (MUIElement subNode : visibleChildren) {
// Add a 'sash' between this node and the 'prev'
if (prev != null) {
Bounds sashRect = sashContainer.horizontal ? new BoundingBox(
tilePos, bounds.getMinY(), sashWidth.get(), bounds.getHeight())
: new BoundingBox(bounds.getMinX(), tilePos, bounds.getWidth(),
sashWidth.get());
sashes.add(new SashRect(sashRect, sashContainer, prev, subNode));
tilePos += sashWidth.get();
}
// Calc the new size as a %'age of the total
double ratio = getWeight(subNode) / totalWeight;
double newSize = availableWidth * ratio;
Bounds subBounds = sashContainer.horizontal ? new BoundingBox(
tilePos, bounds.getMinY(), newSize, bounds.getHeight()) : new BoundingBox(
bounds.getMinX(), tilePos, bounds.getWidth(), newSize);
tilePos += newSize;