Package org.apache.fop.fo.properties

Examples of org.apache.fop.fo.properties.Property


    /**
     * Try to parse a multiply, divide or modulo expression and return
     * the resulting Property.
     */
    private Property parseMultiplicativeExpr() throws PropertyException {
        Property prop = parseUnaryExpr();
        loop:
        while (true) {
            switch (currentToken) {
            case TOK_DIV:
                next();
                prop = evalDivide(prop.getNumeric(),
                                  parseUnaryExpr().getNumeric());
                break;
            case TOK_MOD:
                next();
                prop = evalModulo(prop.getNumber(),
                                  parseUnaryExpr().getNumber());
                break;
            case TOK_MULTIPLY:
                next();
                prop = evalMultiply(prop.getNumeric(),
                                    parseUnaryExpr().getNumeric());
                break;
            default:
                break loop;
            }
View Full Code Here


     * expression representing a primitive Property datatype, such as a
     * string literal, an NCname, a number or a unit expression, or a
     * function call expression.
     */
    private Property parsePrimaryExpr() throws PropertyException {
        Property prop;
        if (currentToken == TOK_COMMA) {
            //Simply skip commas, for example for font-family
            next();
        }
        switch (currentToken) {
View Full Code Here

     * to the number expected.
     */
    Property[] parseArgs(Function function) throws PropertyException {
        int nbArgs = function.nbArgs();
        Property[] args = new Property[nbArgs];
        Property prop;
        int i = 0;
        if (currentToken == TOK_RPAR) {
            // No args: func()
            next();
        } else {
View Full Code Here

    Property[] parseVarArgs(Function function) throws PropertyException {
        // For variable argument functions the minimum number of arguments is returned as a
        // negative integer from the nbArgs method
        int nbArgs = -function.nbArgs();
        List args = new LinkedList();
        Property prop;
        if (currentToken == TOK_RPAR) {
            // No args: func()
            next();
        } else {
            while (true) {
View Full Code Here

        // text-align-last
        m  = new EnumProperty.Maker(PR_TEXT_ALIGN_LAST) {
            public Property get(int subpropId, PropertyList propertyList,
                    boolean bTryInherit, boolean bTryDefault) throws PropertyException {
                Property p = super.get(subpropId, propertyList, bTryInherit, bTryDefault);
                if (p != null && p.getEnum() == EN_RELATIVE) {
                    //The default may have been returned, so check inherited value
                    p = propertyList.getNearestSpecified(PR_TEXT_ALIGN_LAST);
                    if (p.getEnum() == EN_RELATIVE) {
                        return calcRelative(propertyList);
                    }
                }
                return p;
            }

            private Property calcRelative(PropertyList propertyList) throws PropertyException {
                Property corresponding = propertyList.get(PR_TEXT_ALIGN);
                if (corresponding == null) {
                    return null;
                }
                int correspondingValue = corresponding.getEnum();
                if (correspondingValue == EN_JUSTIFY) {
                    return getEnumProperty(EN_START, "START");
                } else if (correspondingValue == EN_END) {
                    return getEnumProperty(EN_END, "END");
                } else if (correspondingValue == EN_START) {
View Full Code Here

     * @param propId The property ID
     */
    public Property get(int propId, boolean bTryInherit, boolean bTryDefault)
        throws PropertyException
    {
        Property p = values[propId];
        if (p == null) {
            p = values[propId] = super.get(propId, bTryInherit, bTryDefault);
        }
        return p;
    }
View Full Code Here

        int propID = FOPropertyMapping.getPropertyId(propName);
        if (propID < 0) {
            collector.notifyException(new IllegalArgumentException(
                    "Property not found: " + propName));
        } else {
            Property prop;
            prop = propertyList.getParentPropertyList().get(propID);
            if (component != null) {
                //Access subcomponent
                Property mainProp = prop;
                prop = null;
                LengthPairProperty lpp = mainProp.getLengthPair();
                if (lpp != null) {
                    prop = lpp.getComponent(FOPropertyMapping.getSubPropertyId(component));
                }
                LengthRangeProperty lrp = mainProp.getLengthRange();
                if (lrp != null) {
                    prop = lrp.getComponent(FOPropertyMapping.getSubPropertyId(component));
                }
                KeepProperty kp = mainProp.getKeep();
                if (kp != null) {
                    prop = kp.getComponent(FOPropertyMapping.getSubPropertyId(component));
                }
                SpaceProperty sp = mainProp.getSpace();
                if (sp != null) {
                    prop = sp.getComponent(FOPropertyMapping.getSubPropertyId(component));
                }
            }
            String s;
View Full Code Here

     * a shorthand property, otherwise null.
     * @throws PropertyException ...
     */
    public Property getExplicitOrShorthand(int propId) throws PropertyException {
        /* Handle request for one part of a compound property */
        Property p = getExplicit(propId);
        if (p == null) {
            p = getShorthand(propId);
        }
        return p;
    }
View Full Code Here

     * @return The computed value if the property is explicitly set on some
     * ancestor of the current FO, else the initial value.
     * @throws PropertyException if there an error occurred when getting the property
     */
    public Property getNearestSpecified(int propId) throws PropertyException {
        Property p = null;
        PropertyList pList = parentPropertyList;
       
        while (pList != null) {
            p = pList.getExplicit(propId);
            if (p != null) {
View Full Code Here

                        + ". Ignoring property.");
                return;
            }

            try {
                Property prop = null;
                if (subPropertyName == null) { // base attribute only found
                    /* Do nothing if the base property has already been created.
                     * This is e.g. the case when a compound attribute was
                     * specified before the base attribute; in these cases
                     * the base attribute was already created in
                     * findBaseProperty()
                     */
                    if (getExplicit(propId) != null) {
                        return;
                    }
                    prop = propertyMaker.make(this, attributeValue, parentFO);
                } else { // e.g. "leader-length.maximum"
                    Property baseProperty =
                        findBaseProperty(attributes, parentFO, propId,
                                basePropertyName, propertyMaker);
                    prop = propertyMaker.make(baseProperty, subpropId,
                            this, attributeValue, parentFO);
                }
View Full Code Here

TOP

Related Classes of org.apache.fop.fo.properties.Property

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.