com.lowagie.text

Class SimpleCell

Implemented Interfaces:
Element, MarkupAttributes, PdfPCellEvent, TextElementArray

public class SimpleCell
extends Rectangle
implements PdfPCellEvent, Element, 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

static boolean
CELL
the CellAttributes object represents a cell.
static boolean
ROW
the CellAttributes object represents a row.
private boolean
cellgroup
indicates if these are the attributes of a single Cell (false) or a group of Cells (true).
private int
colspan
the colspan of a Cell
private ArrayList
content
the content of the Cell.
private int
horizontalAlignment
horizontal alignment inside the Cell.
private float
padding_bottom
an extra padding variable
private float
padding_left
an extra padding variable
private float
padding_right
an extra padding variable
private float
padding_top
an extra padding variable
private float
spacing_bottom
an extra spacing variable
private float
spacing_left
an extra spacing variable
private float
spacing_right
an extra spacing variable
private float
spacing_top
an extra spacing variable
protected boolean
useAscender
Indicates that the largest ascender height should be used to determine the height of the first line.
protected boolean
useBorderPadding
Adjusts the cell contents to compensate for border widths.
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).
private int
verticalAlignment
vertical alignment inside the Cell.
private float
width
the width of the Cell.
private float
widthpercentage
the widthpercentage of the Cell.

Fields inherited from class com.lowagie.text.Rectangle

BOTTOM, BOX, LEFT, NO_BORDER, RIGHT, TOP, UNDEFINED, background, border, borderColorBottom, borderColorLeft, borderColorRight, borderColorTop, borderWidth, borderWidthBottom, borderWidthLeft, borderWidthRight, borderWidthTop, color, llx, lly, markupAttributes, rotation, urx, ury, useVariableBorders

Fields inherited from interface com.lowagie.text.Element

ALIGN_BASELINE, ALIGN_BOTTOM, ALIGN_CENTER, ALIGN_JUSTIFIED, ALIGN_JUSTIFIED_ALL, ALIGN_LEFT, ALIGN_MIDDLE, ALIGN_RIGHT, ALIGN_TOP, ALIGN_UNDEFINED, ANCHOR, ANNOTATION, AUTHOR, CCITTG3_1D, CCITTG3_2D, CCITTG4, CCITT_BLACKIS1, CCITT_ENCODEDBYTEALIGN, CCITT_ENDOFBLOCK, CCITT_ENDOFLINE, CELL, CHAPTER, CHUNK, CREATIONDATE, CREATOR, GRAPHIC, HEADER, IMGRAW, IMGTEMPLATE, JPEG, KEYWORDS, LIST, LISTITEM, MULTI_COLUMN_TEXT, PARAGRAPH, PHRASE, PRODUCER, PTABLE, RECTANGLE, ROW, SECTION, SUBJECT, TABLE, TITLE

Constructor Summary

SimpleCell(boolean row)
A CellAttributes object is always constructed without any dimensions.

Method Summary

boolean
add(Object o)
void
addElement(Element element)
Adds content to this object.
void
cellLayout(PdfPCell cell, Rectangle position, PdfContentByte[] canvases)
Cell
createCell(SimpleCell rowAttributes)
Creates a Cell with these attributes.
PdfPCell
createPdfPCell(SimpleCell rowAttributes)
Creates a PdfPCell with these attributes.
int
getColspan()
(package private) ArrayList
getContent()
static SimpleCell
getDimensionlessInstance(Rectangle rectangle, float spacing)
int
getHorizontalAlignment()
float
getPadding_bottom()
float
getPadding_left()
float
getPadding_right()
float
getPadding_top()
float
getSpacing_bottom()
float
getSpacing_left()
float
getSpacing_right()
float
getSpacing_top()
int
getVerticalAlignment()
float
getWidth()
float
getWidthpercentage()
boolean
isCellgroup()
boolean
isUseAscender()
boolean
isUseBorderPadding()
boolean
isUseDescender()
void
setCellgroup(boolean cellgroup)
void
setColspan(int colspan)
void
setHorizontalAlignment(int horizontalAlignment)
void
setPadding(float padding)
Sets the padding parameters if they are undefined.
void
setPadding_bottom(float padding_bottom)
void
setPadding_left(float padding_left)
void
setPadding_right(float padding_right)
void
setPadding_top(float padding_top)
void
setSpacing(float spacing)
void
setSpacing_bottom(float spacing)
void
setSpacing_left(float spacing)
void
setSpacing_right(float spacing)
void
setSpacing_top(float spacing)
void
setUseAscender(boolean useAscender)
void
setUseBorderPadding(boolean useBorderPadding)
void
setUseDescender(boolean useDescender)
void
setVerticalAlignment(int verticalAlignment)
void
setWidth(float width)
void
setWidthpercentage(float widthpercentage)
int
type()

Methods inherited from class com.lowagie.text.Rectangle

backgroundColor, border, borderColor, borderWidth, bottom, bottom, cloneNonPositionParameters, disableBorderSide, enableBorderSide, getBorderColorBottom, getBorderColorLeft, getBorderColorRight, getBorderColorTop, getBorderWidthBottom, getBorderWidthLeft, getBorderWidthRight, getBorderWidthTop, getChunks, getMarkupAttribute, getMarkupAttributeNames, getMarkupAttributes, getRotation, getVariableBorderWidth, grayFill, hasBorder, hasBorders, height, isUseVariableBorders, left, left, normalize, process, rectangle, right, right, rotate, setBackgroundColor, setBorder, setBorderColor, setBorderColorBottom, setBorderColorLeft, setBorderColorRight, setBorderColorTop, setBorderWidth, setBorderWidthBottom, setBorderWidthLeft, setBorderWidthRight, setBorderWidthTop, setBottom, setGrayFill, setLeft, setMarkupAttribute, setMarkupAttributes, setRight, setTop, setUseVariableBorders, softCloneNonPositionParameters, toString, top, top, type, updateBorderBasedOnWidth, width

Field Details

CELL

public static final boolean CELL
the CellAttributes object represents a cell.
Field Value:
false

ROW

public static final boolean ROW
the CellAttributes object represents a row.
Field Value:
true

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.

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

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 Details

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 Details

add

public boolean add(Object o)
Specified by:
add in interface TextElementArray
See Also:
com.lowagie.text.TextElementArray.add(java.lang.Object)

addElement

public void addElement(Element element)
            throws BadElementException
Adds content to this object.
Parameters:
element -

cellLayout

public void cellLayout(PdfPCell cell,
                       Rectangle position,
                       PdfContentByte[] canvases)
Specified by:
cellLayout in interface PdfPCellEvent

createCell

public Cell createCell(SimpleCell rowAttributes)
            throws BadElementException
Creates a Cell with these attributes.
Parameters:
rowAttributes -
Returns:
a cell based on these attributes.

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

(package private)  ArrayList getContent()
Returns:
Returns the content.

getDimensionlessInstance

public static SimpleCell getDimensionlessInstance(Rectangle rectangle,
                                                  float spacing)
Parameters:
rectangle -
spacing -
Returns:
a rectangle

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()