{
return null;
}
final RenderableReplacedContentBox contentBox = (RenderableReplacedContentBox) box;
final StyleSheet styleSheet = box.getStyleSheet();
final RenderableReplacedContent rpc = contentBox.getContent();
final Object rawContentObject = rpc.getRawObject();
if (rawContentObject instanceof DrawableWrapper == false)
{
return null;
}
final DrawableWrapper wrapper = (DrawableWrapper) rawContentObject;
final Object rawbackend = wrapper.getBackend();
if (rawbackend instanceof ShapeDrawable == false)
{
return null;
}
final ShapeDrawable drawable = (ShapeDrawable) rawbackend;
final Shape rawObject = drawable.getShape();
final boolean draw = styleSheet.getBooleanStyleProperty(ElementStyleKeys.DRAW_SHAPE);
if (draw && rawObject instanceof Line2D)
{
final int lineType;
final long coordinate;
final Line2D line = (Line2D) rawObject;
final boolean vertical = line.getX1() == line.getX2();
final boolean horizontal = line.getY1() == line.getY2();
if (vertical && horizontal)
{
return null;
}
if (vertical)
{
lineType = SheetLayoutTableCellDefinition.LINE_HINT_VERTICAL;
coordinate = StrictGeomUtility.toInternalValue(line.getX1()) + box.getX();
}
else if (horizontal)
{
lineType = SheetLayoutTableCellDefinition.LINE_HINT_HORIZONTAL;
coordinate = StrictGeomUtility.toInternalValue(line.getY1()) + box.getY() + shift;
}
else
{
return null;
}
return new SheetLayoutTableCellDefinition(lineType, coordinate);
}
if (rawObject instanceof Rectangle2D ||
(ellipseAsRectangle && rawObject instanceof Ellipse2D))
{
if (draw)
{
final BorderEdge edge = ProcessUtility.produceBorderEdge(box.getStyleSheet());
if (edge != null)
{
return MARKER_DEFINITION;
}
}
if (styleSheet.getBooleanStyleProperty(ElementStyleKeys.FILL_SHAPE))
{
return MARKER_DEFINITION;
}
return null;
}
if (rawObject instanceof RoundRectangle2D)
{
if (draw)
{
// the beast has a border ..
final BorderEdge edge = ProcessUtility.produceBorderEdge(box.getStyleSheet());
if (edge != null)
{
return MARKER_DEFINITION;
}
}
if (styleSheet.getBooleanStyleProperty(ElementStyleKeys.FILL_SHAPE))
{
return MARKER_DEFINITION;
}
return null;