Examples of Numeric


Examples of org.apache.fop.datatypes.Numeric

        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

Examples of org.apache.fop.datatypes.Numeric

        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

Examples of org.apache.fop.datatypes.Numeric

            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

Examples of org.apache.fop.datatypes.Numeric

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

Examples of org.apache.fop.datatypes.Numeric

        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

Examples of org.apache.fop.datatypes.Numeric

        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 = 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

Examples of org.apache.fop.datatypes.Numeric

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

Examples of org.apache.fop.datatypes.Numeric

     * {@inheritDoc}
     */
    public Property convertProperty(Property p,
            PropertyList propertyList,
            FObj fo) throws PropertyException {
        Numeric numval = p.getNumeric();
        if (numval != null && numval.getDimension() == 0) {
            if (getPercentBase(propertyList) instanceof LengthBase) {
                Length base = ((LengthBase)getPercentBase(propertyList)).getBaseLength();
                if (base != null && base.isAbsolute()) {
                    p = FixedLength.getInstance(
                            numval.getNumericValue() * base.getNumericValue());
                } else {
                    p = new PercentLength(
                            numval.getNumericValue(), getPercentBase(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

Examples of org.apache.fop.datatypes.Numeric

     * @return the absolute value of the input
     * @throws PropertyException for non-numeric input
     */
    public Property eval(Property[] args,
                         PropertyInfo propInfo) throws PropertyException {
        Numeric num = args[0].getNumeric();
        if (num == null) {
            throw new PropertyException("Non numeric operand to abs function");
        }
        // TODO: What if it has relative components (percent, table-col units)?
        return (Property) NumericOp.abs(num);
View Full Code Here

Examples of org.apache.fop.fo.expr.Numeric

  **/

  public Object getObject() { return this.number; }

  public Numeric getNumeric() {
    return new Numeric(this.number);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.