* @param direction The direction for which the border-color is needed.
* @return The specified border-color property.
*/
public java.awt.Color getBorderColor(final FObj fobj,
final FoContext context, final RelativeCompass direction) {
AbstractBorderColor abstractBorderColor = null;
/* Try the most explicit setting first, e.g "border-top-color". */
FoProperty rawPropertyType = AbstractBorderColor.rawPropertyType(
direction);
abstractBorderColor = (AbstractBorderColor) getProperty(
rawPropertyType);
if (abstractBorderColor != null) {
return abstractBorderColor.getValue(direction, fobj, context);
}
/* Now try the low-level shorthand, that is, "border-color". */
final PdBorderColor borderColor = (PdBorderColor) getProperty(
FoProperty.BORDER_COLOR);
if (borderColor != null) {
return borderColor.getValue(direction, fobj, context);
}
/* Now try the high-level shorthand, that is, "border". */
final AbstractBorder border = (AbstractBorder) getProperty(
FoProperty.BORDER);
if (border != null) {
abstractBorderColor = border.getBorderColor();
return abstractBorderColor.getValue(direction, fobj, context);
}
/* If none of those work, try the explicit setting for the corresponding
* direction. */
final Compass otherDirection = getWritingMode(fobj,
context).getCorresponding(direction);
rawPropertyType = AbstractBorderColor.rawPropertyType(
otherDirection);
abstractBorderColor = (AbstractBorderColor) getProperty(
rawPropertyType);
if (abstractBorderColor != null) {
return abstractBorderColor.getValue(direction, fobj, context);
}
return AbstractBorderColor.getValueNoInstance(context, fobj);
}