Example usage for com.lowagie.text Element ALIGN_BOTTOM

List of usage examples for com.lowagie.text Element ALIGN_BOTTOM

Introduction

In this page you can find the example usage for com.lowagie.text Element ALIGN_BOTTOM.

Prototype

int ALIGN_BOTTOM

To view the source code for com.lowagie.text Element ALIGN_BOTTOM.

Click Source Link

Document

A possible value for vertical alignment.

Usage

From source file:s2s.report.MiddleTable.java

License:GNU General Public License

public void toBottom() {
    this.setDefaultVerticalAlignment(Element.ALIGN_BOTTOM);
}

From source file:se.idega.idegaweb.commune.school.report.business.ReportPDFWriter.java

License:Open Source License

/**
 * Builds the report column headers./*  ww w . j ava  2 s .c  o m*/
 */
protected void buildColumnHeaders(Table table) throws BadElementException {
    Header[] headers = this._reportModel.getColumnHeaders();
    com.lowagie.text.Cell cell = new com.lowagie.text.Cell();
    cell.setRowspan(2);
    table.addCell(cell, new Point(0, 0));
    int column = 1;
    for (int i = 0; i < headers.length; i++) {
        Header header = headers[i];
        Header[] children = header.getChildren();
        if (children == null) {
            String s = null;
            if (header.getHeaderType() == Header.HEADERTYPE_COLUMN_NONLOCALIZED_HEADER) {
                s = header.getLocalizationKey();
            } else {
                s = localize(header.getLocalizationKey(), header.getLocalizationKey());
            }
            cell = new com.lowagie.text.Cell(new Phrase(s, this._normalFont));
            cell.setRowspan(2);
            cell.setHorizontalAlignment(Element.ALIGN_CENTER);
            cell.setVerticalAlignment(Element.ALIGN_BOTTOM);
            table.addCell(cell, new Point(0, column));
            setColSize(s, column, true);
            column++;
        } else {
            String s = null;
            if (header.getHeaderType() == Header.HEADERTYPE_COLUMN_NONLOCALIZED_HEADER) {
                s = header.getLocalizationKey();
            } else {
                s = localize(header.getLocalizationKey(), header.getLocalizationKey());
            }
            cell = new com.lowagie.text.Cell(new Phrase(s, this._normalFont));
            cell.setColspan(children.length);
            cell.setHorizontalAlignment(Element.ALIGN_CENTER);
            table.addCell(cell, new Point(0, column));
            if (children.length == 1) {
                setColSize(s, column, false);
            }
            for (int j = 0; j < children.length; j++) {
                Header child = children[j];
                s = null;
                if (child.getHeaderType() == Header.HEADERTYPE_COLUMN_NONLOCALIZED_HEADER) {
                    s = child.getLocalizationKey();
                } else {
                    s = localize(child.getLocalizationKey(), child.getLocalizationKey());
                }
                cell = new com.lowagie.text.Cell(new Phrase(s, this._normalFont));
                cell.setHorizontalAlignment(Element.ALIGN_CENTER);
                cell.setVerticalAlignment(Element.ALIGN_BOTTOM);
                cell.setNoWrap(true);
                table.addCell(cell, new Point(1, column + j));
                setColSize(s, column + j, false);
            }
            column += children.length;
        }
    }
}