Package com.lowagie.text

Examples of com.lowagie.text.LwgElement.type()


                int columns = 0;
                Table table;
                LwgCell cell;
                while (true) {
                    LwgElement element = (LwgElement) stack.pop();
                    if (element.type() == LwgElement.CELL) {
                        cell = (LwgCell) element;
                        columns += cell.getColspan();
                        cells.add(cell);
                    } else {
                        table = (Table) element;
View Full Code Here


            if(document.getAutogenerateTOCEntries()) {
                StringBuffer titleText = new StringBuffer();
                Iterator it = section.getTitle().iterator();
                while(it.hasNext()) {
                    LwgElement element = (LwgElement) it.next();
                    if(element.type() == LwgElement.CHUNK) {
                        titleText.append(((Chunk) element).getContent());
                    }
                }
                if(titleText.toString().trim().length() > 0) {
                    RtfTOCEntry tocEntry = new RtfTOCEntry(titleText.toString());
View Full Code Here

        // now setup the actual list contents.
        for(int i = 0; i < list.getItems().size(); i++) {
            try {
                LwgElement element = (LwgElement) list.getItems().get(i);
               
                if(element.type() == LwgElement.CHUNK) {
                    element = new ListItem((Chunk) element);
                }
                if(element instanceof ListItem) {
                    ll.setAlignment(((ListItem) element).getAlignment());
                }
View Full Code Here

        main_loop:
        while (true) {
            if (compositeElements.isEmpty())
                return NO_MORE_TEXT;
            LwgElement element = (LwgElement)compositeElements.getFirst();
            if (element.type() == LwgElement.PARAGRAPH) {
                Paragraph para = (Paragraph)element;
                int status = 0;
                for (int keep = 0; keep < 2; ++keep) {
                    float lastY = yLine;
                    boolean createHere = false;
View Full Code Here

                }
                if ((status & NO_MORE_COLUMN) != 0) {
                    return NO_MORE_COLUMN;
                }
            }
            else if (element.type() == LwgElement.LIST) {
                com.lowagie.text.List list = (com.lowagie.text.List)element;
                ArrayList items = list.getItems();
                ListItem item = null;
                float listIndentation = list.getIndentationLeft();
                int count = 0;
View Full Code Here

                    yLine -= item.getSpacingAfter();
                }
                if ((status & NO_MORE_COLUMN) != 0)
                    return NO_MORE_COLUMN;
            }
            else if (element.type() == LwgElement.PTABLE) {
              // don't write anything in the current column if there's no more space available
                if (yLine < minY || yLine > maxY)
                    return NO_MORE_COLUMN;
               
                // get the PdfPTable element
View Full Code Here

                    }
                    listIdx = k;
                    return NO_MORE_COLUMN;
                }
            }
            else if (element.type() == LwgElement.YMARK) {
                if (!simulate) {
                    DrawInterface zh = (DrawInterface)element;
                    zh.draw(canvas, leftX, minY, rightX, maxY, yLine);
                }
                compositeElements.removeFirst();
View Full Code Here

        ArrayList allActions;
        int aCounter;
        // we loop over all the elements of the cell
        for (Iterator i = cell.getElements(); i.hasNext();) {
            element = (LwgElement) i.next();
            switch (element.type()) {
                case LwgElement.JPEG:
                case LwgElement.JPEG2000:
                case LwgElement.JBIG2:
                case LwgElement.IMGRAW:
                case LwgElement.IMGTEMPLATE:
View Full Code Here

                                chunk = overflow;
                            }
                        }
                    }
                    // if the element is a paragraph, section or chapter, we reset the alignment and add the line
                    switch (element.type()) {
                        case LwgElement.PARAGRAPH:
                        case LwgElement.SECTION:
                        case LwgElement.CHAPTER:
                            line.resetAlignment();
                            flushCurrentLine();
View Full Code Here

        ArrayList allActions = new ArrayList();
        processActions(list, null, allActions);
        int aCounter = 0;
        for (Iterator it = list.getItems().iterator(); it.hasNext();) {
            LwgElement ele = (LwgElement)it.next();
            switch (ele.type()) {
                case LwgElement.LISTITEM:
                    ListItem item = (ListItem)ele;
                    line = new PdfLine(left + item.getIndentationLeft(), right, alignment, item.getLeading());
                    line.setListItem(item);
                    for (Iterator j = item.getChunks().iterator(); j.hasNext();) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.