private static CellBackground applyBorder(final RenderBox content,
CellBackground retval,
final int backgroundHint)
{
final Border border = content.getBoxDefinition().getBorder();
if (border.isEmpty())
{
return retval;
}
if ((backgroundHint & BACKGROUND_TOP) == BACKGROUND_TOP)
{
final BorderEdge borderEdgeTop = border.getTop();
if (borderEdgeTop.isEmpty() == false)
{
if (retval == null)
{
retval = new CellBackground();
}
retval.setTop(borderEdgeTop);
}
}
if ((backgroundHint & BACKGROUND_LEFT) == BACKGROUND_LEFT)
{
final BorderEdge borderEdgeLeft = border.getLeft();
if (borderEdgeLeft.isEmpty() == false)
{
if (retval == null)
{
retval = new CellBackground();
}
retval.setLeft(borderEdgeLeft);
}
}
if ((backgroundHint & BACKGROUND_BOTTOM) == BACKGROUND_BOTTOM)
{
final BorderEdge borderEdgeBottom = border.getBottom();
if (borderEdgeBottom.isEmpty() == false)
{
if (retval == null)
{
retval = new CellBackground();
}
retval.setBottom(borderEdgeBottom);
}
}
if ((backgroundHint & BACKGROUND_RIGHT) == BACKGROUND_RIGHT)
{
final BorderEdge borderEdgeRight = border.getRight();
if (borderEdgeRight.isEmpty() == false)
{
if (retval == null)
{
retval = new CellBackground();