Package org.foray.fotree.fo.prop

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


    public int getAbsoluteMargin(final FObj fobj, final FoContext context,
            final AbsoluteCompass absoluteDirection) {
        // Try the specific property first (e.g. "margin-top")
        final FoProperty propertyType = AbstractMargin.rawPropertyType(
                absoluteDirection);
        AbstractMargin property = (AbstractMargin) getProperty(propertyType);
        if (property != null) {
            return property.getValue(context, fobj);
        }
        // Now try the shorthand property
        property = (AbstractMargin) getProperty(FoProperty.MARGIN);
        if (property != null) {
            return property.getValue(context, fobj);
        }
        // Return the default
        return AbstractMargin.getValueNoInstance();
    }
View Full Code Here


            final FoContext context, final RelativeCompass relativeDirection) {
        final AbsoluteCompass absoluteDirection = getWritingMode(fobj, context)
                .getAbsoluteDirection(relativeDirection);
        final FoProperty propertyType = AbstractMargin.rawPropertyType(
                absoluteDirection);
        AbstractMargin marginProperty = (AbstractMargin) getProperty(
                propertyType);
        if (marginProperty != null) {
            return true;
        }
        marginProperty = (AbstractMargin) getProperty(FoProperty.MARGIN);
View Full Code Here

        /* Find the corresponding absolute margin if it is specified. */
        final FoProperty rawMarginPropertyType =
            AbstractIndent.rawAbsoluteCorrespondingPropertyType(
                    fobj, context, direction);
        final AbstractMargin abstractMargin = (AbstractMargin)
                getProperty(rawMarginPropertyType);

        /* The intent of the algorithm seems to be that, if the absolute margin
         * is set and the relative indent property is not, and if this FO
         * generates a reference area, the relative indent property is
         * ignored.*/

        if (abstractMargin != null) {
            /* The corresponding absolute margin is specified. */
            int indent = 0;
            if (! fobj.traitIsReferenceArea()) {
                /* Start with the inherited relative value. */
                indent += AbstractIndent.getValueNoInstance(context, fobj,
                        direction);
            }
            indent += abstractMargin.getValue(context, fobj);
            /* TODO: Do the padding and border-width values below actually
             * qualify as "padding-corresponding" and "border-corresponding" as
             * specified? Or do we need to look for the properties using just
             * the absolute properties? */
            indent += this.getPadding(fobj, context, direction);
View Full Code Here

        final DtWritingMode writingMode = this.getWritingMode(fobj, context);
        final AbsoluteCompass absoluteDirection =
                writingMode.getAbsoluteDirection(relativeDirection);
        final FoProperty absolutePropertyType = AbstractMargin.rawPropertyType(
                absoluteDirection);
        final AbstractMargin absoluteProperty = (AbstractMargin) getProperty(
                absolutePropertyType);
        if (absoluteProperty != null) {
            return absoluteProperty.getValue(context, fobj);
        }

        /* Now try the relative-direction property. */
        final AbstractRelativeSpace relativeProperty =
                (AbstractRelativeSpace) getProperty(relativePropertyEnum);
View Full Code Here

TOP

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

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.