public class Cell extends Rectangle implements TextElementArray
Cell is a Rectangle containing other
Elements.
A Cell must be added to a Table.
The Table will place the Cell in
a Row.
Example:
Table table = new Table(3);
table.setBorderWidth(1);
table.setBorderColor(new Color(0, 0, 255));
table.setCellpadding(5);
table.setCellspacing(5);
Cell cell = new Cell("header");
cell.setHeader(true);
cell.setColspan(3);
table.addCell(cell);
cell = new Cell("example cell with colspan 1 and rowspan 2");
cell.setRowspan(2);
cell.setBorderColor(new Color(255, 0, 0));
table.addCell(cell);
table.addCell("1.1");
table.addCell("2.1");
table.addCell("1.2");
table.addCell("2.2");
border, borderWidth, BOTTOM, BOX, LEFT, llx, lly, NO_BORDER, RIGHT, rotation, TOP, UNDEFINED, urx, uryALIGN_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 |
|---|
Cell()
Constructs an empty
Cell. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(Object o)
Add an
Object to this cell. |
float |
getBottom()
This method throws an
UnsupportedOperationException. |
ArrayList |
getChunks()
Gets all the chunks in this element.
|
int |
getColspan()
Gets the colspan.
|
Iterator |
getElements()
Gets an iterator of
Elements. |
boolean |
getGroupChange()
Does this
Cell force a group change? |
int |
getHorizontalAlignment()
Gets the horizontal alignment.
|
float |
getLeading()
Gets the leading.
|
float |
getLeft()
This method throws an
UnsupportedOperationException. |
int |
getMaxLines()
Getter for maxLines
|
float |
getRight()
This method throws an
UnsupportedOperationException. |
int |
getRowspan()
Gets the rowspan.
|
String |
getShowTruncation()
Getter for showTruncation
|
float |
getTop()
This method throws an
UnsupportedOperationException. |
int |
getVerticalAlignment()
Gets the vertical alignment.
|
float |
getWidth()
Gets the width.
|
String |
getWidthAsString()
Gets the width as a String.
|
boolean |
isEmpty()
Checks if the
Cell is empty. |
boolean |
isHeader()
Is this
Cell a header? |
boolean |
isTable()
Checks if this
Cell is a placeholder for a (nested) table. |
boolean |
isUseAscender()
Gets the value of useAscender
|
boolean |
isUseBorderPadding()
Gets the value of useBorderPadding.
|
boolean |
isUseDescender()
gets the value of useDescender
|
boolean |
process(ElementListener listener)
Processes the element by adding it (or the different parts) to an
ElementListener. |
void |
setBottom(int value)
This method throws an
UnsupportedOperationException. |
void |
setColspan(int value)
Sets the colspan.
|
void |
setGroupChange(boolean value)
Sets group change.
|
void |
setHeader(boolean value)
Sets header.
|
void |
setHorizontalAlignment(int value)
Sets the horizontal alignment.
|
void |
setHorizontalAlignment(String alignment)
Sets the alignment of this cell.
|
void |
setLeading(float value)
Sets the leading.
|
void |
setLeft(int value)
This method throws an
UnsupportedOperationException. |
void |
setMaxLines(int value)
Setter for maxLines
|
void |
setRight(int value)
This method throws an
UnsupportedOperationException. |
void |
setRowspan(int value)
Sets the rowspan.
|
void |
setShowTruncation(String value)
Setter for showTruncation
|
void |
setTop(int value)
This method throws an
UnsupportedOperationException. |
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.
|
void |
setVerticalAlignment(int value)
Sets the vertical alignment.
|
void |
setVerticalAlignment(String alignment)
Sets the alignment of this paragraph.
|
void |
setWidth(float value)
Sets the width.
|
void |
setWidth(String value)
Sets the width.
|
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, getGrayFill, getHeight, getLeft, getRight, getRotation, getTop, hasBorder, hasBorders, isContent, isNestable, isUseVariableBorders, normalize, rectangle, rotate, setBackgroundColor, setBorder, setBorderColor, setBorderColorBottom, setBorderColorLeft, setBorderColorRight, setBorderColorTop, setBorderWidth, setBorderWidthBottom, setBorderWidthLeft, setBorderWidthRight, setBorderWidthTop, setBottom, setGrayFill, setLeft, setRight, setTop, setUseVariableBorders, softCloneNonPositionParameters, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitisContent, isNestable, toStringpublic boolean process(ElementListener listener)
ElementListener.public int type()
public ArrayList getChunks()
public int getHorizontalAlignment()
public void setHorizontalAlignment(int value)
value - the new valuepublic void setHorizontalAlignment(String alignment)
alignment - the new alignment as a Stringpublic int getVerticalAlignment()
public void setVerticalAlignment(int value)
value - the new valuepublic void setVerticalAlignment(String alignment)
alignment - the new alignment as a Stringpublic void setWidth(float value)
value - the new valuepublic void setWidth(String value)
value - the new valuepublic float getWidth()
public String getWidthAsString()
public void setColspan(int value)
value - the new valuepublic int getColspan()
public void setRowspan(int value)
value - the new valuepublic int getRowspan()
public void setLeading(float value)
value - the new valuepublic float getLeading()
public void setHeader(boolean value)
value - the new valuepublic boolean isHeader()
Cell a header?public void setMaxLines(int value)
value - the maximum number of linespublic int getMaxLines()
public void setShowTruncation(String value)
value - Can be null for avoiding marking the truncation.public String getShowTruncation()
public void setUseAscender(boolean use)
use - use ascender height if truepublic boolean isUseAscender()
public void setUseDescender(boolean use)
use - use descender height if truepublic boolean isUseDescender()
public void setUseBorderPadding(boolean use)
use - adjust layout for borders if truepublic boolean isUseBorderPadding()
public boolean getGroupChange()
Cell force a group change?public void setGroupChange(boolean value)
value - the new valuepublic Iterator getElements()
Elements.Iterator.public boolean isEmpty()
Cell is empty.false if there are non-empty Elements in the Cell.public boolean isTable()
Cell is a placeholder for a (nested) table.public boolean add(Object o)
Object to this cell.add in interface TextElementArrayo - the object to addtruepublic float getTop()
UnsupportedOperationException.public float getBottom()
UnsupportedOperationException.public float getLeft()
UnsupportedOperationException.public float getRight()
UnsupportedOperationException.public void setTop(int value)
UnsupportedOperationException.value - NApublic void setBottom(int value)
UnsupportedOperationException.value - NApublic void setLeft(int value)
UnsupportedOperationException.value - NApublic void setRight(int value)
UnsupportedOperationException.value - NACopyright © 2021. All rights reserved.