Package org.foray.fotree

Examples of org.foray.fotree.FObj


     */
    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(context, fobj);
            }
View Full Code Here


    private int getKeywordValue(final FoContext context,
            final AbsoluteCompass direction, final FObj fobj) {
        final FoValue foValue = this.convertValueToFoValue(value());
        switch (foValue) {
        case INHERIT: {
            final FObj effectiveParent = fobj.effectiveParent(context);
            if (direction == AbsoluteCompass.LEFT) {
                return effectiveParent.getMarginLeft(context);
            }
            if (direction == AbsoluteCompass.RIGHT) {
                return effectiveParent.getMarginRight(context);
            }
            if (direction == AbsoluteCompass.TOP) {
                return effectiveParent.getMarginTop(context);
            }
            if (direction == AbsoluteCompass.BOTTOM) {
                return effectiveParent.getMarginBottom(context);
            }
        }
        }
        throw this.unexpectedRetrieval();
    }
View Full Code Here

     * @return The value of this property.
     */
    public org.axsl.common.value.BorderStyle getValue(final FoContext context,
            final Compass direction, final FObj fobj) {
        if (this.isKeywordInherit(this.value)) {
            final FObj effectiveParent = fobj.effectiveParent(context);
            final PropertyList propertyList = effectiveParent.getPropertyList();
            return propertyList.getBorderStyle(effectiveParent, context,
                    direction);
        }
        if (this.canEvalBorderStyle(this.value)) {
            return this.evalBorderStyle(this.value);
View Full Code Here

     * Finds and returns the closest ancestor that is not an fo:wrapper.
     * @param context An object that knows how to resolve FoTree context issues.
     * @return The closest non-wrapper ancestor.
     */
    public FObj getNonWrapperAncestor(final FoContext context) {
        FObj ancestor = this.effectiveParent(context);
        while (ancestor instanceof Wrapper) {
            ancestor = ancestor.effectiveParent(context);
        }
        return ancestor;
    }
View Full Code Here

     * to.
     */
    @Override
    protected void finalizeText(final FoContext context)
            throws FoTreeException {
        final FObj ancestor = getNonWrapperAncestor(context);
        if (ancestor instanceof FObjMixed) {
            super.finalizeText(context);
            return;
        }
        /* The ancestor may not contain PCDATA. If the buffer contains anything
View Full Code Here

            switch (keyword) {
            case AUTO: {
                return CommonPositionPa.ABSOLUTE_POSITION_AUTO;
            }
            case INHERIT: {
                final FObj parent = fobj.effectiveParent(context);
                if (parent == null) {
                    return getValueNoInstance();
                }
                return parent.traitExtent();
            }
            }
        }
        if (value().canEvalPercentage()) {
            final int dimensionContainingBlock = this.dimensionContainingBlock(
View Full Code Here

        if (value().canEvalKeyword()) {
            final FoValue keywordValue = this.convertValueToFoValue(value());
            if (keywordValue == FoValue.TRANSPARENT) {
                return DtColor.COLOR_RGB_TRANSPARENT;
            } else if (keywordValue == FoValue.INHERIT) {
                final FObj parent = fobj.getParent();
                if (parent == null) {
                    return AbstractBorderColor.getValueNoInstance(context,
                            fobj);
                } else {
                    return getInheritedValue(fobj, context);
View Full Code Here

     * @param fobj The object for which this value is needed.
     * @param context An object that knows how to resolve FO context issues.
     * @return The inherited value of this property.
     */
    public Color getInheritedValue(final FObj fobj, final FoContext context) {
        final FObj parent = fobj.getParent();
        if (parent == null) {
            return AbstractBorderColor.getValueNoInstance(context, fobj);
        }
        return getParentValue(parent, context);
    }
View Full Code Here

    protected void validateDescendants() throws FoTreeException {
        if (this.getChildCount() < 1) {
            this.throwException("fo:list-block must have at least one child.");
        }
        for (int i = 0; i < this.getChildren().size(); i++) {
            final FObj fobj = this.getChildAt(i);
            if (! (fobj instanceof ListItem)) {
                this.throwException("Child of fo:list-block must be "
                        + "fo:list-item");
            }
        }
View Full Code Here

    public String getValue(final FoContext context, final FObj fobj) {
        if (value().canEvalKeyword()) {
            final FoValue keyword = this.convertValueToFoValue(value());
            switch (keyword) {
            case INHERIT: {
                final FObj parent = fobj.effectiveParent(context);
                if (parent != null) {
                    return parent.traitRole(context);
                }
            }
            case NONE: {
                return "";
            }
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.