public class SimpleCell extends Rectangle implements PdfPCellEvent, TextElementArray
Modifier and Type | Field and Description |
---|---|
static boolean |
CELL
the CellAttributes object represents a cell.
|
static boolean |
ROW
the CellAttributes object represents a row.
|
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).
|
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, useVariableBorders
ALIGN_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, CHAPTER, CHUNK, CREATIONDATE, CREATOR, FOOTNOTE, HEADER, IMGRAW, IMGTEMPLATE, JBIG2, JPEG, JPEG2000, KEYWORDS, LIST, LISTITEM, MARKED, MULTI_COLUMN_TEXT, PARAGRAPH, PHRASE, PRODUCER, PTABLE, RECTANGLE, SECTION, SUBJECT, TABLE, TITLE, YMARK
Constructor and Description |
---|
SimpleCell(boolean row)
A CellAttributes object is always constructed without any dimensions.
|
Modifier and Type | Method and Description |
---|---|
boolean |
add(Object o)
Adds an object to the
TextElementArray . |
void |
addElement(Element element)
Adds content to this object.
|
void |
cellLayout(PdfPCell cell,
Rectangle position,
PdfContentByte[] canvases)
This method is called at the end of the cell rendering.
|
Cell |
createCell(SimpleCell rowAttributes)
Creates a Cell with these attributes.
|
PdfPCell |
createPdfPCell(SimpleCell rowAttributes)
Creates a PdfPCell with these attributes.
|
int |
getColspan() |
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()
Returns the width of the rectangle.
|
float |
getWidthpercentage() |
boolean |
isCellgroup() |
boolean |
isUseAscender() |
boolean |
isUseBorderPadding() |
boolean |
isUseDescender() |
void |
setCellgroup(boolean cellgroup) |
void |
setColspan(int colspan) |
void |
setHorizontalAlignment(int horizontalAlignment) |
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 |
setPadding(float padding)
Sets the padding parameters if they are undefined.
|
void |
setSpacing_bottom(float spacing) |
void |
setSpacing_left(float spacing) |
void |
setSpacing_right(float spacing) |
void |
setSpacing_top(float spacing) |
void |
setSpacing(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()
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, isNestable, isUseVariableBorders, normalize, process, rectangle, rotate, setBackgroundColor, setBorder, setBorderColor, setBorderColorBottom, setBorderColorLeft, setBorderColorRight, setBorderColorTop, setBorderWidth, setBorderWidthBottom, setBorderWidthLeft, setBorderWidthRight, setBorderWidthTop, setBottom, setGrayFill, setLeft, setRight, setRotation, setTop, setUseVariableBorders, softCloneNonPositionParameters, toString
public static final boolean ROW
public static final boolean CELL
protected boolean useAscender
protected boolean useDescender
protected boolean useBorderPadding
public SimpleCell(boolean row)
row
- only true if the CellAttributes object represents a row.public void addElement(Element element) throws BadElementException
element
- BadElementException
public Cell createCell(SimpleCell rowAttributes) throws BadElementException
rowAttributes
- BadElementException
public PdfPCell createPdfPCell(SimpleCell rowAttributes)
rowAttributes
- public void cellLayout(PdfPCell cell, Rectangle position, PdfContentByte[] canvases)
PdfPCellEvent
PdfContentByte
contained in
canvases
.canvases
are:
PdfPTable.BASECANVAS
- the original PdfContentByte
. Anything placed here
will be under the cell.
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 cell.
cellLayout
in interface PdfPCellEvent
cell
- the cellposition
- the coordinates of the cellcanvases
- an array of PdfContentByte
PdfPCellEvent.cellLayout(com.lowagie.text.pdf.PdfPCell, com.lowagie.text.Rectangle, com.lowagie.text.pdf.PdfContentByte[])
public void setPadding(float padding)
padding
- public int getColspan()
public void setColspan(int colspan)
colspan
- The colspan to set.public float getPadding_bottom()
public void setPadding_bottom(float padding_bottom)
padding_bottom
- The padding_bottom to set.public float getPadding_left()
public void setPadding_left(float padding_left)
padding_left
- The padding_left to set.public float getPadding_right()
public void setPadding_right(float padding_right)
padding_right
- The padding_right to set.public float getPadding_top()
public void setPadding_top(float padding_top)
padding_top
- The padding_top to set.public float getSpacing_left()
public float getSpacing_right()
public float getSpacing_top()
public float getSpacing_bottom()
public void setSpacing(float spacing)
spacing
- The spacing to set.public void setSpacing_left(float spacing)
spacing
- The spacing to set.public void setSpacing_right(float spacing)
spacing
- The spacing to set.public void setSpacing_top(float spacing)
spacing
- The spacing to set.public void setSpacing_bottom(float spacing)
spacing
- The spacing to set.public boolean isCellgroup()
public void setCellgroup(boolean cellgroup)
cellgroup
- The cellgroup to set.public int getHorizontalAlignment()
public void setHorizontalAlignment(int horizontalAlignment)
horizontalAlignment
- The horizontalAlignment to set.public int getVerticalAlignment()
public void setVerticalAlignment(int verticalAlignment)
verticalAlignment
- The verticalAligment to set.public float getWidth()
Rectangle
public void setWidth(float width)
width
- The width to set.public float getWidthpercentage()
public void setWidthpercentage(float widthpercentage)
widthpercentage
- The widthpercentage to set.public boolean isUseAscender()
public void setUseAscender(boolean useAscender)
useAscender
- The useAscender to set.public boolean isUseBorderPadding()
public void setUseBorderPadding(boolean useBorderPadding)
useBorderPadding
- The useBorderPadding to set.public boolean isUseDescender()
public void setUseDescender(boolean useDescender)
useDescender
- The useDescender to set.public boolean add(Object o)
TextElementArray
TextElementArray
.add
in interface TextElementArray
o
- an object that has to be addedtrue
if the addition succeeded; false
otherwiseTextElementArray.add(java.lang.Object)
Copyright © 2018. All rights reserved.