Package org.foray.fotree.fo.prop

Examples of org.foray.fotree.fo.prop.AbstractBorderColor


     * @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);
    }
View Full Code Here

TOP

Related Classes of org.foray.fotree.fo.prop.AbstractBorderColor

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.