* @return true if the box is new, false otherwise
*/
private boolean updateStaticProperties(final RenderBox box)
{
final BoxDefinition boxDefinition = box.getBoxDefinition();
final StaticBoxLayoutProperties sblp = box.getStaticBoxLayoutProperties();
if (sblp.getNominalBaselineInfo() != null)
{
// mark box as seen ..
box.setStaticBoxPropertiesAge(box.getChangeTracker());
return false;
}
final long parentWidth = ProcessUtility.computeBlockContextWidth(box);
sblp.setMarginTop(boxDefinition.getMarginTop().resolve(parentWidth));
sblp.setMarginLeft(boxDefinition.getMarginLeft().resolve(parentWidth));
sblp.setMarginBottom(boxDefinition.getMarginBottom().resolve(parentWidth));
sblp.setMarginRight(boxDefinition.getMarginRight().resolve(parentWidth));
final Border border = boxDefinition.getBorder();
sblp.setBorderTop(border.getTop().getWidth());
sblp.setBorderLeft(border.getLeft().getWidth());
sblp.setBorderBottom(border.getBottom().getWidth());
sblp.setBorderRight(border.getRight().getWidth());
final StyleSheet style = box.getStyleSheet();
if (box.getNodeType() == LayoutNodeTypes.TYPE_BOX_LINEBOX)
{
sblp.setAvoidPagebreakInside(true);
}
else
{
sblp.setAvoidPagebreakInside(style.getBooleanStyleProperty(ElementStyleKeys.AVOID_PAGEBREAK_INSIDE, false));
}
sblp.setDominantBaseline(-1);
sblp.setOrphans(style.getIntStyleProperty(ElementStyleKeys.ORPHANS, 0));
sblp.setWidows(style.getIntStyleProperty(ElementStyleKeys.WIDOWS, 0));
final ExtendedBaselineInfo baselineInfo = metaData.getBaselineInfo('x', style);
if (baselineInfo == null)
{
throw new IllegalStateException();
}
sblp.setNominalBaselineInfo(baselineInfo);
sblp.setFontFamily(metaData.getNormalizedFontFamilyName((String) style.getStyleProperty(TextStyleKeys.FONT)));
final Object collapse = style.getStyleProperty(TextStyleKeys.WHITE_SPACE_COLLAPSE);
sblp.setPreserveSpace(WhitespaceCollapse.PRESERVE.equals(collapse));
sblp.setOverflowX(style.getBooleanStyleProperty(ElementStyleKeys.OVERFLOW_X, overflowXSupported));
sblp.setOverflowY(style.getBooleanStyleProperty(ElementStyleKeys.OVERFLOW_Y, overflowYSupported));
sblp.setInvisibleConsumesSpace(style.getBooleanStyleProperty
(ElementStyleKeys.INVISIBLE_CONSUMES_SPACE, box.getNodeType() == LayoutNodeTypes.TYPE_BOX_ROWBOX));
sblp.setVisible(style.getBooleanStyleProperty(ElementStyleKeys.VISIBLE));
box.setStaticBoxPropertiesAge(box.getChangeTracker());
computeBreakIndicator(box);
return true;
}