Package org.apache.fop.fo.properties

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


        /* If the baseProperty has already been created, return it
         * e.g. <fo:leader xxxx="120pt" xxxx.maximum="200pt"... />
         */

        Property baseProperty = getExplicit(propId);

        if (baseProperty != null) {
            return baseProperty;
        }

View Full Code Here


         *
         * @see org.apache.fop.fo.properties.PropertyMaker#make(PropertyList, String, FObj)
         */
        public Property make(PropertyList propertyList, String value, FObj fo)
                    throws PropertyException {
            Property p = super.make(propertyList, value, fo);

            ColumnNumberManagerHolder parent
                    = (ColumnNumberManagerHolder) propertyList.getParentFObj();
            ColumnNumberManager columnIndexManager =  parent.getColumnNumberManager();
            int columnIndex = p.getNumeric().getValue();
            if (columnIndex <= 0) {
                log.warn("Specified negative or zero value for "
                        + "column-number on " + fo.getName() + ": "
                        + columnIndex + " forced to "
                        + columnIndexManager.getCurrentColumnNumber());
                return NumberProperty.getInstance(columnIndexManager.getCurrentColumnNumber());
            } else {
                double tmpIndex = p.getNumeric().getNumericValue();
                if (tmpIndex - columnIndex > 0.0) {
                    columnIndex = (int) Math.round(tmpIndex);
                    log.warn("Rounding specified column-number of "
                            + tmpIndex + " to " + columnIndex);
                    p = NumberProperty.getInstance(columnIndex);
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.notifyAssertionFailure("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

            // if prop value is empty string, force to StringProperty
            return StringProperty.getInstance("");
        }
        ListProperty propList = null;
        while (true) {
            Property prop = parseAdditiveExpr();
            if (currentToken == TOK_EOF) {
                if (propList != null) {
                    propList.addProperty(prop);
                    return propList;
                } else {
View Full Code Here

     * Try to parse an addition or subtraction expression and return the
     * resulting Property.
     */
    private Property parseAdditiveExpr() throws PropertyException {
        // Evaluate and put result on the operand stack
        Property prop = parseMultiplicativeExpr();
        loop:
        while (true) {
            switch (currentToken) {
            case TOK_PLUS:
                next();
                prop = evalAddition(prop.getNumeric(),
                                    parseMultiplicativeExpr().getNumeric());
                break;
            case TOK_MINUS:
                next();
                prop = evalSubtraction(prop.getNumeric(),
                                    parseMultiplicativeExpr().getNumeric());
                break;
            default:
                break loop;
            }
View Full Code Here

    /**
     * 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

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.