Package org.apache.fop.fo

Examples of org.apache.fop.fo.LengthProperty$Maker


      if (pcBase != null) {
  if (pcBase.getDimension() == 0) {
    prop = new NumberProperty(pcval * pcBase.getBaseValue());
  }
  else if (pcBase.getDimension() == 1) {
    prop = new LengthProperty(new PercentLength(pcval, pcBase));
  }
  else {
  throw new PropertyException("Illegal percent dimension value");
  }
      }
      else {
  // WARNING? Interpret as a decimal fraction, eg. 50% = .5
  prop = new NumberProperty(pcval);
      }
      break;

    case TOK_NUMERIC:
      // A number plus a valid unit name.
      int numLen = currentTokenValue.length()-currentUnitLength;
      String unitPart = currentTokenValue.substring(numLen);
      Double numPart = new Double(currentTokenValue.substring(0,numLen));
      Length length= null;
      if (unitPart.equals(RELUNIT)) {
    length = new Length(numPart.doubleValue(),
            propInfo.currentFontSize());
      }
      else
  length = new Length(numPart.doubleValue(), unitPart);
      if (length == null) {
  throw new PropertyException("unrecognized unit name: "+ currentTokenValue);
      }
      else prop = new LengthProperty(length);
      break;

    case TOK_COLORSPEC:
      prop = new ColorTypeProperty(new ColorType(currentTokenValue));
      break;
View Full Code Here


            PercentBase pcBase = this.propInfo.getPercentBase();
            if (pcBase != null) {
                if (pcBase.getDimension() == 0) {
                    prop = new NumberProperty(pcval * pcBase.getBaseValue());
                } else if (pcBase.getDimension() == 1) {
                    prop = new LengthProperty(new PercentLength(pcval,
                                                                pcBase));
                } else {
                    throw new PropertyException("Illegal percent dimension value");
                }
            } else {
                // WARNING? Interpret as a decimal fraction, eg. 50% = .5
                prop = new NumberProperty(pcval);
            }
            break;

        case TOK_NUMERIC:
            // A number plus a valid unit name.
            int numLen = currentTokenValue.length() - currentUnitLength;
            String unitPart = currentTokenValue.substring(numLen);
            Double numPart = new Double(currentTokenValue.substring(0,
                    numLen));
            Length length = null;
            if (unitPart.equals(RELUNIT)) {
                length = new Length(numPart.doubleValue(),
                                    propInfo.currentFontSize());
            } else
                length = new Length(numPart.doubleValue(), unitPart);
            if (length == null) {
                throw new PropertyException("unrecognized unit name: "
                                            + currentTokenValue);
            } else
                prop = new LengthProperty(length);
            break;

        case TOK_COLORSPEC:
            prop = new ColorTypeProperty(new ColorType(currentTokenValue));
            break;
View Full Code Here

        labelEnd.addTerm(1.0, refWidth);
        labelEnd.addTerm(-1.0, distance);
        labelEnd.addTerm(-1.0, startIndent);
        labelEnd.addTerm(1.0, separation);

        return new LengthProperty(labelEnd);
    }
View Full Code Here

        }
        if (!pInfo.getPropertyList().getElement().equals("table-column")) {
            throw new PropertyException("proportional-column-width function may only be used on table-column FO");
        }
        // Check if table-layout is "fixed"...
        return new LengthProperty(new TableColLength(d.doubleValue()));
    }
View Full Code Here

        labelEnd.addTerm(1.0, refWidth);
        labelEnd.addTerm(-1.0, distance);
        labelEnd.addTerm(-1.0, startIndent);
        labelEnd.addTerm(1.0, separation);

        return new LengthProperty(labelEnd);
    }
View Full Code Here

        }
        if (!pInfo.getPropertyList().getElement().equals("table-column")) {
            throw new PropertyException("proportional-column-width function may only be used on table-column FO");
        }
        // Check if table-layout is "fixed"...
        return new LengthProperty(new TableColLength(d.doubleValue()));
    }
View Full Code Here

            PercentBase pcBase = this.propInfo.getPercentBase();
            if (pcBase != null) {
                if (pcBase.getDimension() == 0) {
                    prop = new NumberProperty(pcval * pcBase.getBaseValue());
                } else if (pcBase.getDimension() == 1) {
                    prop = new LengthProperty(new PercentLength(pcval,
                                                                pcBase));
                } else {
                    throw new PropertyException("Illegal percent dimension value");
                }
            } else {
                // WARNING? Interpret as a decimal fraction, eg. 50% = .5
                prop = new NumberProperty(pcval);
            }
            break;

        case TOK_NUMERIC:
            // A number plus a valid unit name.
            int numLen = currentTokenValue.length() - currentUnitLength;
            String unitPart = currentTokenValue.substring(numLen);
            Double numPart = new Double(currentTokenValue.substring(0,
                    numLen));
            Length length = null;
            if (unitPart.equals(RELUNIT)) {
                length = new FixedLength(numPart.doubleValue(),
                                    propInfo.currentFontSize());
            } else
                length = new FixedLength(numPart.doubleValue(), unitPart);
            if (length == null) {
                throw new PropertyException("unrecognized unit name: "
                                            + currentTokenValue);
            } else
                prop = new LengthProperty(length);
            break;

        case TOK_COLORSPEC:
            prop = new ColorTypeProperty(new ColorType(currentTokenValue));
            break;
View Full Code Here

  labelEnd.addTerm(1.0, refWidth);
  labelEnd.addTerm(-1.0, distance);
  labelEnd.addTerm(-1.0, startIndent);
  labelEnd.addTerm(1.0, separation);

  return new LengthProperty(labelEnd);
    }
View Full Code Here

    }
    if (!pInfo.getPropertyList().getElement().equals("table-column")) {
      throw new PropertyException("proportional-column-width function may only be used on table-column FO");
    }
    // Check if table-layout is "fixed"...
    return new LengthProperty(new TableColLength(d.doubleValue()));
  }
View Full Code Here

      if (pcBase != null) {
  if (pcBase.getDimension() == 0) {
    prop = new NumberProperty(pcval * pcBase.getBaseValue());
  }
  else if (pcBase.getDimension() == 1) {
    prop = new LengthProperty(new PercentLength(pcval, pcBase));
  }
  else {
  throw new PropertyException("Illegal percent dimension value");
  }
      }
      else {
  // WARNING? Interpret as a decimal fraction, eg. 50% = .5
  prop = new NumberProperty(pcval);
      }
      break;

    case TOK_NUMERIC:
      // A number plus a valid unit name.
      int numLen = currentTokenValue.length()-currentUnitLength;
      String unitPart = currentTokenValue.substring(numLen);
      Double numPart = new Double(currentTokenValue.substring(0,numLen));
      Length length= null;
      if (unitPart.equals(RELUNIT)) {
    length = new Length(numPart.doubleValue(),
            propInfo.currentFontSize());
      }
      else
  length = new Length(numPart.doubleValue(), unitPart);
      if (length == null) {
  throw new PropertyException("unrecognized unit name: "+ currentTokenValue);
      }
      else prop = new LengthProperty(length);
      break;

    case TOK_COLORSPEC:
      prop = new ColorTypeProperty(new ColorType(currentTokenValue));
      break;
View Full Code Here

TOP

Related Classes of org.apache.fop.fo.LengthProperty$Maker

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.