/* NOTE: The precedence of the various properties and shorthand values
* is discussed in XSL-FO Recommendation 1.1, Sections 5.2 and 5.3. */
/* Precedence is given to the absolute explicit property, if it is
* set. */
AbstractPadding explicitPadding = null;
final AbsoluteCompass absoluteDirection = getWritingMode(fobj,
context).getAbsoluteDirection(relativeDirection);
FoProperty rawPropertyType = AbstractPadding.rawPropertyType(
absoluteDirection);
explicitPadding = (AbstractPadding) getProperty(rawPropertyType);
/* The next item to check is the relative explicit property. */
if (explicitPadding == null) {
rawPropertyType = AbstractPadding.rawPropertyType(
relativeDirection);
explicitPadding = (AbstractPadding) getProperty(rawPropertyType);
}
/* If either the explicit absolute or relative directions are set,
* return that value. */
if (explicitPadding != null) {
return explicitPadding.getValue(context, fobj);
}
/* Neither the explicit absolute nor explicit relative directions are
* set. Check the "padding" shorthand. */
final PdPadding padding = (PdPadding) getProperty(FoProperty.PADDING);