// todo: Check for cachability ..
final RenderBox box;
if ("block".equals(layoutType))
{
final SimpleStyleSheet styleSheet = bandCache.getStyleSheet(elementStyleSheet);
final BoxDefinition boxDefinition = boxDefinitionFactory.getBoxDefinition(styleSheet);
box = new BlockRenderBox(styleSheet, band.getObjectID(), boxDefinition, band.getElementType(),
band.getAttributes(), stateKey);
}
else if ("inline".equals(layoutType))
{
if (parentIsInlineBox)
{
final SimpleStyleSheet styleSheet = bandCache.getStyleSheet(elementStyleSheet);
final BoxDefinition boxDefinition = boxDefinitionFactory.getBoxDefinition(styleSheet);
box = new InlineRenderBox(styleSheet, band.getObjectID(), boxDefinition, band.getElementType(),
band.getAttributes(), stateKey);
}
else
{
// The non-inheritable styles will be applied to the auto-generated paragraph box. The inlinebox itself
// only receives the inheritable styles so that it can inherit it to its next child ..
final SimpleStyleSheet styleSheet = bandCache.getStyleSheet(new ParagraphPoolboxStyleSheet(elementStyleSheet));
final BoxDefinition boxDefinition = boxDefinitionFactory.getBoxDefinition(styleSheet);
box = new InlineRenderBox(styleSheet, band.getObjectID(), boxDefinition, band.getElementType(),
band.getAttributes(), stateKey);
}
}
else if ("row".equals(layoutType))
{
final SimpleStyleSheet styleSheet = bandCache.getStyleSheet(elementStyleSheet);
final BoxDefinition boxDefinition = boxDefinitionFactory.getBoxDefinition(styleSheet);
box = new RowRenderBox(styleSheet, band.getObjectID(), boxDefinition, band.getElementType(),
band.getAttributes(), stateKey);
}
else // assume 'Canvas' by default ..
{
final SimpleStyleSheet styleSheet;
if (elementStyleSheet.getBooleanStyleProperty(ElementStyleKeys.USE_MIN_CHUNKWIDTH))
{
styleSheet = bandCache.getStyleSheet(elementStyleSheet);
}
else