Package com.lowagie.text

Examples of com.lowagie.text.List


                    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

        return table;
    }

    public static List createContents(java.util.List<DrlRuleParser> rules) {
        List index = new List( true );

        for ( DrlRuleParser drlRuleData : rules ) {
            Chunk chunk = new Chunk( drlRuleData.getName() );
            // chunk.setLocalGoto( item.getName() );
            ListItem listItem = new ListItem( chunk );
            index.add( listItem );
        }

        return index;
    }
View Full Code Here

        return table;
    }

    public static List createContents(java.util.List<DrlRuleParser> rules) {
        List index = new List( true );

        for ( DrlRuleParser drlRuleData : rules ) {
            Chunk chunk = new Chunk( drlRuleData.getName() );
            // chunk.setLocalGoto( item.getName() );
            ListItem listItem = new ListItem( chunk );
            index.add( listItem );
        }

        return index;
    }
View Full Code Here

                writeSection((Section) element, indent);
                return;
            }
            case LwgElement.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((LwgElement) 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

            Chunk c = new Chunk("");
            c.setNewPage();
            doc.add(c);

            List subList = new List(true, 40);
            subList.add(new ListItem("Sub list 1"));
            subList.add(new ListItem("Sub list 2"));

            List list = new List(true, 20);
            list.add(new ListItem("Test line 1"));
            list
                    .add(new ListItem(
                            "Test line 2 - This is a really long test line to test that linebreaks are working the way they are supposed to work so a really really long line of drivel is required"));
            list.add(subList);
            list.add(new ListItem("Test line 3 - \t\u20ac\t 60,-"));
            doc.add(list);

            list = new List(false, 20);
            list.add(new ListItem("Bullet"));
            list.add(new ListItem("Another one"));
            doc.add(list);

            doc.newPage();

            Chapter chapter = new Chapter(new Paragraph("This is a Chapter"), 1);
View Full Code Here

           
            // step 3: we open the document
            document.open();
           
            // step 4:
            List list = new List(true, 20);
            list.add(new ListItem("First line"));
            list.add(new ListItem("The second line is longer to see what happens once the end of the line is reached. Will it start on a new line?"));
            list.add(new ListItem("Third line"));
            document.add(list);
           
            document.add(new Paragraph("some books I really like:"));
            ListItem listItem;
            list = new List(true, 15);
            listItem = new ListItem("When Harlie was one", FontFactory.getFont(FontFactory.TIMES_ROMAN, 12));
            listItem.add(new Chunk(" by David Gerrold", FontFactory.getFont(FontFactory.TIMES_ROMAN, 11, LwgFont.ITALIC)));
            list.add(listItem);
            listItem = new ListItem("The World according to Garp", FontFactory.getFont(FontFactory.TIMES_ROMAN, 12));
            listItem.add(new Chunk(" by John Irving", FontFactory.getFont(FontFactory.TIMES_ROMAN, 11, LwgFont.ITALIC)));
            list.add(listItem);
            listItem = new ListItem("Decamerone", FontFactory.getFont(FontFactory.TIMES_ROMAN, 12));
            listItem.add(new Chunk(" by Giovanni Boccaccio", FontFactory.getFont(FontFactory.TIMES_ROMAN, 11, LwgFont.ITALIC)));
            list.add(listItem);
            document.add(list);
           
            Paragraph paragraph = new Paragraph("some movies I really like:");
            list = new List(false, 10);
            list.add("Wild At Heart");
            list.add("Casablanca");
            list.add("When Harry met Sally");
            list.add("True Romance");
            list.add("Le mari de la coiffeuse");
            paragraph.add(list);
            document.add(paragraph);
           
            document.add(new Paragraph("Some authors I really like:"));
            list = new List(false, 20);
            list.setListSymbol(new Chunk("\u2022", FontFactory.getFont(FontFactory.HELVETICA, 20, LwgFont.BOLD)));
            listItem = new ListItem("Isaac Asimov");
            list.add(listItem);
            List sublist;
            sublist = new List(false, true, 10);
            sublist.setListSymbol(new Chunk("", FontFactory.getFont(FontFactory.HELVETICA, 8)));
            sublist.add("The Foundation Trilogy");
            sublist.add("The Complete Robot");
            sublist.add("Caves of Steel");
            sublist.add("The Naked Sun");
            list.add(sublist);
            listItem = new ListItem("John Irving");
            list.add(listItem);
            sublist = new List(false, true, 10);
            sublist.setFirst('a');
            sublist.setListSymbol(new Chunk("", FontFactory.getFont(FontFactory.HELVETICA, 8)));
            sublist.add("The World according to Garp");
            sublist.add("Hotel New Hampshire");
            sublist.add("A prayer for Owen Meany");
            sublist.add("Widow for a year");
            list.add(sublist);
            listItem = new ListItem("Kurt Vonnegut");
            list.add(listItem);
            sublist = new List(false, true, 10);
            sublist.setListSymbol(new Chunk("", FontFactory.getFont(FontFactory.HELVETICA, 8)));
            sublist.add("Slaughterhouse 5");
            sublist.add("Welcome to the Monkey House");
            sublist.add("The great pianola");
            sublist.add("Galapagos");
            list.add(sublist);
            document.add(list);
    } catch (DocumentException de) {
      System.err.println(de.getMessage());
    } catch (IOException ioe) {
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

                    break;
                }
                case LwgElement.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 LwgElement.LISTITEM: {
                  leadingCount++;
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.