Package com.lowagie.text

Examples of com.lowagie.text.List


                        addLine(line);
                        line = new PdfLine(left + item.getIndentationLeft(), right, alignment, leading);
                    }
                    break;
                case LwgElement.LIST:
                    List sublist = (List)ele;
                    addList(sublist, left + sublist.getIndentationLeft(), right, alignment);
                    break;
            }
        }
    }
View Full Code Here


                writeSection((Section) element, indent);
                return;
            }
            case Element.LIST:
            {
                List list = (List) element;
                // start tag
                addTabs(indent);
                if (list.isNumbered()) {
                    writeStart(HtmlTags.ORDEREDLIST);
                }
                else {
                    writeStart(HtmlTags.UNORDEREDLIST);
                }
                writeMarkupAttributes(markup);
                os.write(GT);
                // contents
                for (Iterator i = list.getItems().iterator(); i.hasNext(); ) {
                    write((Element) i.next(), indent + 1);
                }
                // end tag
                addTabs(indent);
                if (list.isNumbered()) {
                    writeEnd(HtmlTags.ORDEREDLIST);
                }
                else {
                    writeEnd(HtmlTags.UNORDEREDLIST);
                }
View Full Code Here

            }

            // listitems
            if (ElementTags.LISTITEM.equals(name)) {
                ListItem listItem = (ListItem) stack.pop();
                List list = (List) stack.pop();
                list.add(listItem);
                stack.push(list);
            }

            // tables
            if (ElementTags.TABLE.equals(name)) {
View Full Code Here

      // dealing with area's'option
      Collection<OptionData> options = area.getOptions();
      Iterator<OptionData> iOptions = options.iterator();

      // create an itemize
      List itemize = new List(false,20);
      Paragraph optionsPar = new Paragraph("OPTIONS",fntRomanOption);
      optionsPar.setSpacingAfter(12);
      doc.add(optionsPar);


      // create the table for actor/option wedges

      // rows
      int actorsNumber = data.getColumns().size();
      // columns
      int optionsNumber = options.size();

      Iterator<ColumnData> iActors = data.getColumns().iterator();
      Table table = new Table(optionsNumber+1, actorsNumber+1);
      table.setWidth(100);
      table.setBorderWidth(1);
      //table.setBorderColor(new Color(0, 0, 255));
      table.setPadding(4);
      table.setSpacing(0);

      // first cell has to be void
      table.addCell(new Cell("Options/\r\nWedges"),0,0);

      int row = 1;
      while (iActors.hasNext()){
    Cell app = new Cell(iActors.next().getTitle());
    //app.setNoWrap(true);
    app.setHorizontalAlignment(Element.ALIGN_CENTER);
    app.setVerticalAlignment(Element.ALIGN_CENTER);
    table.addCell(app,row++,0);
      }

      row = 1;
      int column = 1;

      while (iOptions.hasNext()){
    // working with a single option
    OptionData o = iOptions.next();

    String optionName = o.getTitle();
    if ((optionName==null)||(optionName.length()==0)) optionName = "No (Option) name provided.";
    //Paragraph optionNamePar = new Paragraph(optionName, fntRomanOptionTitle);
    Paragraph optionNamePar = new Paragraph(optionName, fntRomanOptionTitle);
    ListItem item = new ListItem(optionNamePar);

    String optionDescription = o.getDescription();
    if ((optionDescription!=null)&&(optionDescription.length()!=0)) {
        //Paragraph optionDescriptionPar = new Paragraph("\r\n" + optionDescription, fntRomanOptionDescription);
        Paragraph optionDescriptionPar = new Paragraph("\r\n" + optionDescription, fntRomanOptionDescription);
        optionDescriptionPar.setSpacingAfter(12);
        //optionDescriptionPar.setSpacingBefore(0);
        item.add(optionDescriptionPar);
    }

    itemize.add(item);

    // prepare the table
    iActors = data.getColumns().iterator();
    row = 0;
    //System.out.println("option: " + o.getTitle());
View Full Code Here

   * Creates a List object based on a list of properties.
   * @param attributes
   * @return the List
   */
  public static List getList(Properties attributes) {
    List list = new List();

    list.setNumbered(Utilities.checkTrueOrFalse(attributes,
        ElementTags.NUMBERED));
    list.setLettered(Utilities.checkTrueOrFalse(attributes,
        ElementTags.LETTERED));
    list.setLowercase(Utilities.checkTrueOrFalse(attributes,
        ElementTags.LOWERCASE));
    list.setAutoindent(Utilities.checkTrueOrFalse(attributes,
        ElementTags.AUTO_INDENT_ITEMS));
    list.setAlignindent(Utilities.checkTrueOrFalse(attributes,
        ElementTags.ALIGN_INDENTATION_ITEMS));

    String value;

    value = attributes.getProperty(ElementTags.FIRST);
    if (value != null) {
      char character = value.charAt(0);
      if (Character.isLetter(character)) {
        list.setFirst(character);
      } else {
        list.setFirst(Integer.parseInt(value));
      }
    }

    value = attributes.getProperty(ElementTags.LISTSYMBOL);
    if (value != null) {
      list
          .setListSymbol(new Chunk(value, FontFactory
              .getFont(attributes)));
    }

    value = attributes.getProperty(ElementTags.INDENTATIONLEFT);
    if (value != null) {
      list.setIndentationLeft(Float.parseFloat(value + "f"));
    }

    value = attributes.getProperty(ElementTags.INDENTATIONRIGHT);
    if (value != null) {
      list.setIndentationRight(Float.parseFloat(value + "f"));
    }

    value = attributes.getProperty(ElementTags.SYMBOLINDENT);
    if (value != null) {
      list.setSymbolIndent(Float.parseFloat(value));
    }

    return list;
  }
View Full Code Here

                        addLine(line);
                        line = new PdfLine(left + item.getIndentationLeft(), right, alignment, leading);
                    }
                    break;
                case Element.LIST:
                    List sublist = (List)ele;
                    addList(sublist, left + sublist.getIndentationLeft(), right, alignment);
                    break;
            }
        }
    }
View Full Code Here

                    break;
                }
                case Element.LIST: {
                    // we cast the element to a List
                    List list = (List) element;
                    if (list.isAlignindent()) {
                      list.normalizeIndentation();
                    }
                    // we adjust the document
                    indentation.listIndentLeft += list.getIndentationLeft();
                    indentation.indentRight += list.getIndentationRight();
                    // we process the items in the list
                    element.process(this);
                    // some parameters are set back to normal again
                    indentation.listIndentLeft -= list.getIndentationLeft();
                    indentation.indentRight -= list.getIndentationRight();
                    carriageReturn();
                    break;
                }
                case Element.LISTITEM: {
                  leadingCount++;
View Full Code Here

                        addLine(line);
                        line = new PdfLine(left + item.getIndentationLeft(), right, alignment, leading);
                    }
                    break;
                case Element.LIST:
                    List sublist = (List)ele;
                    addList(sublist, left + sublist.getIndentationLeft(), right, alignment);
                    break;
            }
        }
    }
View Full Code Here

            }

            // listitems
            if (ElementTags.LISTITEM.equals(name)) {
                ListItem listItem = (ListItem) stack.pop();
                List list = (List) stack.pop();
                list.add(listItem);
                stack.push(list);
            }

            // tables
            if (ElementTags.TABLE.equals(name)) {
View Full Code Here

   * Creates a List object based on a list of properties.
   * @param attributes
   * @return the List
   */
  public static List getList(Properties attributes) {
    List list = new List();

    list.setNumbered(Utilities.checkTrueOrFalse(attributes, ElementTags.NUMBERED));
    list.setLettered(Utilities.checkTrueOrFalse(attributes, ElementTags.LETTERED));
    list.setLowercase(Utilities.checkTrueOrFalse(attributes, ElementTags.LOWERCASE));
    list.setAutoindent(Utilities.checkTrueOrFalse(attributes, ElementTags.AUTO_INDENT_ITEMS));
    list.setAlignindent(Utilities.checkTrueOrFalse(attributes, ElementTags.ALIGN_INDENTATION_ITEMS));
   
    String value;
   
        value = attributes.getProperty(ElementTags.FIRST);
        if (value != null) {
            char character = value.charAt(0);
            if (Character.isLetter(character) ) {
                list.setFirst(character);
            }
            else {
                list.setFirst(Integer.parseInt(value));
            }
        }
       
    value= attributes.getProperty(ElementTags.LISTSYMBOL);
    if (value != null) {
      list.setListSymbol(new Chunk(value, FontFactory.getFont(attributes)));
    }
       
        value = attributes.getProperty(ElementTags.INDENTATIONLEFT);
        if (value != null) {
            list.setIndentationLeft(Float.parseFloat(value + "f"));
        }
       
        value = attributes.getProperty(ElementTags.INDENTATIONRIGHT);
        if (value != null) {
            list.setIndentationRight(Float.parseFloat(value + "f"));
        }
       
        value = attributes.getProperty(ElementTags.SYMBOLINDENT);
        if (value != null) {
            list.setSymbolIndent(Float.parseFloat(value));
        }
       
    return list;
  }
View Full Code Here

TOP

Related Classes of com.lowagie.text.List

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.