Examples of LwgRow


Examples of com.lowagie.text.LwgRow

                }
                return;
            }
            case LwgElement.ROW:
            {
                LwgRow row = (LwgRow) element;
               
                // start tag
                addTabs(indent);
                writeStart(HtmlTags.ROW);
                writeMarkupAttributes(markup);
                os.write(GT);
                // contents
                LwgElement cell;
                for (int i = 0; i < row.getColumns(); i++) {
                    if ((cell = (LwgElement)row.getCell(i)) != null) {
                        write(cell, indent + 1);
                    }
                }
                // end tag
                addTabs(indent);
                writeEnd(HtmlTags.ROW);
                return;
            }
            case LwgElement.TABLE:
            {
              Table table;
              try {
                table = (Table) element;
              }
              catch(ClassCastException cce) {
                try {
            table = ((SimpleTable)element).createTable();
          } catch (BadElementException e) {
            throw new ExceptionConverter(e);
          }
              }
                table.complete();
                // start tag
                addTabs(indent);
                writeStart(HtmlTags.TABLE);
                writeMarkupAttributes(markup);
                os.write(SPACE);
                write(HtmlTags.WIDTH);
                os.write(EQUALS);
                os.write(QUOTE);
                write(String.valueOf(table.getWidth()));
                if (!table.isLocked()){
                    write("%");
                }
                os.write(QUOTE);
                String alignment = HtmlEncoder.getAlignment(table.getAlignment());
                if (!"".equals(alignment)) {
                    write(HtmlTags.ALIGN, alignment);
                }
                write(HtmlTags.CELLPADDING, String.valueOf(table.getPadding()));
                write(HtmlTags.CELLSPACING, String.valueOf(table.getSpacing()));
                if (table.getBorderWidth() != LwgRectangle.UNDEFINED) {
                    write(HtmlTags.BORDERWIDTH, String.valueOf(table.getBorderWidth()));
                }
                if (table.getBorderColor() != null) {
                    write(HtmlTags.BORDERCOLOR, HtmlEncoder.encode(table.getBorderColor()));
                }
                if (table.getBackgroundColor() != null) {
                    write(HtmlTags.BACKGROUNDCOLOR, HtmlEncoder.encode(table.getBackgroundColor()));
                }
                os.write(GT);
                // contents
                LwgRow row;
                for (Iterator iterator = table.iterator(); iterator.hasNext(); ) {
                    row = (LwgRow) iterator.next();
                    write(row, indent + 1);
                }
                // end tag
View Full Code Here

Examples of com.lowagie.text.LwgRow

   * Updates the table row additions in the underlying table object
   */
 
  private void updateRowAdditionsInternal() {
    // correct table : fill empty cells/ parse table in table
    LwgRow row;
    int prevRows = rows();
    int rowNumber = 0;
    int groupNumber = 0;
    boolean groupChange;
    int firstDataRow = table.getLastHeaderRow() + 1;
    LwgCell cell;
    PdfCell currentCell;
    ArrayList newCells = new ArrayList();
    int rows = table.size() + 1;
    float[] offsets = new float[rows];
    for (int i = 0; i < rows; i++) {
      offsets[i] = getBottom();
    }
       
    // loop over all the rows
    for (Iterator rowIterator = table.iterator(); rowIterator.hasNext(); ) {
      groupChange = false;
      row = (LwgRow) rowIterator.next();
      if (row.isEmpty()) {
        if (rowNumber < rows - 1 && offsets[rowNumber + 1] > offsets[rowNumber]) offsets[rowNumber + 1] = offsets[rowNumber];
      }
      else {
        for(int i = 0; i < row.getColumns(); i++) {
          cell = (LwgCell) row.getCell(i);
          if (cell != null) {
            currentCell = new PdfCell(cell, rowNumber+prevRows, positions[i], positions[i + cell.getColspan()], offsets[rowNumber], cellspacing(), cellpadding());
            if (rowNumber < firstDataRow) {
              currentCell.setHeader();
              headercells.add(currentCell);
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.