Example usage for com.lowagie.text Table iterator

List of usage examples for com.lowagie.text Table iterator

Introduction

In this page you can find the example usage for com.lowagie.text Table iterator.

Prototype

public Iterator iterator() 

Source Link

Document

Gets an Iterator of all the Rows.

Usage

From source file:org.pentaho.reporting.engine.classic.core.modules.output.table.rtf.itext.PatchRtfTable.java

License:Open Source License

/**
 * Imports the rows and settings from the Table into this PatchRtfTable.
 *
 * @param table/*from w w  w.j  ava  2s  . c om*/
 *          The source Table
 */
private void importTable(Table table) {
    this.rows = new ArrayList<PatchRtfRow>();
    this.tableWidthPercent = table.getWidth();
    this.proportionalWidths = table.getProportionalWidths();
    this.cellPadding = (float) (table.getPadding() * TWIPS_FACTOR);
    this.cellSpacing = (float) (table.getSpacing() * TWIPS_FACTOR);
    this.borders = new PatchRtfBorderGroup(this.document, PatchRtfBorder.ROW_BORDER, table.getBorder(),
            table.getBorderWidth(), table.getBorderColor());
    this.alignment = table.getAlignment();

    int i = 0;
    Iterator rowIterator = table.iterator();
    while (rowIterator.hasNext()) {
        this.rows.add(new PatchRtfRow(this.document, this, (Row) rowIterator.next(), i));
        // avoid out of memory exception
        rowIterator.remove();
        i++;
    }
    for (i = 0; i < this.rows.size(); i++) {
        this.rows.get(i).handleCellSpanning();
        this.rows.get(i).cleanRow();
    }
    this.headerRows = table.getLastHeaderRow();
    this.cellsFitToPage = table.isCellsFitPage();
    this.tableFitToPage = table.isTableFitsPage();
    if (!Float.isNaN(table.getOffset())) {
        this.offset = (int) (table.getOffset() * 2);
    }
}