Package org.foray.fotree

Examples of org.foray.fotree.FObj


        final AbsoluteAxis axis = this.getAbsoluteAxis();
        if (value().canEvalKeyword()) {
            final FoValue keyword = this.convertValueToFoValue(value());
            switch (keyword) {
            case INHERIT: {
                final FObj parent = fobj.getParent();
                if (parent == null) {
                    return getValueNoInstance(axis);
                }
                if (axis == AbsoluteAxis.HORIZONTAL) {
                    return parent.traitPageWidth();
                }
                if (axis == AbsoluteAxis.VERTICAL) {
                    return parent.traitPageHeight();
                }
                break;
            }
            case AUTO: {
                // This isn't right, but is reasonable for now
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.RELATIVE;
        }
        // If you can find the parent, use its value.
        return parent.getPropertyList().getTextAlignLast(parent, context);
    }
View Full Code Here

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

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

            final int lastPageNumberUsed) {
        if (value().canEvalKeyword()) {
            final FoValue keyword = this.convertValueToFoValue(value());
            switch (keyword) {
            case INHERIT: {
                final FObj parent = fobj.effectiveParent(context);
                if (parent != null) {
                    final PdInitialPageNumber property = (PdInitialPageNumber)
                            parent.getPropertyList().getProperty(
                                    FoProperty.INITIAL_PAGE_NUMBER);
                    return property.getValue(context, parent,
                            lastPageNumberUsed);
                }
            }
View Full Code Here

     */
    public FoValue getRawValue(final FObj fobj) {
        if (value().canEvalKeyword()) {
            final FoValue keyword = this.convertValueToFoValue(value());
            if (keyword == FoValue.INHERIT) {
                final FObj parent = fobj.getParent();
                if (parent != null) {
                    final PropertyList propertyList = parent.getPropertyList();
                    return propertyList.getRawInitialPageNumber(parent);
                }
                return getRawValueNoInstance();
            }
            return keyword;
View Full Code Here

    protected void validateDescendants() throws FoTreeException {
        boolean anyBlockContent = false;
        for (int i = 0; i < getChildren().size(); i++) {
            /* Cast to FObj should be OK, because it is not possible to create
             * an FOText item whose parent is anything but an FObjMixed. */
            final FObj child = getChildren().get(i);
            if (child.isContentBlock()) {
                anyBlockContent = true;
                continue;
            }
            /*
             * There is no need to make sure that the Markers are at the
             * beginning of the content. The Markers check that themselves as
             * they are created.
             */
            if (child instanceof Marker) {
                continue;
            }
            throwException(getFullName() + "has invalid content: "
                    + child.getName());
        }
        if (! anyBlockContent) {
            throwException(getFullName() + "must contain at least one %block "
                    + "item.");
        }
View Full Code Here

                 * For now, this is the same as "auto".
                 */
                return AbstractPageDimension.getValueNoInstance(axis);
            }
            case INHERIT: {
                final FObj parent = fobj.effectiveParent(context);
                if (parent != null) {
                    if (axis == AbsoluteAxis.HORIZONTAL) {
                        return fobj.traitPageWidth();
                    }
                    if (axis == AbsoluteAxis.VERTICAL) {
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().traitReferenceOrientation(parent,
                    context);
        }
        return FoValue.NUM_ZERO;
    }
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.