Package org.foray.fotree.fo

Examples of org.foray.fotree.fo.FoProperty


            throw unexpectedValue(value, fobj);
        }
        // Create an array indicating which property is in each position
        final FoProperty[] positionArray = new FoProperty[tokenList.size()];
        for (int i = 0; i < tokenList.size(); i++) {
            final FoProperty contentType = getContentType(tokenList.get(i));
            if (contentType == null) {
                throw unexpectedValue(value, fobj);
            }
            positionArray[i] = contentType;
        }
View Full Code Here


     * @return The value of this function.
     */
    public PropertyValue eval(final Property callingProperty, final FObj fobj) {
        /* TODO: Provide the right context. */
        FObj parent = fobj.effectiveParent(null);
        final FoProperty propertyType = this.getPropertyType();
        Property ps = null;
        while (parent != null && ps == null) {
            ps = parent.getPropertyList().getProperty(propertyType);
            /* TODO: Provide the right context. */
            parent = fobj.effectiveParent(null);
View Full Code Here

     * @return The margin value, in millipoints.
     */
    public int getAbsoluteMargin(final FObj fobj, final FoContext context,
            final AbsoluteCompass absoluteDirection) {
        // Try the specific property first (e.g. "margin-top")
        final FoProperty propertyType = AbstractMargin.rawPropertyType(
                absoluteDirection);
        AbstractMargin property = (AbstractMargin) getProperty(propertyType);
        if (property != null) {
            return property.getValue(context, fobj);
        }
View Full Code Here

     */
    private boolean correspondingMarginExists(final FObj fobj,
            final FoContext context, final RelativeCompass relativeDirection) {
        final AbsoluteCompass absoluteDirection = getWritingMode(fobj, context)
                .getAbsoluteDirection(relativeDirection);
        final FoProperty propertyType = AbstractMargin.rawPropertyType(
                absoluteDirection);
        AbstractMargin marginProperty = (AbstractMargin) getProperty(
                propertyType);
        if (marginProperty != null) {
            return true;
View Full Code Here

        /* This algorithm is mostly documented at XSL-FO Recommendation 1.1,
         * Section 5.3.2, but see also Sections 7.11.7 (start-indent property)
         * and 7.11.8 (end-indent property). */

        /* Find the corresponding absolute margin if it is specified. */
        final FoProperty rawMarginPropertyType =
            AbstractIndent.rawAbsoluteCorrespondingPropertyType(
                    fobj, context, direction);
        final AbstractMargin abstractMargin = (AbstractMargin)
                getProperty(rawMarginPropertyType);

        /* The intent of the algorithm seems to be that, if the absolute margin
         * is set and the relative indent property is not, and if this FO
         * generates a reference area, the relative indent property is
         * ignored.*/

        if (abstractMargin != null) {
            /* The corresponding absolute margin is specified. */
            int indent = 0;
            if (! fobj.traitIsReferenceArea()) {
                /* Start with the inherited relative value. */
                indent += AbstractIndent.getValueNoInstance(context, fobj,
                        direction);
            }
            indent += abstractMargin.getValue(context, fobj);
            /* TODO: Do the padding and border-width values below actually
             * qualify as "padding-corresponding" and "border-corresponding" as
             * specified? Or do we need to look for the properties using just
             * the absolute properties? */
            indent += this.getPadding(fobj, context, direction);
            indent += this.getBorderWidth(fobj, context, direction);
            return indent;
        }

        /* If we got this far, it means that the corresponding absolute margin
         * was not specified, so we just need to find the right relative
         * indent value and return it. */

        AbstractIndent indent = null;
        final FoProperty rawPropertyType = AbstractIndent.rawPropertyType(
                direction);
        indent = (AbstractIndent) getProperty(rawPropertyType);
        if (indent == null) {
            return AbstractIndent.getValueNoInstance(context, fobj, direction);
        }
View Full Code Here

     * @param fobj The FObj to which the property belongs.
     * @param axis The axis for which the page-dimension is needed.
     * @return The requested page-dimension.
     */
    private int getPageDimension(final FObj fobj, final AbsoluteAxis axis) {
        final FoProperty propertyType = AbstractPageDimension.rawPropertyType(
                axis);
        final AbstractPageDimension property = (AbstractPageDimension)
                getProperty(propertyType);
        if (property != null) {
            return property.getValue(fobj);
View Full Code Here

        /* First try the absolute-direction property. */
        final DtWritingMode writingMode = this.getWritingMode(fobj, context);
        final AbsoluteCompass absoluteDirection =
                writingMode.getAbsoluteDirection(relativeDirection);
        final FoProperty absolutePropertyType = AbstractMargin.rawPropertyType(
                absoluteDirection);
        final AbstractMargin absoluteProperty = (AbstractMargin) getProperty(
                absolutePropertyType);
        if (absoluteProperty != null) {
            return absoluteProperty.getValue(context, fobj);
View Full Code Here

     * is needed.
     * @return The specified absolute offset.
     */
    public int getAbsoluteOffset(final FObj fobj, final FoContext context,
            final AbsoluteCompass absoluteDirection) {
        final FoProperty propertyType = AbstractAbsoluteOffset.rawPropertyName(
                absoluteDirection);
        final AbstractAbsoluteOffset property = (AbstractAbsoluteOffset)
                getProperty(propertyType);
        if (property != null) {
            return property.getValue(context, fobj);
View Full Code Here

     */
    public java.awt.Color getBorderColor(final FObj fobj,
            final FoContext context, final RelativeCompass direction) {
        AbstractBorderColor abstractBorderColor = null;
        /* Try the most explicit setting first, e.g "border-top-color". */
        FoProperty rawPropertyType = AbstractBorderColor.rawPropertyType(
                direction);
        abstractBorderColor = (AbstractBorderColor) getProperty(
                rawPropertyType);
        if (abstractBorderColor != null) {
            return abstractBorderColor.getValue(direction, fobj, context);
View Full Code Here

     */
    public org.axsl.common.value.BorderStyle getBorderStyle(final FObj fobj,
            final FoContext context, final Compass direction) {
        AbstractBorderStyle abstractBorderStyle = null;
        /* Try the most explicit setting first, e.g "border-top-style". */
        FoProperty rawPropertyType = AbstractBorderStyle.rawPropertyType(
                direction);
        abstractBorderStyle = (AbstractBorderStyle) getProperty(
                rawPropertyType);
        if (abstractBorderStyle != null) {
            return abstractBorderStyle.getValue(context, direction, fobj);
View Full Code Here

TOP

Related Classes of org.foray.fotree.fo.FoProperty

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.