Example #1
0
  /**
   * Returns a <CODE>List</CODE> that has been constructed taking in account the value of some
   * <VAR>attributes</VAR>.
   *
   * @param attributes Some attributes
   */
  public List(Properties attributes) {
    String value = (String) attributes.remove(ElementTags.LISTSYMBOL);
    if (value == null) {
      value = "-";
    }
    symbol = new Chunk(value, FontFactory.getFont(attributes));

    if ((value = (String) attributes.remove(ElementTags.NUMBERED)) != null) {
      this.numbered = Boolean.valueOf(value).booleanValue();
    }
    if ((value = (String) attributes.remove(ElementTags.LETTERED)) != null) {
      this.lettered = Boolean.valueOf(value).booleanValue();
      if (this.numbered && this.lettered) this.numbered = false;
    }
    if ((value = (String) attributes.remove(ElementTags.SYMBOLINDENT)) != null) {
      this.symbolIndent = Float.parseFloat(value);
    }

    if ((value = (String) attributes.remove(ElementTags.FIRST)) != null) {
      char khar = value.charAt(0);
      if (Character.isLetter(khar)) {
        setFirst(khar);
      } else {
        setFirst(Integer.parseInt(value));
      }
    }
    if ((value = (String) attributes.remove(ElementTags.INDENTATIONLEFT)) != null) {
      setIndentationLeft(Float.parseFloat(value + "f"));
    }
    if ((value = (String) attributes.remove(ElementTags.INDENTATIONRIGHT)) != null) {
      setIndentationRight(Float.parseFloat(value + "f"));
    }
    if (attributes.size() > 0) setMarkupAttributes(attributes);
  }