void (final @NotNull Element itemElement, final @NotNull GridConstraints c) { LOG.assertTrue(ELEMENT_ITEM.equals(itemElement.getName())); final Element element = new Element(ELEMENT_DEFAULT_CONSTRAINTS); itemElement.addContent(element); // grid related attributes { element.setAttribute(ATTRIBUTE_VSIZE_POLICY, Integer.toString(c.getVSizePolicy())); element.setAttribute(ATTRIBUTE_HSIZE_POLICY, Integer.toString(c.getHSizePolicy())); element.setAttribute(ATTRIBUTE_ANCHOR, Integer.toString(c.getAnchor())); element.setAttribute(ATTRIBUTE_FILL, Integer.toString(c.getFill())); } // minimum size { if (c.myMinimumSize.width != -1 || c.myMinimumSize.height != -1) { final Element _element = new Element(ELEMENT_MINIMUM_SIZE); element.addContent(_element); _element.setAttribute(ATTRIBUTE_WIDTH, Integer.toString(c.myMinimumSize.width)); _element.setAttribute(ATTRIBUTE_HEIGHT, Integer.toString(c.myMinimumSize.height)); } } // preferred size { if (c.myPreferredSize.width != -1 || c.myPreferredSize.height != -1) { final Element _element = new Element(ELEMENT_PREFERRED_SIZE); element.addContent(_element); _element.setAttribute(ATTRIBUTE_WIDTH, Integer.toString(c.myPreferredSize.width)); _element.setAttribute(ATTRIBUTE_HEIGHT, Integer.toString(c.myPreferredSize.height)); } } // maximum size { if (c.myMaximumSize.width != -1 || c.myMaximumSize.height != -1) { final Element _element = new Element(ELEMENT_MAXIMUM_SIZE); element.addContent(_element); _element.setAttribute(ATTRIBUTE_WIDTH, Integer.toString(c.myMaximumSize.width)); _element.setAttribute(ATTRIBUTE_HEIGHT, Integer.toString(c.myMaximumSize.height)); } } }