@Override public void readDesign(Element design, DesignContext designContext) { // process default attributes super.readDesign(design, designContext); setMargin(readMargin(design, getMargin(), designContext)); // handle children for (Element childComponent : design.children()) { Attributes attr = childComponent.attributes(); Component newChild = designContext.readDesign(childComponent); addComponent(newChild); // handle alignment setComponentAlignment(newChild, DesignAttributeHandler.readAlignment(attr)); // handle expand ratio if (attr.hasKey(":expand")) { String value = attr.get(":expand"); if (!value.isEmpty()) { try { float ratio = Float.valueOf(value); setExpandRatio(newChild, ratio); } catch (NumberFormatException nfe) { getLogger() .info("Failed to parse expand ratio " + value); } } else { setExpandRatio(newChild, 1.0f); } } } }