return corner.getWidth() == 0 && corner.getHeight() == 0;
}
private AttributeList createCellAttributes(final CellBackground border)
{
final AttributeList attributeList = new AttributeList();
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",
String.valueOf(StrictGeomUtility.toExternalValue(top.getWidth())));
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",
String.valueOf(StrictGeomUtility.toExternalValue(left.getWidth())));
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",
String.valueOf(StrictGeomUtility.toExternalValue(bottom.getWidth())));
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",
String.valueOf(StrictGeomUtility.toExternalValue(right.getWidth())));
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",
String.valueOf(StrictGeomUtility.toExternalValue(topLeft.getWidth())));
attributeList.setAttribute(XmlDocumentWriter.LAYOUT_OUTPUT_NAMESPACE, "border-top-left-y",
String.valueOf(StrictGeomUtility.toExternalValue(topLeft.getHeight())));
}
final BorderCorner topRight = border.getTopRight();
if (isEmptyCorner(topRight) == false)
{
attributeList.setAttribute(XmlDocumentWriter.LAYOUT_OUTPUT_NAMESPACE, "border-top-right-x",
String.valueOf(StrictGeomUtility.toExternalValue(topRight.getWidth())));
attributeList.setAttribute(XmlDocumentWriter.LAYOUT_OUTPUT_NAMESPACE, "border-top-right-y",
String.valueOf(StrictGeomUtility.toExternalValue(topRight.getHeight())));
}
final BorderCorner bottomLeft = border.getBottomLeft();
if (isEmptyCorner(bottomLeft) == false)
{
attributeList.setAttribute(XmlDocumentWriter.LAYOUT_OUTPUT_NAMESPACE, "border-bottom-left-x",
String.valueOf(StrictGeomUtility.toExternalValue(bottomLeft.getWidth())));
attributeList.setAttribute(XmlDocumentWriter.LAYOUT_OUTPUT_NAMESPACE, "border-bottom-left-y",
String.valueOf(StrictGeomUtility.toExternalValue(bottomLeft.getHeight())));
}
final BorderCorner bottomRight = border.getBottomRight();
if (isEmptyCorner(bottomRight) == false)
{
attributeList.setAttribute(XmlDocumentWriter.LAYOUT_OUTPUT_NAMESPACE, "border-bottom-right-x",
String.valueOf(StrictGeomUtility.toExternalValue(bottomRight.getWidth())));
attributeList.setAttribute(XmlDocumentWriter.LAYOUT_OUTPUT_NAMESPACE, "border-bottom-right-y",
String.valueOf(StrictGeomUtility.toExternalValue(bottomRight.getHeight())));
}
final Color backgroundColor = border.getBackgroundColor();
if (backgroundColor != null)
{
attributeList.setAttribute(XmlDocumentWriter.LAYOUT_OUTPUT_NAMESPACE, "background-color",
ColorValueConverter.colorToString(backgroundColor));
}
final String[] anchors = border.getAnchors();
if (anchors.length > 0)
{
final StringBuffer anchorText = new StringBuffer(100);
for (int i = 0; i < anchors.length; i++)
{
final String anchor = anchors[i];
if (i == 0)
{
anchorText.append(' ');
}
anchorText.append(anchor);
}
attributeList.setAttribute(XmlDocumentWriter.LAYOUT_OUTPUT_NAMESPACE, "anchor", anchorText.toString());
}
return attributeList;
}