Example usage for com.lowagie.text Table getProportionalWidths

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

Introduction

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

Prototype

public float[] getProportionalWidths() 

Source Link

Document

Gets the proportional widths of the columns in this Table.

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// w  w w  . j av a  2s .c o  m
 *          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);
    }
}