com.lowagie.text.pdf
public class PdfCell extends Rectangle
PdfCell
is the PDF translation of a Cell
.
A PdfCell
is an ArrayList
of PdfLine
s.
When using variable borders (isUseVariableBorders()
== true),
the borders are drawn completely inside the cell Rectangle
so that adjacent cell borders will not overlap.
Otherwise, the borders are drawn on top of the edges of the
cell Rectangle and will overlap the borders of adjacent
cells.
Field Summary | |
---|---|
float | cellpadding
This is the cellpadding of the cell. |
float | cellspacing
This is the cellspacing of the cell. |
float | contentHeight
This is the total height of the content of the cell. |
PdfLine | firstLine |
int | groupNumber
This is the number of the group the cell is in. |
boolean | header
Indicates if this cell belongs to the header of a PdfTable |
ArrayList | images
These are the Images in the Cell. |
PdfLine | lastLine |
float | leading
This is the leading of the lines. |
PdfLine | line
These are the PdfLines in the Cell. |
ArrayList | lines
These are the PdfLines in the Cell. |
int | rownumber
This is the number of the row the cell is in. |
int | rowspan
This is the rowspan of the cell. |
boolean | useAscender
Indicates that the largest ascender height should be used to
determine the height of the first line. |
boolean | useBorderPadding
Adjusts the cell contents to compensate for border widths. |
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). |
int | verticalAlignment |
Constructor Summary | |
---|---|
PdfCell(Cell cell, int rownumber, float left, float right, float top, float cellspacing, float cellpadding)
Constructs a PdfCell -object.
|
Method Summary | |
---|---|
float | addImage(Image i, float left, float right, float extraHeight, int alignment)
Adds an image to this Cell.
|
void | addLine(PdfLine line) |
void | addList(List list, float left, float right, int alignment) |
float | cellpadding()
Gets the cellpadding of a cell..
|
float | cellspacing()
Gets the cellspacing of a cell.
|
float | firstLineRealHeight()
Calculates what the height of the first line should be so that the content will be
flush with the top. |
void | flushCurrentLine() |
float | getBorderWidthInside(int side)
Gets the amount of the border for the specified side that is inside the Rectangle.
|
float | getBottom()
Returns the lower left y-coordinate.
|
int | getGroupNumber()
Gets the number of the group this cell is in..
|
ArrayList | getImages(float top, float bottom)
Gets the images of a cell that can be drawn between certain limits.
|
float | getLeft()
Returns the lower left x-coordinate.
|
ArrayList | getLines(float top, float bottom)
Gets the lines of a cell that can be drawn between certain limits.
|
float | getRight()
Returns the upper right x-coordinate.
|
float | getTop()
Returns the upper right y-coordinate.
|
boolean | isHeader()
Checks if this cell belongs to the header of a PdfTable .
|
boolean | isUseAscender()
Gets the value of useAscender |
boolean | isUseBorderPadding()
Gets the value of useBorderPadding. |
boolean | isUseDescender()
gets the value of useDescender |
float | leading()
Gets the leading of a cell.
|
boolean | mayBeRemoved()
Checks if the cell may be removed.
|
protected void | processActions(Element element, PdfAction action, ArrayList allActions)
Processes all actions contained in the cell. |
Rectangle | rectangle(float top, float bottom)
Gets a Rectangle that is altered to fit on the page.
|
float | remainingHeight()
Returns the height needed to draw the remaining text.
|
float | remainingLinesHeight()
Returns the total height of all the lines in the cell.
|
PdfLine | removeLine(int index) |
int | rownumber()
Gets the number of the row this cell is in..
|
int | rowspan()
Gets the rowspan of a cell.
|
void | setBottom(float value)
Sets the bottom of the Rectangle and determines the proper {link #verticalOffset}
to appropriately align the contents vertically. |
void | setGroupNumber(int number)
Sets the group number. |
void | setHeader()
Indicates that this cell belongs to the header of a PdfTable . |
void | setUseAscender(boolean use)
Sets the value of useAscender. |
void | setUseBorderPadding(boolean use)
Sets the value of useBorderPadding. |
void | setUseDescender(boolean use)
Sets the value of useDescender. |
int | size()
Returns the number of lines in the cell.
|
PdfTable
PdfCell
-object.
Parameters: cell the original Cell
rownumber the number of the Row
the Cell
was in. left the left border of the PdfCell
right the right border of the PdfCell
top the top border of the PdfCell
cellspacing the cellspacing of the Table
cellpadding the cellpadding of the Table
Parameters: i the image to add left the left border right the right border extraHeight extra height to add above image alignment horizontal alignment (constant from Element class)
Returns: the height of the image
Returns: a value
Returns: a value
Returns: the real height of the first line
Parameters: side the side to check. One of the side constants in Rectangle
Returns: the borderwidth inside the cell
Returns: the lower left y-coordinate
Returns: a number
Remark: all the lines that can be drawn are removed from the object!
Parameters: top the top of the part of the table that can be drawn bottom the bottom of the part of the table that can be drawn
Returns: an ArrayList
of Image
s
Returns: the lower left x-coordinate
Remark: all the lines that can be drawn are removed from the object!
Parameters: top the top of the part of the table that can be drawn bottom the bottom of the part of the table that can be drawn
Returns: an ArrayList
of PdfLine
s
Returns: the upper right x-coordinate
Returns: the upper right y-coordinate
PdfTable
.
Returns: void
Returns: useAscender
Returns: useBorderPadding
Returns: useDescender
Returns: the leading of the lines is the cell.
Headers may always be removed, even if they are drawn only partially: they will be repeated on each following page anyway!
Returns: true
if all the lines are already drawn; false
otherwise.
Parameters: element an element in the cell action an action that should be coupled to the cell allActions
Parameters: top the top position bottom the bottom position
Returns: a Rectangle
Returns: a height
Returns: a value
Returns: a number
Returns: the rowspan of the cell
Parameters: value
Parameters: number
PdfTable
.Parameters: use use ascender height if true
Parameters: use adjust layout for borders if true
Parameters: use use descender height if true
Returns: a value