log.warning("You're using a centerLayout element but you've added more than one child element to it. centerLayout only supports one element! Odd things will happen when used with more than one element :)");
}
// we only support center of the very first element
Box rootBox = rootElement.getBox();
BoxConstraints rootBoxConstraints = rootElement.getBoxConstraints();
Box box = elements.get(0).getBox();
BoxConstraints constraint = elements.get(0).getBoxConstraints();
if (constraint.getWidth() != null && constraint.getWidth().hasHeightSuffix()) {
handleVerticalAlignment(rootBox, rootBoxConstraints, box, constraint);
handleHorizontalAlignment(rootBox, rootBoxConstraints, box, constraint);
} else if (constraint.getHeight() != null && constraint.getHeight().hasWidthSuffix()) {
handleHorizontalAlignment(rootBox, rootBoxConstraints, box, constraint);
handleVerticalAlignment(rootBox, rootBoxConstraints, box, constraint);
} else {
handleVerticalAlignment(rootBox, rootBoxConstraints, box, constraint);
handleHorizontalAlignment(rootBox, rootBoxConstraints, box, constraint);