public class SimpleTable extends Rectangle implements PdfPTableEvent, TextElementArray
| Modifier and Type | Field and Description |
|---|---|
private int |
alignment
the alignment of the table.
|
private float |
cellpadding
the padding of the Cells.
|
private float |
cellspacing
the spacing of the Cells.
|
private java.util.ArrayList |
content
the content of a Table.
|
private float |
width
the width of the Table.
|
private float |
widthpercentage
the widthpercentage of the Table.
|
backgroundColor, border, borderColor, borderColorBottom, borderColorLeft, borderColorRight, borderColorTop, borderWidth, borderWidthBottom, borderWidthLeft, borderWidthRight, borderWidthTop, BOTTOM, BOX, LEFT, llx, lly, NO_BORDER, RIGHT, rotation, TOP, UNDEFINED, urx, ury, useVariableBordersALIGN_BASELINE, ALIGN_BOTTOM, ALIGN_CENTER, ALIGN_JUSTIFIED, ALIGN_JUSTIFIED_ALL, ALIGN_LEFT, ALIGN_MIDDLE, ALIGN_RIGHT, ALIGN_TOP, ALIGN_UNDEFINED, ANCHOR, ANNOTATION, AUTHOR, CCITT_BLACKIS1, CCITT_ENCODEDBYTEALIGN, CCITT_ENDOFBLOCK, CCITT_ENDOFLINE, CCITTG3_1D, CCITTG3_2D, CCITTG4, CELL, CHAPTER, CHUNK, CREATIONDATE, CREATOR, HEADER, IMGRAW, IMGTEMPLATE, JBIG2, JPEG, JPEG2000, KEYWORDS, LIST, LISTITEM, MARKED, MULTI_COLUMN_TEXT, PARAGRAPH, PHRASE, PRODUCER, PTABLE, RECTANGLE, ROW, SECTION, SUBJECT, TABLE, TITLE, YMARK| Constructor and Description |
|---|
SimpleTable()
A RectangleCell is always constructed without any dimensions.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(java.lang.Object o)
Adds an object to the
TextElementArray. |
void |
addElement(SimpleCell element)
Adds content to this object.
|
PdfPTable |
createPdfPTable()
Creates a PdfPTable object based on this TableAttributes object.
|
Table |
createTable()
Creates a Table object based on this TableAttributes object.
|
int |
getAlignment() |
float |
getCellpadding() |
float |
getCellspacing() |
float |
getWidth()
Returns the width of the rectangle.
|
float |
getWidthpercentage() |
boolean |
isNestable()
Checks if this element is nestable.
|
void |
setAlignment(int alignment) |
void |
setCellpadding(float cellpadding) |
void |
setCellspacing(float cellspacing) |
void |
setWidth(float width) |
void |
setWidthpercentage(float widthpercentage) |
void |
tableLayout(PdfPTable table,
float[][] widths,
float[] heights,
int headerRows,
int rowStart,
PdfContentByte[] canvases)
This method is called at the end of the table rendering.
|
int |
type()
Gets the type of the text element.
|
cloneNonPositionParameters, disableBorderSide, enableBorderSide, getBackgroundColor, getBorder, getBorderColor, getBorderColorBottom, getBorderColorLeft, getBorderColorRight, getBorderColorTop, getBorderWidth, getBorderWidthBottom, getBorderWidthLeft, getBorderWidthRight, getBorderWidthTop, getBottom, getBottom, getChunks, getGrayFill, getHeight, getLeft, getLeft, getRight, getRight, getRotation, getTop, getTop, hasBorder, hasBorders, isContent, isUseVariableBorders, normalize, process, rectangle, rotate, setBackgroundColor, setBorder, setBorderColor, setBorderColorBottom, setBorderColorLeft, setBorderColorRight, setBorderColorTop, setBorderWidth, setBorderWidthBottom, setBorderWidthLeft, setBorderWidthRight, setBorderWidthTop, setBottom, setGrayFill, setLeft, setRight, setTop, setUseVariableBorders, softCloneNonPositionParameters, toStringprivate java.util.ArrayList content
private float width
private float widthpercentage
private float cellspacing
private float cellpadding
private int alignment
public SimpleTable()
public void addElement(SimpleCell element) throws BadElementException
element - BadElementExceptionpublic Table createTable() throws BadElementException
BadElementExceptionpublic PdfPTable createPdfPTable() throws DocumentException
DocumentExceptionpublic void tableLayout(PdfPTable table, float[][] widths, float[] heights, int headerRows, int rowStart, PdfContentByte[] canvases)
PdfPTableEventPdfContentByte contained in
canvases.canvases are:
PdfPTable.BASECANVAS - the original PdfContentByte. Anything placed here
will be under the table.
PdfPTable.BACKGROUNDCANVAS - the layer where the background goes to.
PdfPTable.LINECANVAS - the layer where the lines go to.
PdfPTable.TEXTCANVAS - the layer where the text go to. Anything placed here
will be over the table.
The widths and heights have the coordinates of the cells.
The size of the widths array is the number of rows.
Each sub-array in widths corresponds to the x column border positions where
the first element is the x coordinate of the left table border and the last
element is the x coordinate of the right table border.
If colspan is not used all the sub-arrays in widths
are the same.
For the heights the first element is the y coordinate of the top table border and the last
element is the y coordinate of the bottom table border.
tableLayout in interface PdfPTableEventtable - the PdfPTable in usewidths - an array of arrays with the cells' x positions. It has the length of the number
of rowsheights - an array with the cells' y positions. It has a length of the number
of rows + 1headerRows - the number of rows defined for the header.rowStart - the first row number after the headercanvases - an array of PdfContentBytePdfPTableEvent.tableLayout(com.lowagie.text.pdf.PdfPTable, float[][], float[], int, int, com.lowagie.text.pdf.PdfContentByte[])public float getCellpadding()
public void setCellpadding(float cellpadding)
cellpadding - The cellpadding to set.public float getCellspacing()
public void setCellspacing(float cellspacing)
cellspacing - The cellspacing to set.public int getAlignment()
public void setAlignment(int alignment)
alignment - The alignment to set.public float getWidth()
Rectanglepublic void setWidth(float width)
width - The width to set.public float getWidthpercentage()
public void setWidthpercentage(float widthpercentage)
widthpercentage - The widthpercentage to set.public int type()
Rectangletype in interface Elementtype in class RectangleElement.type()public boolean isNestable()
ElementisNestable in interface ElementisNestable in class RectangleElement.isNestable()public boolean add(java.lang.Object o)
TextElementArrayTextElementArray.add in interface TextElementArrayo - an object that has to be addedtrue if the addition succeeded; false otherwiseTextElementArray.add(java.lang.Object)