Example usage for com.lowagie.text.pdf PdfPCell setRunDirection

List of usage examples for com.lowagie.text.pdf PdfPCell setRunDirection

Introduction

In this page you can find the example usage for com.lowagie.text.pdf PdfPCell setRunDirection.

Prototype

public void setRunDirection(int runDirection) 

Source Link

Document

Sets the run direction of the text content in the cell.

Usage

From source file:com.jk.framework.desktop.swing.dao.TableModelPdfBuilder.java

License:Apache License

/**
 * Load data table.//from  ww  w  . j a v  a  2s . c om
 *
 * @param pdfPTable
 *            the pdf P table
 * @param font
 *            the font
 * @throws DocumentException
 *             the document exception
 * @throws IOException
 *             Signals that an I/O exception has occurred.
 */
public void loadDataTable(final PdfPTable pdfPTable, Font font) throws DocumentException, IOException {
    font = getFont();
    for (int row = 0; row < this.model.getRowCount(); row++) {
        for (int column = 0; column < this.model.getColumnCount(); column++) {
            if (this.model.isVisible(column)) {
                final PdfPCell cell = new PdfPCell(
                        new Phrase((String) this.model.getValueAt(row, column), font));
                cell.setNoWrap(true);
                cell.setRunDirection(getRunDirection());
                // TODO : make the alignment according to the colunm
                // datatype
                cell.setHorizontalAlignment(Element.ALIGN_CENTER);
                pdfPTable.addCell(cell);
            }
        }
    }
}