Package org.apache.fop.datatypes

Examples of org.apache.fop.datatypes.Numeric


        LengthBase base = new LengthBase(pInfo.getPropertyList(),
                                         LengthBase.CONTAINING_REFAREA_WIDTH);
        PercentLength refWidth = new PercentLength(1.0, base);

        Numeric labelEnd = distance;
        labelEnd = NumericOp.addition(labelEnd, startIndent);
        //TODO add start-intrusion-adjustment
        labelEnd = NumericOp.subtraction(labelEnd, separation);

        labelEnd = NumericOp.subtraction(refWidth, labelEnd);
View Full Code Here


        return 2;
    }

    /** {@inheritDoc} */
    public Property eval(Property[] args, PropertyInfo pInfo) throws PropertyException {
        Numeric n1 = args[0].getNumeric();
        Numeric n2 = args[1].getNumeric();
        if (n1 == null || n2 == null) {
            throw new PropertyException("Non numeric operands to max function");
        }
        return (Property) NumericOp.max(n1, n2);
    }
View Full Code Here

        if (pList == null) {
            return null;
        }
        // Calculate the values as described in 5.3.2.

        Numeric padding = getCorresponding(paddingCorresponding, propertyList).getNumeric();
        Numeric border = getCorresponding(borderWidthCorresponding, propertyList).getNumeric();

        int marginProp = pList.selectFromWritingMode(lrtb, rltb, tbrl, tblr);
        // Calculate the absolute margin.
        if (propertyList.getExplicitOrShorthand(marginProp) == null) {
            Property indent = propertyList.getExplicit(baseMaker.propId);
            if (indent == null) {
                //Neither indent nor margin is specified, use inherited
                return null;
            } else {
                //Use explicit indent directly
                return indent;
            }
        } else {
            //Margin is used
            Numeric margin = propertyList.get(marginProp).getNumeric();

            Numeric v = FixedLength.ZERO_FIXED_LENGTH;
            if (!propertyList.getFObj().generatesReferenceAreas()) {
                // The inherited_value_of([start|end]-indent)
                v = NumericOp.addition(v, propertyList.getInherited(baseMaker.propId).getNumeric());
            }
            // The corresponding absolute margin-[right|left}.
View Full Code Here

            return null;
        }

        // Calculate the values as described in 5.3.2.

        Numeric padding = getCorresponding(paddingCorresponding, propertyList).getNumeric();
        Numeric border = getCorresponding(borderWidthCorresponding, propertyList).getNumeric();

        int marginProp = pList.selectFromWritingMode(lrtb, rltb, tbrl, tblr);

        //Determine whether the nearest anscestor indent was specified through
        //start-indent|end-indent or through a margin property.
        boolean marginNearest = false;
        PropertyList pl = propertyList.getParentPropertyList();
        while (pl != null) {
            if (pl.getExplicit(baseMaker.propId) != null) {
                break;
            } else if (pl.getExplicitOrShorthand(marginProp) != null) {
                marginNearest = true;
                break;
            }
            pl = pl.getParentPropertyList();
        }

        // Calculate the absolute margin.
        if (propertyList.getExplicitOrShorthand(marginProp) == null) {
            Property indent = propertyList.getExplicit(baseMaker.propId);
            if (indent == null) {
                //Neither start-indent nor margin is specified, use inherited
                if (isInherited(propertyList) || !marginNearest) {
                    return null;
                } else {
                    return FixedLength.ZERO_FIXED_LENGTH;
                }
            } else {
                return indent;
            }
        } else {
            //Margin is used
            Numeric margin = propertyList.get(marginProp).getNumeric();

            Numeric v = FixedLength.ZERO_FIXED_LENGTH;
            if (isInherited(propertyList)) {
                // The inherited_value_of([start|end]-indent)
                v = NumericOp.addition(v, propertyList.getInherited(baseMaker.propId).getNumeric());
            }
            // The corresponding absolute margin-[right|left}.
View Full Code Here

            = (EnumProperty) pList.get(Constants.PR_FONT_SELECTION_STRATEGY);
        EnumProperty fontStretch = (EnumProperty) pList.get(Constants.PR_FONT_STRETCH);
        EnumProperty fontStyle = (EnumProperty) pList.get(Constants.PR_FONT_STYLE);
        EnumProperty fontVariant = (EnumProperty) pList.get(Constants.PR_FONT_VARIANT);
        EnumProperty fontWeight = (EnumProperty) pList.get(Constants.PR_FONT_WEIGHT);
        Numeric fontSizeAdjust = pList.get(Constants.PR_FONT_SIZE_ADJUST).getNumeric();
        Length fontSize = pList.get(Constants.PR_FONT_SIZE).getLength();

        CommonFont commonFont = new CommonFont(fontFamily,
                                               fontSelectionStrategy,
                                               fontStretch,
View Full Code Here

        LengthBase base = new LengthBase(pList.getFObj(), pInfo.getPropertyList(),
                                         LengthBase.CONTAINING_REFAREA_WIDTH);
        PercentLength refWidth = new PercentLength(1.0, base);

        Numeric labelEnd = distance;
        labelEnd = NumericOp.addition(labelEnd, startIndent);
        //TODO add start-intrusion-adjustment
        labelEnd = NumericOp.subtraction(labelEnd, separation);
       
        labelEnd = NumericOp.subtraction(refWidth, labelEnd);
View Full Code Here

        if (pList == null) {
            return null;
        }
        // Calculate the values as described in 5.3.2.

        Numeric padding = getCorresponding(paddingCorresponding, propertyList).getNumeric();
        Numeric border = getCorresponding(borderWidthCorresponding, propertyList).getNumeric();
       
        int marginProp = pList.getWritingMode(lr_tb, rl_tb, tb_rl);
        // Calculate the absolute margin.
        if (propertyList.getExplicitOrShorthand(marginProp) == null) {
            Property indent = propertyList.getExplicit(baseMaker.propId);
            if (indent == null) {
                //Neither indent nor margin is specified, use inherited
                return null;
            } else {
                //Use explicit indent directly
                return indent;
            }
        } else {
            //Margin is used
            Numeric margin = propertyList.get(marginProp).getNumeric();
           
            Numeric v = new FixedLength(0);
            if (!propertyList.getFObj().generatesReferenceAreas()) {
                // The inherited_value_of([start|end]-indent)
                v = NumericOp.addition(v, propertyList.getInherited(baseMaker.propId).getNumeric());
            }
            // The corresponding absolute margin-[right|left}.
View Full Code Here

            return null;
        }

        // Calculate the values as described in 5.3.2.

        Numeric padding = getCorresponding(paddingCorresponding, propertyList).getNumeric();
        Numeric border = getCorresponding(borderWidthCorresponding, propertyList).getNumeric();
       
        int marginProp = pList.getWritingMode(lr_tb, rl_tb, tb_rl);

        //Determine whether the nearest anscestor indent was specified through
        //start-indent|end-indent or through a margin property.
        boolean marginNearest = false;
        PropertyList pl = propertyList.getParentPropertyList();
        while (pl != null) {
            if (pl.getExplicit(baseMaker.propId) != null) {
                break;
            } else if (pl.getExplicitOrShorthand(marginProp) != null) {
                marginNearest = true;
                break;
            }
            pl = pl.getParentPropertyList();
        }
       
        // Calculate the absolute margin.
        if (propertyList.getExplicitOrShorthand(marginProp) == null) {
            Property indent = propertyList.getExplicit(baseMaker.propId);
            if (indent == null) {
                //Neither start-indent nor margin is specified, use inherited
                if (isInherited(propertyList) || !marginNearest) {
                    return null;
                } else {
                    return new FixedLength(0);
                }
            } else {
                return indent;
            }
        } else {
            //Margin is used
            Numeric margin = propertyList.get(marginProp).getNumeric();
           
            Numeric v = new FixedLength(0);
            if (isInherited(propertyList)) {
                // The inherited_value_of([start|end]-indent)
                v = NumericOp.addition(v, propertyList.getInherited(baseMaker.propId).getNumeric());
            }
            // The corresponding absolute margin-[right|left}.
View Full Code Here

     * @see SpaceProperty.Maker#convertProperty(Property, PropertyList, FObj)
     */
    public Property convertProperty(Property p,
            PropertyList propertyList,
            FObj fo) throws PropertyException {
        Numeric numval = p.getNumeric();
        if (numval != null && numval.getDimension() == 0) {
            p = new PercentLength(numval.getNumericValue(), getPercentBase(fo, propertyList));
            Property spaceProp = super.convertProperty(p, propertyList, fo);
            spaceProp.setSpecifiedValue(String.valueOf(numval.getNumericValue()));
            return spaceProp;
        }
        return super.convertProperty(p, propertyList, fo);
    }
View Full Code Here

        EnumProperty fontSelectionStrategy = (EnumProperty) pList.get(Constants.PR_FONT_SELECTION_STRATEGY);
        EnumProperty fontStretch = (EnumProperty) pList.get(Constants.PR_FONT_STRETCH);
        EnumProperty fontStyle = (EnumProperty) pList.get(Constants.PR_FONT_STYLE);
        EnumProperty fontVariant = (EnumProperty) pList.get(Constants.PR_FONT_VARIANT);
        EnumProperty fontWeight = (EnumProperty) pList.get(Constants.PR_FONT_WEIGHT);
        Numeric fontSizeAdjust = pList.get(Constants.PR_FONT_SIZE_ADJUST).getNumeric();
        Length fontSize = pList.get(Constants.PR_FONT_SIZE).getLength();

        CommonFont commonFont = new CommonFont(fontFamily,
                                               fontSelectionStrategy,
                                               fontStretch,
View Full Code Here

TOP

Related Classes of org.apache.fop.datatypes.Numeric

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.