final StyleSheet styleSheet = node.getStyleSheet();
final boolean draw = styleSheet.getBooleanStyleProperty(ElementStyleKeys.DRAW_SHAPE);
if (draw && shape instanceof Line2D)
{
final Line2D line = (Line2D) shape;
final boolean vertical = line.getX1() == line.getX2();
final boolean horizontal = line.getY1() == line.getY2();
if (vertical && horizontal)
{
// not a valid line ..
return;
}
if (vertical == false && horizontal == false)
{
// not a valid line ..
return;
}
if (retval == null)
{
retval = new CellBackground();
}
final BorderEdge edge = ProcessUtility.produceBorderEdge(styleSheet);
if (edge == null)
{
return;
}
if (vertical)
{
if (line.getX1() == 0)
{
if ((backgroundHint & BACKGROUND_LEFT) == BACKGROUND_LEFT)
{
retval.setLeft(edge);
}
else if ((backgroundHint & BACKGROUND_RIGHT) == BACKGROUND_RIGHT)
{
final RenderBox nodeParent = node.getParent();
if (nodeParent != null && (nodeParent.getX() + nodeParent.getWidth()) == (nodeX + nodeWidth))
{
retval.setRight(edge);
}
}
}
else
{
if ((backgroundHint & BACKGROUND_RIGHT) == BACKGROUND_RIGHT)
{
retval.setRight(edge);
}
}
}
else
{
if (line.getY1() == 0)
{
if ((backgroundHint & BACKGROUND_TOP) == BACKGROUND_TOP)
{
retval.setTop(edge);
}