Package org.foray.fotree

Examples of org.foray.fotree.FObj


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


     * @param fobj The FO for which this value is needed.
     * @return The inherited or initial value of this property.
     */
    public static int getValueNoInstance(final FoContext context,
            final FObj fobj) {
        final FObj parent = fobj.getParent();
        if (parent == null) {
            return PdChangeBarOffset.DEFAULT_CHANGE_BAR_OFFSET;
        }
        return parent.traitChangeBarOffset(context);
    }
View Full Code Here

     * @param fobj The FO for which this value is needed.
     * @return The initial value for this property.
     */
    public static FoValue getValueNoInstance(final FoContext context,
            final FObj fobj) {
        final FObj parent = fobj.effectiveParent(context);
        // If you can't find the parent, use initial value.
        if (parent == null) {
            return FoValue.START;
        }
        // If you can find the parent, use its value.
        return parent.getPropertyList().getTextAlign(parent, context);
    }
View Full Code Here

            }
            case AUTO: {
                return getValueNoInstance(character);
            }
            case INHERIT: {
                final FObj parent = fobj.effectiveParent(context);
                if (parent != null) {
                    return parent.traitTreatAsWordSpace(context, character);
                }
                return getValueNoInstance(character);
            }
            }
        }
View Full Code Here

     * @param fobj The FO for which this value is needed.
     * @return The initial value for this property.
     */
    public static FoValue getValueNoInstance(final FoContext context,
            final FObj fobj) {
        final FObj parent = fobj.effectiveParent(context);
        if (parent != null) {
            return parent.getPropertyList().traitWhiteSpace(parent, context);
        }
        return FoValue.NORMAL;
    }
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(context, fobj);
            }
View Full Code Here

    private int getKeywordValue(final FoContext context, final FObj fobj) {
        final FoValue foValue = this.convertValueToFoValue(value());
        final AbsoluteCompass direction = this.getAbsoluteCompass();
        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);
            }
        }
        case AUTO: {
            if (direction == AbsoluteCompass.LEFT) {
                /* TODO: This needs to conform to the CSS2 Spec, Section 10.3.
View Full Code Here

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

    public AlignmentBaseline traitValue(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);
                return parent.getPropertyList().traitAlignmentBaseline(parent,
                        context);
            }
            case AUTO: return AlignmentBaseline.AUTO;
            case BASELINE: return AlignmentBaseline.BASELINE;
            case BEFORE_EDGE: return AlignmentBaseline.BEFORE_EDGE;
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

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.