com.lowagie.text

Class SimpleCell

public class SimpleCell extends Rectangle implements PdfPCellEvent, TextElementArray

Rectangle that can be used for Cells. This Rectangle is padded and knows how to draw itself in a PdfPTable or PdfPcellEvent.
Field Summary
booleancellgroup
indicates if these are the attributes of a single Cell (false) or a group of Cells (true).
intcolspan
the colspan of a Cell
ArrayListcontent
the content of the Cell.
static booleanCELL
the CellAttributes object represents a cell.
inthorizontalAlignment
horizontal alignment inside the Cell.
floatpadding_bottom
an extra padding variable
floatpadding_left
an extra padding variable
floatpadding_right
an extra padding variable
floatpadding_top
an extra padding variable
static booleanROW
the CellAttributes object represents a row.
floatspacing_bottom
an extra spacing variable
floatspacing_left
an extra spacing variable
floatspacing_right
an extra spacing variable
floatspacing_top
an extra spacing variable
protected booleanuseAscender
Indicates that the largest ascender height should be used to determine the height of the first line.
protected booleanuseBorderPadding
Adjusts the cell contents to compensate for border widths.
protected booleanuseDescender
Indicates that the largest descender height should be added to the height of the last line (so characters like y don't dip into the border).
intverticalAlignment
vertical alignment inside the Cell.
floatwidth
the width of the Cell.
floatwidthpercentage
the widthpercentage of the Cell.
Constructor Summary
SimpleCell(boolean row)
A CellAttributes object is always constructed without any dimensions.
Method Summary
booleanadd(Object o)
voidaddElement(Element element)
Adds content to this object.
voidcellLayout(PdfPCell cell, Rectangle position, PdfContentByte[] canvases)
CellcreateCell(SimpleCell rowAttributes)
Creates a Cell with these attributes.
PdfPCellcreatePdfPCell(SimpleCell rowAttributes)
Creates a PdfPCell with these attributes.
intgetColspan()
ArrayListgetContent()
intgetHorizontalAlignment()
floatgetPadding_bottom()
floatgetPadding_left()
floatgetPadding_right()
floatgetPadding_top()
floatgetSpacing_bottom()
floatgetSpacing_left()
floatgetSpacing_right()
floatgetSpacing_top()
intgetVerticalAlignment()
floatgetWidth()
floatgetWidthpercentage()
booleanisCellgroup()
booleanisUseAscender()
booleanisUseBorderPadding()
booleanisUseDescender()
voidsetCellgroup(boolean cellgroup)
voidsetColspan(int colspan)
voidsetHorizontalAlignment(int horizontalAlignment)
voidsetPadding(float padding)
Sets the padding parameters if they are undefined.
voidsetPadding_bottom(float padding_bottom)
voidsetPadding_left(float padding_left)
voidsetPadding_right(float padding_right)
voidsetPadding_top(float padding_top)
voidsetSpacing(float spacing)
voidsetSpacing_bottom(float spacing)
voidsetSpacing_left(float spacing)
voidsetSpacing_right(float spacing)
voidsetSpacing_top(float spacing)
voidsetUseAscender(boolean useAscender)
voidsetUseBorderPadding(boolean useBorderPadding)
voidsetUseDescender(boolean useDescender)
voidsetVerticalAlignment(int verticalAlignment)
voidsetWidth(float width)
voidsetWidthpercentage(float widthpercentage)
inttype()

Field Detail

cellgroup

private boolean cellgroup
indicates if these are the attributes of a single Cell (false) or a group of Cells (true).

colspan

private int colspan
the colspan of a Cell

content

private ArrayList content
the content of the Cell.

CELL

public static final boolean CELL
the CellAttributes object represents a cell.

horizontalAlignment

private int horizontalAlignment
horizontal alignment inside the Cell.

padding_bottom

private float padding_bottom
an extra padding variable

padding_left

private float padding_left
an extra padding variable

padding_right

private float padding_right
an extra padding variable

padding_top

private float padding_top
an extra padding variable

ROW

public static final boolean ROW
the CellAttributes object represents a row.

spacing_bottom

private float spacing_bottom
an extra spacing variable

spacing_left

private float spacing_left
an extra spacing variable

spacing_right

private float spacing_right
an extra spacing variable

spacing_top

private float spacing_top
an extra spacing variable

useAscender

protected boolean useAscender
Indicates that the largest ascender height should be used to determine the height of the first line. Note that this only has an effect when rendered to PDF. Setting this to true can help with vertical alignment problems.

useBorderPadding

protected boolean useBorderPadding
Adjusts the cell contents to compensate for border widths. Note that this only has an effect when rendered to PDF.

useDescender

protected boolean useDescender
Indicates that the largest descender height should be added to the height of the last line (so characters like y don't dip into the border). Note that this only has an effect when rendered to PDF.

verticalAlignment

private int verticalAlignment
vertical alignment inside the Cell.

width

private float width
the width of the Cell.

widthpercentage

private float widthpercentage
the widthpercentage of the Cell.

Constructor Detail

SimpleCell

public SimpleCell(boolean row)
A CellAttributes object is always constructed without any dimensions. Dimensions are defined after creation.

Parameters: row only true if the CellAttributes object represents a row.

Method Detail

add

public boolean add(Object o)

See Also: TextElementArray

addElement

public void addElement(Element element)
Adds content to this object.

Parameters: element

Throws: BadElementException

cellLayout

public void cellLayout(PdfPCell cell, Rectangle position, PdfContentByte[] canvases)

See Also: (com.lowagie.text.pdf.PdfPCell, com.lowagie.text.Rectangle, com.lowagie.text.pdf.PdfContentByte[])

createCell

public Cell createCell(SimpleCell rowAttributes)
Creates a Cell with these attributes.

Parameters: rowAttributes

Returns: a cell based on these attributes.

Throws: BadElementException

createPdfPCell

public PdfPCell createPdfPCell(SimpleCell rowAttributes)
Creates a PdfPCell with these attributes.

Parameters: rowAttributes

Returns: a PdfPCell based on these attributes.

getColspan

public int getColspan()

Returns: Returns the colspan.

getContent

ArrayList getContent()

Returns: Returns the content.

getHorizontalAlignment

public int getHorizontalAlignment()

Returns: Returns the horizontal alignment.

getPadding_bottom

public float getPadding_bottom()

Returns: Returns the padding_bottom.

getPadding_left

public float getPadding_left()

Returns: Returns the padding_left.

getPadding_right

public float getPadding_right()

Returns: Returns the padding_right.

getPadding_top

public float getPadding_top()

Returns: Returns the padding_top.

getSpacing_bottom

public float getSpacing_bottom()

Returns: Returns the spacing.

getSpacing_left

public float getSpacing_left()

Returns: Returns the spacing.

getSpacing_right

public float getSpacing_right()

Returns: Returns the spacing.

getSpacing_top

public float getSpacing_top()

Returns: Returns the spacing.

getVerticalAlignment

public int getVerticalAlignment()

Returns: Returns the vertical alignment.

getWidth

public float getWidth()

Returns: Returns the width.

getWidthpercentage

public float getWidthpercentage()

Returns: Returns the widthpercentage.

isCellgroup

public boolean isCellgroup()

Returns: Returns the cellgroup.

isUseAscender

public boolean isUseAscender()

Returns: Returns the useAscender.

isUseBorderPadding

public boolean isUseBorderPadding()

Returns: Returns the useBorderPadding.

isUseDescender

public boolean isUseDescender()

Returns: Returns the useDescender.

setCellgroup

public void setCellgroup(boolean cellgroup)

Parameters: cellgroup The cellgroup to set.

setColspan

public void setColspan(int colspan)

Parameters: colspan The colspan to set.

setHorizontalAlignment

public void setHorizontalAlignment(int horizontalAlignment)

Parameters: horizontalAlignment The horizontalAlignment to set.

setPadding

public void setPadding(float padding)
Sets the padding parameters if they are undefined.

Parameters: padding

setPadding_bottom

public void setPadding_bottom(float padding_bottom)

Parameters: padding_bottom The padding_bottom to set.

setPadding_left

public void setPadding_left(float padding_left)

Parameters: padding_left The padding_left to set.

setPadding_right

public void setPadding_right(float padding_right)

Parameters: padding_right The padding_right to set.

setPadding_top

public void setPadding_top(float padding_top)

Parameters: padding_top The padding_top to set.

setSpacing

public void setSpacing(float spacing)

Parameters: spacing The spacing to set.

setSpacing_bottom

public void setSpacing_bottom(float spacing)

Parameters: spacing The spacing to set.

setSpacing_left

public void setSpacing_left(float spacing)

Parameters: spacing The spacing to set.

setSpacing_right

public void setSpacing_right(float spacing)

Parameters: spacing The spacing to set.

setSpacing_top

public void setSpacing_top(float spacing)

Parameters: spacing The spacing to set.

setUseAscender

public void setUseAscender(boolean useAscender)

Parameters: useAscender The useAscender to set.

setUseBorderPadding

public void setUseBorderPadding(boolean useBorderPadding)

Parameters: useBorderPadding The useBorderPadding to set.

setUseDescender

public void setUseDescender(boolean useDescender)

Parameters: useDescender The useDescender to set.

setVerticalAlignment

public void setVerticalAlignment(int verticalAlignment)

Parameters: verticalAlignment The verticalAligment to set.

setWidth

public void setWidth(float width)

Parameters: width The width to set.

setWidthpercentage

public void setWidthpercentage(float widthpercentage)

Parameters: widthpercentage The widthpercentage to set.

type

public int type()

See Also: type