* {@inheritDoc}
*/
public Status layout(final AreaNode areaNode,
final GraftingPoint graftingPoint) throws AreaTreeException {
if (! (areaNode instanceof BlockContentFactory)) {
throw new AreaTreeException("Area \"" + areaNode.getAreaName()
+ "\" cannot contain a NormalBlockArea.");
}
final BlockContentFactory bcArea = (BlockContentFactory) areaNode;
if (! this.breakStatusBeforeChecked) {
this.breakStatusBeforeChecked = true;
// no break if first in area tree, or leading in context
// area
final Status breakBeforeStatus = getLayout().checkBreakBefore(
this.node, areaNode.nearestArea());
if (breakBeforeStatus != Status.OK) {
return breakBeforeStatus;
}
}
NormalBlockArea blockArea;
if (! this.anythingLaidOut) {
this.noLayoutCount++;
}
if (this.noLayoutCount > this.infLoopThreshhold) {
throw new AreaTreeException(
"No meaningful layout in block after many attempts.\n"
+ "Infinite loop is assumed. Processing halted. Context:\n"
+ this.node.getContextMessage());
}