// A spanned cell ..
writer.writeTag(null, "covered-cell", XmlWriter.CLOSE);
continue;
}
final AttributeList attList = new AttributeList();
final ReportAttributeMap attrs = bg.getAttributes();
final Object nameAttr = attrs.getAttribute(AttributeNames.Core.NAMESPACE, AttributeNames.Core.NAME);
if (nameAttr instanceof String)
{
attList.setAttribute(null, "content-idref",
(String) nameAttr);
}
final String[] anchors = bg.getAnchors();
if (anchors != null)
{
final StringBuffer anchor = new StringBuffer(100);
for (int i = 0; i < anchors.length; i++)
{
if (i != 0)
{
anchor.append(", ");
}
anchor.append(anchors[i]);
}
attList.setAttribute(null, "anchor", anchor.toString());
}
if (bg.getBackgroundColor() != null)
{
attList.setAttribute(null, "background-color", ColorValueConverter.colorToString(bg.getBackgroundColor()));
}
// if (bg.getVerticalAlignment() != null)
// {
// attList.setAttribute(null, "vertical-alignment", String.valueOf(bg.getVerticalAlignment()));
// }
//
final BorderEdge top = bg.getTop();
if (top != null)
{
attList.setAttribute(null, "border-top-color",
ColorValueConverter.colorToString(top.getColor()));
attList.setAttribute(null, "border-top-width",
String.valueOf(StrictGeomUtility.toExternalValue(top.getWidth())));
attList.setAttribute(null, "border-top-style",
String.valueOf(top.getBorderStyle()));
}
final BorderEdge left = bg.getLeft();
if (left != null)
{
attList.setAttribute(null, "border-left-color",
ColorValueConverter.colorToString(left.getColor()));
attList.setAttribute(null, "border-left-width",
String.valueOf(StrictGeomUtility.toExternalValue(left.getWidth())));
attList.setAttribute(null, "border-left-style",
String.valueOf(left.getBorderStyle()));
}
final BorderEdge bottom = bg.getBottom();
if (bottom != null)
{
attList.setAttribute(null, "border-bottom-color",
ColorValueConverter.colorToString(bottom.getColor()));
attList.setAttribute(null, "border-bottom-width",
String.valueOf(StrictGeomUtility.toExternalValue(bottom.getWidth())));
attList.setAttribute(null, "border-bottom-style",
String.valueOf(bottom.getBorderStyle()));
}
final BorderEdge right = bg.getRight();
if (right != null)
{
attList.setAttribute(null, "border-right-color",
ColorValueConverter.colorToString(right.getColor()));
attList.setAttribute(null, "border-right-width",
String.valueOf(StrictGeomUtility.toExternalValue(right.getWidth())));
attList.setAttribute(null, "border-right-style",
String.valueOf(right.getBorderStyle()));
}
final BorderCorner topLeft = bg.getTopLeft();
if (topLeft != null)
{
attList.setAttribute(null, "border-top-left-x",
String.valueOf(StrictGeomUtility.toExternalValue(topLeft.getWidth())));
attList.setAttribute(null, "border-top-left-y",
String.valueOf(StrictGeomUtility.toExternalValue(topLeft.getHeight())));
}
final BorderCorner topRight = bg.getTopRight();
if (topRight != null)
{
attList.setAttribute(null, "border-top-right-x",
String.valueOf(StrictGeomUtility.toExternalValue(topRight.getWidth())));
attList.setAttribute(null, "border-top-right-y",
String.valueOf(StrictGeomUtility.toExternalValue(topRight.getHeight())));
}
final BorderCorner bottomLeft = bg.getBottomLeft();
if (bottomLeft != null)
{
attList.setAttribute(null, "border-bottom-left-x",
String.valueOf(StrictGeomUtility.toExternalValue(bottomLeft.getWidth())));
attList.setAttribute(null, "border-bottom-left-y",
String.valueOf(StrictGeomUtility.toExternalValue(bottomLeft.getHeight())));
}
final BorderCorner bottomRight = bg.getBottomRight();
if (bottomRight != null)
{
attList.setAttribute(null, "border-bottom-right-x",
String.valueOf(StrictGeomUtility.toExternalValue(bottomRight.getWidth())));
attList.setAttribute(null, "border-bottom-right-y",
String.valueOf(StrictGeomUtility.toExternalValue(bottomRight.getHeight())));
}
writer.writeTag(null, "cell", attList, XmlWriter.CLOSE);
}
writer.writeCloseTag();