super(box);
simpleContext = true;
final StaticBoxLayoutProperties blp = box.getStaticBoxLayoutProperties();
ExtendedBaselineInfo baselineInfo = box.getBaselineInfo();
if (baselineInfo == null)
{
baselineInfo = blp.getNominalBaselineInfo();
}
if (baselineInfo == null)
{
throw new IllegalStateException("A box that has no baseline info.");
}
final int dominantBaselineValue = blp.getDominantBaseline();
if (dominantBaselineValue == -1)
{
setDominantBaseline(baselineInfo.getDominantBaseline());
}
else
{
setDominantBaseline(dominantBaselineValue);
}
final BoxDefinition bdef = box.getBoxDefinition();
insetsTop = blp.getBorderTop() + bdef.getPaddingTop();
insetsBottom = blp.getBorderBottom() + bdef.getPaddingBottom();
baselines = baselineInfo.getBaselines();
final int length = baselines.length;
for (int i = 1; i < length; i++)
{
baselines[i] += insetsTop;
}