{
if (value instanceof Image)
{
try
{
final ImageContainer imageContainer = new DefaultImageReference((Image) value);
final StyleSheet rawSource = textExtractor.getRawSource().getStyleSheet();
final StrictBounds contentBounds =
new StrictBounds(content.getX(), content.getY() + contentOffset, content.getWidth(), content.getHeight());
createImageCell(rawSource, imageContainer, sheetLayout, rectangle, contentBounds);
}
catch (IOException ioe)
{
// Should not happen.
ExcelPrinter.logger.warn("Failed to process AWT-Image in Excel-Export", ioe);
}
return true;
}
else if (value instanceof ImageContainer)
{
final ImageContainer imageContainer = (ImageContainer) value;
// todo: this is wrong ..
final StyleSheet rawSource = textExtractor.getRawSource().getStyleSheet();
final StrictBounds contentBounds =
new StrictBounds(content.getX(), content.getY() + contentOffset, content.getWidth(), content.getHeight());
createImageCell(rawSource, imageContainer, sheetLayout, rectangle, contentBounds);
return true;
}
else if (value instanceof DrawableWrapper)
{
final DrawableWrapper drawable = (DrawableWrapper) value;
final RenderNode rawSource = textExtractor.getRawSource();
final StrictBounds contentBounds = new StrictBounds
(rawSource.getX(), rawSource.getY() + contentOffset, rawSource.getWidth(), rawSource.getHeight());
final ImageContainer imageFromDrawable =
RenderUtility.createImageFromDrawable(drawable, contentBounds, content, getMetaData());
createImageCell(rawSource.getStyleSheet(), imageFromDrawable, sheetLayout, rectangle, contentBounds);
return true;
}
else if (value instanceof Shape)