com.lowagie.text.pdf

Class PdfPRow

public class PdfPRow extends Object

A row in a PdfPTable.

Author: Paulo Soares (psoares@consiste.pt)

Field Summary
static floatBOTTOM_LIMIT
the bottom limit (bottom right y)
protected booleancalculated
int[]canvasesPos
protected PdfPCell[]cells
protected floatmaxHeight
static floatRIGHT_LIMIT
the right limit
protected float[]widths
Constructor Summary
PdfPRow(PdfPCell[] cells)
Constructs a new PdfPRow with the cells in the array that was passed as a parameter.
PdfPRow(PdfPRow row)
Makes a copy of an existing row.
Method Summary
floatcalculateHeights()
Calculates the heights of each cell in the row.
PdfPCell[]getCells()
Returns the array of cells in the row.
float[]getEventWidth(float xPos)
floatgetMaxHeights()
Gets the maximum height of the row (i.e. of the 'highest' cell).
booleanisCalculated()
Checks if the dimensions of the columns were calculated.
voidrestoreCanvases(PdfContentByte[] canvases)
voidsaveAndRotateCanvases(PdfContentByte[] canvases, float a, float b, float c, float d, float e, float f)
floatsetColumn(ColumnText ct, float left, float bottom, float right, float top)
voidsetMaxHeights(float maxHeight)
Changes the maximum height of the row (to make it higher). (added by Jin-Hsia Yang)
booleansetWidths(float[] widths)
Sets the widths of the columns in the row.
PdfPRowsplitRow(float newHeight)
Splits a row to newHeight.
voidwriteBorderAndBackground(float xPos, float yPos, PdfPCell cell, PdfContentByte[] canvases)
Writes the border and background of one cell in the row.
voidwriteCells(int colStart, int colEnd, float xPos, float yPos, PdfContentByte[] canvases)
Writes a number of cells (not necessarily all cells).

Field Detail

BOTTOM_LIMIT

public static final float BOTTOM_LIMIT
the bottom limit (bottom right y)

calculated

protected boolean calculated

canvasesPos

private int[] canvasesPos

cells

protected PdfPCell[] cells

maxHeight

protected float maxHeight

RIGHT_LIMIT

public static final float RIGHT_LIMIT
the right limit

Since: 2.1.5

widths

protected float[] widths

Constructor Detail

PdfPRow

public PdfPRow(PdfPCell[] cells)
Constructs a new PdfPRow with the cells in the array that was passed as a parameter.

Parameters: cells

PdfPRow

public PdfPRow(PdfPRow row)
Makes a copy of an existing row.

Parameters: row

Method Detail

calculateHeights

public float calculateHeights()
Calculates the heights of each cell in the row.

Returns: the maximum height of the row.

getCells

public PdfPCell[] getCells()
Returns the array of cells in the row. Please be extremely careful with this method. Use the cells as read only objects.

Returns: an array of cells

Since: 2.1.1

getEventWidth

float[] getEventWidth(float xPos)

getMaxHeights

public float getMaxHeights()
Gets the maximum height of the row (i.e. of the 'highest' cell).

Returns: the maximum height of the row

isCalculated

public boolean isCalculated()
Checks if the dimensions of the columns were calculated.

Returns: true if the dimensions of the columns were calculated

restoreCanvases

private void restoreCanvases(PdfContentByte[] canvases)

saveAndRotateCanvases

private void saveAndRotateCanvases(PdfContentByte[] canvases, float a, float b, float c, float d, float e, float f)

setColumn

private float setColumn(ColumnText ct, float left, float bottom, float right, float top)

setMaxHeights

public void setMaxHeights(float maxHeight)
Changes the maximum height of the row (to make it higher). (added by Jin-Hsia Yang)

Parameters: maxHeight the new maximum height

setWidths

public boolean setWidths(float[] widths)
Sets the widths of the columns in the row.

Parameters: widths

Returns: true if everything went right

splitRow

public PdfPRow splitRow(float newHeight)
Splits a row to newHeight. The returned row is the remainder. It will return null if the newHeight was so small that only an empty row would result.

Parameters: newHeight the new height

Returns: the remainder row or null if the newHeight was so small that only an empty row would result

writeBorderAndBackground

public void writeBorderAndBackground(float xPos, float yPos, PdfPCell cell, PdfContentByte[] canvases)
Writes the border and background of one cell in the row.

Parameters: xPos The x-coordinate where the table starts on the canvas yPos The y-coordinate where the table starts on the canvas cell canvases

writeCells

public void writeCells(int colStart, int colEnd, float xPos, float yPos, PdfContentByte[] canvases)
Writes a number of cells (not necessarily all cells).

Parameters: colStart The first column to be written. Remember that the column index starts with 0. colEnd The last column to be written. Remember that the column index starts with 0. If -1, all the columns to the end are written. xPos The x-coordinate where the table starts on the canvas yPos The y-coordinate where the table starts on the canvas