Package org.apache.fop.datatypes

Examples of org.apache.fop.datatypes.PercentBase


             * Get the length base value object from the Maker. If null, then
             * this property can't have % values. Treat it as a real number.
             */
            double pcval = new Double(currentTokenValue.substring(0,
                        currentTokenValue.length() - 1)).doubleValue() / 100.0;
            PercentBase pcBase = this.propInfo.getPercentBase();
            if (pcBase != null) {
                if (pcBase.getDimension() == 0) {
                    prop = NumberProperty.getInstance(pcval * pcBase.getBaseValue());
                } else if (pcBase.getDimension() == 1) {
                    prop = new PercentLength(pcval, pcBase);
                } else {
                    throw new PropertyException("Illegal percent dimension value");
                }
            } else {
View Full Code Here


     * a percent specification.
     * Propagates to the Maker.
     * @return The PercentBase object or null if percentLengthOK()=false.
     */
    public PercentBase getPercentBase() throws PropertyException {
        PercentBase pcbase = getFunctionPercentBase();
        return (pcbase != null) ? pcbase : maker.getPercentBase(plist);
    }
View Full Code Here

    // Check of same dimension
    // Add together absolute and table units
    // What about percentages??? Treat as colUnits if they can't be
    // in same property!
    if (dim == op.dim) {
      PercentBase npcBase = ((valType & PC_LENGTH)!=0)? pcBase : op.pcBase;
      // Subtract each type of value
      return new Numeric(valType|op.valType, absValue-op.absValue,
       pcValue-op.pcValue,
       tcolValue-op.tcolValue,dim, npcBase);
    }
View Full Code Here

    // Check of same dimension
    // Add together absolute and table units
    // What about percentages??? Treat as colUnits if they can't be
    // in same property!
    if (dim == op.dim) {
      PercentBase npcBase = ((valType & PC_LENGTH)!=0)? pcBase : op.pcBase;
      // Add each type of value
      return new Numeric(valType | op.valType, absValue+op.absValue,
       pcValue+op.pcValue,
       tcolValue+op.tcolValue, dim, npcBase);
    }
View Full Code Here

      return new Numeric(valType, opval*absValue,
       opval*pcValue, opval*tcolValue, dim, pcBase);
    }
    else if (valType == op.valType && !isMixedType()) {
      // Check same relbase and pcbase ???
      PercentBase npcBase = ((valType & PC_LENGTH)!=0)? pcBase : op.pcBase;
      return new Numeric(valType, absValue * op.absValue,
       pcValue*op.pcValue,
       tcolValue*op.tcolValue,dim+op.dim,
       npcBase);
    }
View Full Code Here

      double opval = op.absValue;
      return new Numeric(valType, absValue/opval,
       pcValue/opval, tcolValue/opval, dim, pcBase);
    }
    else if (valType == op.valType && !isMixedType()) {
      PercentBase npcBase = ((valType & PC_LENGTH)!=0)? pcBase : op.pcBase;
      return new Numeric(valType,
       (valType==ABS_LENGTH? absValue/op.absValue:0.0),
       (valType==PC_LENGTH? pcValue/op.pcValue:0.0),
       (valType==TCOL_LENGTH? tcolValue/op.tcolValue:0.0),
       dim-op.dim, npcBase);
View Full Code Here

     * a percent specification.
     * Propagates to the Maker.
     * @return The PercentBase object or null if percentLengthOK()=false.
     */
    public PercentBase getPercentBase() {
        PercentBase pcbase = getFunctionPercentBase();
        return (pcbase != null) ? pcbase : maker.getPercentBase(fo, plist);
    }
View Full Code Here

        // Check of same dimension
        // Add together absolute and table units
        // What about percentages??? Treat as colUnits if they can't be
        // in same property!
        if (dim == op.dim) {
            PercentBase npcBase = ((valType & PC_LENGTH) != 0) ? pcBase
                                  : op.pcBase;
            // Subtract each type of value
            return new Numeric(valType | op.valType, absValue - op.absValue,
                               pcValue - op.pcValue,
                               tcolValue - op.tcolValue, dim, npcBase);
View Full Code Here

        // Check of same dimension
        // Add together absolute and table units
        // What about percentages??? Treat as colUnits if they can't be
        // in same property!
        if (dim == op.dim) {
            PercentBase npcBase = ((valType & PC_LENGTH) != 0) ? pcBase
                                  : op.pcBase;
            // Add each type of value
            return new Numeric(valType | op.valType, absValue + op.absValue,
                               pcValue + op.pcValue,
                               tcolValue + op.tcolValue, dim, npcBase);
View Full Code Here

            double opval = op.absValue;
            return new Numeric(valType, opval * absValue, opval * pcValue,
                               opval * tcolValue, dim, pcBase);
        } else if (valType == op.valType &&!isMixedType()) {
            // Check same relbase and pcbase ???
            PercentBase npcBase = ((valType & PC_LENGTH) != 0) ? pcBase
                                  : op.pcBase;
            return new Numeric(valType, absValue * op.absValue,
                               pcValue * op.pcValue,
                               tcolValue * op.tcolValue, dim + op.dim,
                               npcBase);
View Full Code Here

TOP

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

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.