Package org.foray.fotree

Examples of org.foray.fotree.FObj


     */
    private int getValueInherited(final FoContext context,
            final LengthRange subProperty, final FObj fobj) {
        final RelativeCompass relativeDirection = this.getRelativeCompass();
        if (relativeDirection == RelativeCompass.BEFORE) {
            final FObj effectiveParent = fobj.effectiveParent(context);
            switch (subProperty) {
            case MINIMUM: {
                return effectiveParent.traitSpaceBeforeMinimum(context);
            }
            case OPTIMUM: {
                return effectiveParent.traitSpaceBeforeOptimum(context);
            }
            case MAXIMUM: {
                return effectiveParent.traitSpaceBeforeMaximum(context);
            }
            default: {
                return getValueNoInstance();
            }
            }
        }
        if (relativeDirection == RelativeCompass.AFTER) {
            final FObj effectiveParent = fobj.effectiveParent(context);
            switch (subProperty) {
            case MINIMUM: {
                return effectiveParent.traitSpaceAfterMinimum(context);
            }
            case OPTIMUM: {
                return effectiveParent.traitSpaceAfterOptimum(context);
            }
            case MAXIMUM: {
                return effectiveParent.traitSpaceAfterMaximum(context);
            }
            default: {
                return getValueNoInstance();
            }
            }
View Full Code Here


            case BOTTOM:
            case RIGHT: {
                return paddingRectangleDimension - backgroundImageDimension;
            }
            case INHERIT: {
                final FObj parent = fobj.effectiveParent(context);
                if (parent != null) {
                    final AbsoluteAxis axis = this.getAbsoluteAxis();
                    if (axis == AbsoluteAxis.HORIZONTAL) {
                        return parent.traitBackgroundPositionHorizontal(
                                context, paddingRectangleDimension,
                                backgroundImageDimension);
                    }
                    if (axis == AbsoluteAxis.VERTICAL) {
                        return parent.traitBackgroundPositionVertical(
                                context, paddingRectangleDimension,
                                backgroundImageDimension);
                    }
                }
            }
View Full Code Here

     * @param fobj The FO for which this value is needed.
     * @return The initial value for this property.
     */
    public static int traitValueNoInstance(final FoContext context,
            final FObj fobj) {
        final FObj parent = fobj.effectiveParent(context);
        if (parent == null) {
            return PdProvisionalDistanceBetweenStarts.INITIAL_VALUE;
        }
        return parent.traitProvisionalDistanceBetweenStarts(context);
    }
View Full Code Here

     * @param fobj The FO for which this value is needed.
     * @return The value of this property.
     */
    public static int getValueNoInstance(final FoContext context,
            final FObj fobj) {
        final FObj parent = fobj.effectiveParent(context);
        if (parent != null) {
            return parent.traitHyphenationCharacter(context);
        }
        /* TODO: The standard calls for 0x2010, but we need to handle that
         * downstream better for fonts that don't have it. */
        // return 0x2010;
        return '-';
View Full Code Here

     */
    public FoValue getValue(final FoContext context, final FObj fobj) {
        if (value().canEvalKeyword()) {
            final FoValue keyword = this.convertValueToFoValue(value());
            if (keyword == FoValue.INHERIT) {
                final FObj parent = fobj.effectiveParent(context);
                if (parent != null) {
                    return getInheritedValue(context, parent);
                }
                return getValueNoInstance();
            }
View Full Code Here

            }
            /* No descendant can be a block-container that is absolutely
             * positioned. */
            final DescendantIterator iterator = node.getDescendantIterator();
            while (iterator.hasNext()) {
                final FObj descendant = iterator.next();
                if (descendant instanceof BlockContainer) {
                    final BlockContainer blockContainer
                            = (BlockContainer) descendant;
                    final AbsolutePosition absPosition
                            = blockContainer.traitAbsolutePosition(null);
                    if (absPosition.isAbsolutelyPositioned()) {
                        descendant.throwException("Absolutely-positioned "
                                + "block-container may not descend from "
                                + "fo:title");
                    }
                }
            }
View Full Code Here

     * @param fobj The FO for which this value is needed.
     * @return The initial value for this property.
     */
    public static double getValueNoInstance(final FoContext context,
            final FObj fobj) {
        final FObj parent = fobj.effectiveParent(context);
        if (parent != null) {
            return parent.traitPitch(context);
        }
        final Voice voice = fobj.getVoice(context);
        return voice.pitchMedium();
    }
View Full Code Here

     * @return The inherited value of this property.
     */
    private int getValueInherited(final FoContext context,
            final LengthRange subProperty, final FObj fobj,
            final int parentAreaCRIPD) {
        final FObj effectiveParent = fobj.effectiveParent(context);
        switch (subProperty) {
        case MINIMUM: {
            return effectiveParent.traitLeaderLengthMin(context);
        }
        case OPTIMUM: {
            return effectiveParent.traitLeaderLengthOpt(context);
        }
        case MAXIMUM: {
            return effectiveParent.traitLeaderLengthMax(context);
        }
        }
        return getValueNoInstance(subProperty, fobj, context);
    }
View Full Code Here

            throwException("First child of " + getFullName()
                    + " must be fo:bookmark-title.");
        }
        // Validate that all other children are Outline instances.
        for (int i = 1; i < getChildren().size(); i++) {
            final FObj child = getChildren().get(i);
            if (child instanceof BookmarkTitle) {
                throwException("Child fo:bookmark-title not allowed in this "
                        + "position.");
            }
            if (! (child instanceof Bookmark)) {
                throwException(child.getFullName() + "cannot be a child of "
                        + this.getFullName());
            }
        }
    }
View Full Code Here

            final FoValue foValue = this.convertValueToFoValue(value());
            if (foValue == FoValue.AUTO) {
                return true;
            }
            if (foValue == FoValue.INHERIT) {
                final FObj parent = fobj.getParent();
                if (parent == null) {
                    return true;
                }
                final PropertyList parentProperties = parent.getPropertyList();
                return parentProperties.isIpdAuto(parent);
            }
        }
        return false;
    }
View Full Code Here

TOP

Related Classes of org.foray.fotree.FObj

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.