Package org.foray.fotree.fo.prop

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


     * @param subProperty The keep type of the property to be returned.
     * @return The keep-together property.
     */
    public int getKeepTogether(final FObj fobj, final FoContext context,
            final AbstractKeep.Type subProperty) {
        final AbstractKeep property = (AbstractKeep) getProperty(
                FoProperty.KEEP_TOGETHER);
        if (property == null) {
            return AbstractKeep.getValueNoInstance(context,
                    FoProperty.KEEP_TOGETHER,
                    subProperty, fobj);
        }
        final PdPageBreakInside enumProperty = (PdPageBreakInside) getProperty(
                FoProperty.PAGE_BREAK_INSIDE);
        if (enumProperty != null) {
            switch(enumProperty.getValue(context, fobj)) {
            case AUTO: {
                return Integer.MIN_VALUE;
            }
            case AVOID: {
                return Integer.MAX_VALUE;
            }
            }
        }
        return property.getValue(context, subProperty, fobj);
    }
View Full Code Here


     * @param subProperty  The keep type of the property to be returned.
     * @return The keep-with-next property.
     */
    public int getKeepWithNext(final FObj fobj, final FoContext context,
            final AbstractKeep.Type subProperty) {
        final AbstractKeep property = (AbstractKeep) getProperty(
                FoProperty.KEEP_WITH_NEXT);
        if (property == null) {
            return AbstractKeep.getValueNoInstance(context,
                    FoProperty.KEEP_WITH_NEXT,
                    subProperty, fobj);
        }
        final PdPageBreakAfter enumProperty = (PdPageBreakAfter) getProperty(
                FoProperty.PAGE_BREAK_AFTER);
        if (enumProperty != null) {
            switch(enumProperty.getValue(context, fobj)) {
            case AUTO: {
                return Integer.MIN_VALUE;
            }
            case ALWAYS: {
                return Integer.MIN_VALUE;
            }
            case AVOID: {
                return Integer.MAX_VALUE;
            }
            case LEFT: {
                return Integer.MIN_VALUE;
            }
            case RIGHT: {
                return Integer.MIN_VALUE;
            }
            }
        }
        return property.getValue(context, subProperty, fobj);
    }
View Full Code Here

     * @param subProperty  The keep type of the property to be returned.
     * @return The keep-with-previous property.
     */
    public int getKeepWithPrevious(final FObj fobj, final FoContext context,
            final AbstractKeep.Type subProperty) {
        final AbstractKeep property = (AbstractKeep) getProperty(
                FoProperty.KEEP_WITH_PREVIOUS);
        if (property == null) {
            return AbstractKeep.getValueNoInstance(context,
                    FoProperty.KEEP_WITH_PREVIOUS,
                    subProperty, fobj);
        }
        final PdPageBreakBefore enumProperty = (PdPageBreakBefore) getProperty(
                FoProperty.PAGE_BREAK_BEFORE);
        if (enumProperty != null) {
            switch(enumProperty.getValue(context, fobj)) {
            case AUTO: {
                return Integer.MIN_VALUE;
            }
            case ALWAYS: {
                return Integer.MIN_VALUE;
            }
            case AVOID: {
                return Integer.MAX_VALUE;
            }
            case LEFT: {
                return Integer.MIN_VALUE;
            }
            case RIGHT: {
                return Integer.MIN_VALUE;
            }
            }
        }
        return property.getValue(context, subProperty, fobj);
    }
View Full Code Here

TOP

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

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.