Package net.sf.jpluck.plucker

Examples of net.sf.jpluck.plucker.TableCell


            row = table.addRow();
        }
    }

    public TableCell addCell() {
        TableCell cell = null;
        if (row != null) {
            cell=row.addCell();
            currentParagraph=cell;
        }
        return cell;
View Full Code Here


        home.addParagraph().addTable("table");

        TableRecord table = new TableRecord("table", 1, Color.GREEN);

        TableRow row = table.addRow();
        TableCell cell = row.addCell();
        cell.addText("nw");
        cell=row.addCell();
        cell.addText("ne");

        row = table.addRow();
    cell = row.addCell();
        cell.addText("sw");
        cell = row.addCell();
        cell.addText("se");

        Document document = new Document("Table test");
        document.setCompression(Document.NO_COMPRESSION);
        document.addRecord(home);
        document.setHome(home);
View Full Code Here


public class TableCellHandler implements TagHandler, Alignable {
    public void start(HTMLSerializer ser, StyledElement elem) {
        if (ser.isParseTables()) {
            TableCell cell = ser.addCell();
            if (cell != null) {
                String align = elem.getAttributes().getValue("align");
                int alignment = Align.LEFT;
                if (align != null) {
                    align = align.toLowerCase();
                    if (align.equals("right")) {
                        cell.setAlignment(Align.RIGHT);
                    } else if (align.equals("center") || align.equals("middle")) {
                        cell.setAlignment(Align.CENTER);
                    } else if (align.equals("justify")) {
                      cell.setAlignment(Align.JUSTIFY);
                    }
                }
                try {
                  int rowspan = Integer.parseInt(elem.getAttributes().getValue("rowspan"));
                  cell.setRowSpan(rowspan);
                }
                catch (NumberFormatException e) {
                }
        try {
          int colspan = Integer.parseInt(elem.getAttributes().getValue("colspan"));
          cell.setColumnSpan(colspan);
        }
        catch (NumberFormatException e) {
        }
            }
        } else {
View Full Code Here

TOP

Related Classes of net.sf.jpluck.plucker.TableCell

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.