final ReportAttributeMap attributes,
final InstanceID objectID)
{
if (BandStyleKeys.LAYOUT_AUTO.equals(layoutType))
{
final SimpleStyleSheet styleSheet = bandCache.getStyleSheet(elementStyleSheet);
return new AutoRenderBox(objectID, stateKey, styleSheet, attributes, elementType);
}
if (BandStyleKeys.LAYOUT_BLOCK.equals(layoutType))
{
final SimpleStyleSheet styleSheet = bandCache.getStyleSheet(elementStyleSheet);
final BoxDefinition boxDefinition = boxDefinitionFactory.getBoxDefinition(styleSheet);
return new BlockRenderBox(styleSheet, objectID, boxDefinition, elementType, attributes, stateKey);
}
if (LAYOUT_PARAGRAPH_LINEBOX.equals(layoutType))
{
// 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);
return new InlineRenderBox(styleSheet, objectID, boxDefinition, elementType, attributes, stateKey);
}
else if (BandStyleKeys.LAYOUT_INLINE.equals(layoutType))
{
final SimpleStyleSheet styleSheet = bandCache.getStyleSheet(elementStyleSheet);
final BoxDefinition boxDefinition = boxDefinitionFactory.getBoxDefinition(styleSheet);
return new InlineRenderBox(styleSheet, objectID, boxDefinition, elementType, attributes, stateKey);
}
if (BandStyleKeys.LAYOUT_ROW.equals(layoutType))
{
final SimpleStyleSheet styleSheet = bandCache.getStyleSheet(elementStyleSheet);
final BoxDefinition boxDefinition = boxDefinitionFactory.getBoxDefinition(styleSheet);
return new RowRenderBox(styleSheet, objectID, boxDefinition, elementType, attributes, stateKey);
}
if (BandStyleKeys.LAYOUT_TABLE.equals(layoutType))
{
if (strictCompatibilityMode)
{
throw new IncompatibleFeatureException("A report with a legacy mode of pre-4.0 cannot handle table layouts. " +
"Migrate your report to version 4.0 or higher.",
ClassicEngineBoot.computeVersionId(4, 0, 0));
}
final SimpleStyleSheet styleSheet = bandCache.getStyleSheet(elementStyleSheet);
final BoxDefinition boxDefinition = boxDefinitionFactory.getBoxDefinition(styleSheet);
return new TableRenderBox(styleSheet, objectID, boxDefinition, elementType, attributes, stateKey);
}
if (BandStyleKeys.LAYOUT_TABLE_BODY.equals(layoutType) ||
BandStyleKeys.LAYOUT_TABLE_HEADER.equals(layoutType) ||
BandStyleKeys.LAYOUT_TABLE_FOOTER.equals(layoutType))
{
final SimpleStyleSheet styleSheet = bandCache.getStyleSheet(elementStyleSheet);
final BoxDefinition boxDefinition = boxDefinitionFactory.getBoxDefinition(styleSheet);
return new TableSectionRenderBox(styleSheet, objectID, boxDefinition, elementType, attributes, stateKey);
}
if (BandStyleKeys.LAYOUT_TABLE_ROW.equals(layoutType))
{
final SimpleStyleSheet styleSheet = bandCache.getStyleSheet(elementStyleSheet);
final BoxDefinition boxDefinition = boxDefinitionFactory.getBoxDefinition(styleSheet);
return new TableRowRenderBox(styleSheet, objectID, boxDefinition, elementType, attributes, stateKey);
}
if (BandStyleKeys.LAYOUT_TABLE_CELL.equals(layoutType))
{
final SimpleStyleSheet styleSheet = bandCache.getStyleSheet(elementStyleSheet);
final BoxDefinition boxDefinition = boxDefinitionFactory.getBoxDefinition(styleSheet);
return new TableCellRenderBox(styleSheet, objectID, boxDefinition, elementType, attributes, stateKey);
}
if (BandStyleKeys.LAYOUT_TABLE_COL.equals(layoutType))
{
final SimpleStyleSheet styleSheet = bandCache.getStyleSheet(elementStyleSheet);
final BoxDefinition boxDefinition = boxDefinitionFactory.getBoxDefinition(styleSheet);
return new TableColumnNode(styleSheet, objectID, boxDefinition, elementType, attributes, stateKey);
}
if (BandStyleKeys.LAYOUT_TABLE_COL_GROUP.equals(layoutType))
{
final SimpleStyleSheet styleSheet = bandCache.getStyleSheet(elementStyleSheet);
return new TableColumnGroupNode(styleSheet, attributes);
}
// assume 'Canvas' by default ..
final SimpleStyleSheet styleSheet = bandCache.getStyleSheet(elementStyleSheet);
final BoxDefinition boxDefinition = boxDefinitionFactory.getBoxDefinition(styleSheet);
return new CanvasRenderBox(styleSheet, objectID, boxDefinition, elementType,
attributes, stateKey);
}