return;
}
final ShapeDrawable drawable = (ShapeDrawable) rawbackend;
final Shape shape = drawable.getShape();
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);
}
else if ((backgroundHint & BACKGROUND_BOTTOM) == BACKGROUND_BOTTOM)
{
final RenderBox nodeParent = node.getParent();
if (nodeParent != null && (nodeParent.getY() + nodeParent.getHeight()) == (nodeY + nodeHeight))
{
retval.setBottom(edge);
}
}
}
else
{
if ((backgroundHint & BACKGROUND_BOTTOM) == BACKGROUND_BOTTOM)
{
retval.setBottom(edge);
}
}
}
return;
}
final boolean fill = styleSheet.getBooleanStyleProperty(ElementStyleKeys.FILL_SHAPE);
if (draw == false && fill == false)
{
return;
}
if (shape instanceof Rectangle2D ||
(ellipseAsRectangle && shape instanceof Ellipse2D))
{
if (retval == null)
{
retval = new CellBackground();
}
if (draw)
{
// the beast has a border ..
final BorderEdge edge = ProcessUtility.produceBorderEdge(styleSheet);
if (edge != null)
{
if ((backgroundHint & BACKGROUND_TOP) == BACKGROUND_TOP)
{
retval.setTop(edge);
}
if ((backgroundHint & BACKGROUND_LEFT) == BACKGROUND_LEFT)
{
retval.setLeft(edge);
}
if ((backgroundHint & BACKGROUND_BOTTOM) == BACKGROUND_BOTTOM)
{
retval.setBottom(edge);
}
if ((backgroundHint & BACKGROUND_RIGHT) == BACKGROUND_RIGHT)
{
retval.setRight(edge);
}
}
}
if (fill && ((backgroundHint & BACKGROUND_AREA) == BACKGROUND_AREA))
{
final Color color = (Color) styleSheet.getStyleProperty(ElementStyleKeys.FILL_COLOR);
if (color != null)
{
retval.addBackground(color);
}
else
{
retval.addBackground((Color) styleSheet.getStyleProperty(ElementStyleKeys.PAINT));
}
}
return;
}
if (shape instanceof RoundRectangle2D)
{
final RoundRectangle2D rr = (RoundRectangle2D) shape;
if (retval == null)
{
retval = new CellBackground();
}
if (draw)
{
// the beast has a border ..
final BorderEdge edge = ProcessUtility.produceBorderEdge(styleSheet);
if (edge != null)
{
if ((backgroundHint & BACKGROUND_TOP) == BACKGROUND_TOP)
{
retval.setTop(edge);
}
if ((backgroundHint & BACKGROUND_LEFT) == BACKGROUND_LEFT)
{
retval.setLeft(edge);
}
if ((backgroundHint & BACKGROUND_BOTTOM) == BACKGROUND_BOTTOM)
{
retval.setBottom(edge);
}
if ((backgroundHint & BACKGROUND_RIGHT) == BACKGROUND_RIGHT)
{
retval.setRight(edge);
}
}
}
if (fill && ((backgroundHint & BACKGROUND_AREA) == BACKGROUND_AREA))
{
final Color color = (Color) styleSheet.getStyleProperty(ElementStyleKeys.FILL_COLOR);
if (color != null)
{
retval.addBackground(color);
}
else
{
retval.addBackground((Color) styleSheet.getStyleProperty(ElementStyleKeys.PAINT));
}
}
final long arcHeight = StrictGeomUtility.toInternalValue(rr.getArcHeight());
final long arcWidth = StrictGeomUtility.toInternalValue(rr.getArcWidth());