{
attributeList.setAttribute(XmlDocumentWriter.LAYOUT_OUTPUT_NAMESPACE, "name", box.getName());
}
attributeList.setAttribute(XmlDocumentWriter.LAYOUT_OUTPUT_NAMESPACE, "type", box.getClass().getSimpleName());
final BoxDefinition definition = box.getBoxDefinition();
final Border border = definition.getBorder();
final StaticBoxLayoutProperties sblp = box.getStaticBoxLayoutProperties();
final BorderEdge top = border.getTop();
if (BorderEdge.EMPTY.equals(top) == false || ignoreEmptyBorders == false)
{
attributeList.setAttribute(XmlDocumentWriter.LAYOUT_OUTPUT_NAMESPACE, "border-top-color",
ColorValueConverter.colorToString(top.getColor()));
attributeList.setAttribute(XmlDocumentWriter.LAYOUT_OUTPUT_NAMESPACE, "border-top-width",
pointConverter.format(StrictGeomUtility.toExternalValue(sblp.getBorderTop())));
attributeList.setAttribute(XmlDocumentWriter.LAYOUT_OUTPUT_NAMESPACE, "border-top-style",
String.valueOf(top.getBorderStyle()));
}
final BorderEdge left = border.getLeft();
if (BorderEdge.EMPTY.equals(left) == false || ignoreEmptyBorders == false)
{
attributeList.setAttribute(XmlDocumentWriter.LAYOUT_OUTPUT_NAMESPACE, "border-left-color",
ColorValueConverter.colorToString(left.getColor()));
attributeList.setAttribute(XmlDocumentWriter.LAYOUT_OUTPUT_NAMESPACE, "border-left-width",
pointConverter.format(StrictGeomUtility.toExternalValue(sblp.getBorderLeft())));
attributeList.setAttribute(XmlDocumentWriter.LAYOUT_OUTPUT_NAMESPACE, "border-left-style",
String.valueOf(left.getBorderStyle()));
}
final BorderEdge bottom = border.getBottom();
if (BorderEdge.EMPTY.equals(bottom) == false || ignoreEmptyBorders == false)
{
attributeList.setAttribute(XmlDocumentWriter.LAYOUT_OUTPUT_NAMESPACE, "border-bottom-color",
ColorValueConverter.colorToString(bottom.getColor()));
attributeList.setAttribute(XmlDocumentWriter.LAYOUT_OUTPUT_NAMESPACE, "border-bottom-width",
pointConverter.format(StrictGeomUtility.toExternalValue(sblp.getBorderBottom())));
attributeList.setAttribute(XmlDocumentWriter.LAYOUT_OUTPUT_NAMESPACE, "border-bottom-style",
String.valueOf(bottom.getBorderStyle()));
}
final BorderEdge right = border.getRight();
if (BorderEdge.EMPTY.equals(right) == false || ignoreEmptyBorders == false)
{
attributeList.setAttribute(XmlDocumentWriter.LAYOUT_OUTPUT_NAMESPACE, "border-right-color",
ColorValueConverter.colorToString(right.getColor()));
attributeList.setAttribute(XmlDocumentWriter.LAYOUT_OUTPUT_NAMESPACE, "border-right-width",
pointConverter.format(StrictGeomUtility.toExternalValue(sblp.getBorderRight())));
attributeList.setAttribute(XmlDocumentWriter.LAYOUT_OUTPUT_NAMESPACE, "border-right-style",
String.valueOf(right.getBorderStyle()));
}
final BorderCorner topLeft = border.getTopLeft();
if (isEmptyCorner(topLeft) == false)
{
attributeList.setAttribute(XmlDocumentWriter.LAYOUT_OUTPUT_NAMESPACE, "border-top-left-x",
pointConverter.format(StrictGeomUtility.toExternalValue(topLeft.getWidth())));
attributeList.setAttribute(XmlDocumentWriter.LAYOUT_OUTPUT_NAMESPACE, "border-top-left-y",
pointConverter.format(StrictGeomUtility.toExternalValue(topLeft.getHeight())));
}
final BorderCorner topRight = border.getTopRight();
if (isEmptyCorner(topRight) == false)
{
attributeList.setAttribute(XmlDocumentWriter.LAYOUT_OUTPUT_NAMESPACE, "border-top-right-x",
pointConverter.format(StrictGeomUtility.toExternalValue(topRight.getWidth())));
attributeList.setAttribute(XmlDocumentWriter.LAYOUT_OUTPUT_NAMESPACE, "border-top-right-y",
pointConverter.format(StrictGeomUtility.toExternalValue(topRight.getHeight())));
}
final BorderCorner bottomLeft = border.getBottomLeft();
if (isEmptyCorner(bottomLeft) == false)
{
attributeList.setAttribute(XmlDocumentWriter.LAYOUT_OUTPUT_NAMESPACE, "border-bottom-left-x",
pointConverter.format(StrictGeomUtility.toExternalValue(bottomLeft.getWidth())));
attributeList.setAttribute(XmlDocumentWriter.LAYOUT_OUTPUT_NAMESPACE, "border-bottom-left-y",
pointConverter.format(StrictGeomUtility.toExternalValue(bottomLeft.getHeight())));
}
final BorderCorner bottomRight = border.getBottomRight();
if (isEmptyCorner(bottomRight) == false)
{
attributeList.setAttribute(XmlDocumentWriter.LAYOUT_OUTPUT_NAMESPACE, "border-bottom-right-x",
pointConverter.format(StrictGeomUtility.toExternalValue(bottomRight.getWidth())));
attributeList.setAttribute(XmlDocumentWriter.LAYOUT_OUTPUT_NAMESPACE, "border-bottom-right-y",
pointConverter.format(StrictGeomUtility.toExternalValue(bottomRight.getHeight())));
}
if (sblp.getMarginTop() > 0)
{
attributeList.setAttribute(XmlDocumentWriter.LAYOUT_OUTPUT_NAMESPACE, "margin-top",
pointConverter.format(StrictGeomUtility.toExternalValue(sblp.getMarginTop())));
}
if (sblp.getMarginLeft() > 0)
{
attributeList.setAttribute(XmlDocumentWriter.LAYOUT_OUTPUT_NAMESPACE, "margin-left",
pointConverter.format(StrictGeomUtility.toExternalValue(sblp.getMarginLeft())));
}
if (sblp.getMarginBottom() > 0)
{
attributeList.setAttribute(XmlDocumentWriter.LAYOUT_OUTPUT_NAMESPACE, "margin-bottom",
pointConverter.format(StrictGeomUtility.toExternalValue(sblp.getMarginBottom())));
}
if (sblp.getMarginRight() > 0)
{
attributeList.setAttribute(XmlDocumentWriter.LAYOUT_OUTPUT_NAMESPACE, "margin-right",
pointConverter.format(StrictGeomUtility.toExternalValue(sblp.getMarginRight())));
}
if (definition.getPaddingTop() > 0)
{
attributeList.setAttribute(XmlDocumentWriter.LAYOUT_OUTPUT_NAMESPACE, "padding-top",
pointConverter.format(StrictGeomUtility.toExternalValue(definition.getPaddingTop())));
}
if (definition.getPaddingLeft() > 0)
{
attributeList.setAttribute(XmlDocumentWriter.LAYOUT_OUTPUT_NAMESPACE, "padding-left",
pointConverter.format(StrictGeomUtility.toExternalValue(definition.getPaddingLeft())));
}
if (definition.getPaddingBottom() > 0)
{
attributeList.setAttribute(XmlDocumentWriter.LAYOUT_OUTPUT_NAMESPACE, "padding-bottom",
pointConverter.format(StrictGeomUtility.toExternalValue(definition.getPaddingBottom())));
}
if (definition.getPaddingRight() > 0)
{
attributeList.setAttribute(XmlDocumentWriter.LAYOUT_OUTPUT_NAMESPACE, "padding-right",
pointConverter.format(StrictGeomUtility.toExternalValue(definition.getPaddingRight())));
}
attributeList.setAttribute(XmlDocumentWriter.LAYOUT_OUTPUT_NAMESPACE, "x",
pointConverter.format(StrictGeomUtility.toExternalValue(box.getX())));
attributeList.setAttribute(XmlDocumentWriter.LAYOUT_OUTPUT_NAMESPACE, "y",