![]() | |
| Prev Class | Next Class | Frames | No Frames |
| Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Objectcom.lowagie.text.Rectanglecom.lowagie.text.CellCell 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");
Field Summary | |
protected ArrayList |
|
protected int |
|
protected boolean |
|
protected boolean |
|
protected int |
|
(package private) float |
|
protected int |
|
protected int |
|
(package private) String |
|
protected boolean |
|
protected boolean |
|
protected boolean |
|
protected int |
|
protected String |
|
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, HEADER, IMGRAW, IMGTEMPLATE, JPEG, KEYWORDS, LIST, LISTITEM, MARKED, MULTI_COLUMN_TEXT, PARAGRAPH, PHRASE, PRODUCER, PTABLE, RECTANGLE, ROW, SECTION, SUBJECT, TABLE, TITLE | |
Constructor Summary | |
| |
| |
| |
| |
Method Summary | |
boolean |
|
void |
|
float |
|
float |
|
String |
|
void |
|
int |
|
PdfPCell |
|
(package private) void |
|
ArrayList |
|
static Cell |
|
Iterator |
|
boolean |
|
int |
|
String |
|
boolean |
|
int |
|
boolean |
|
boolean |
|
static boolean |
|
boolean |
|
boolean |
|
boolean |
|
float |
|
float |
|
float |
|
boolean |
|
boolean |
|
float |
|
float |
|
int |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
int |
|
float |
|
float |
|
int |
|
int |
|
protected ArrayList arrayList
This is theArrayListofElements.
protected int colspan
This is the colspan.
protected boolean groupChange
Does thisCellforce a group change?
protected boolean header
Is thisCella header?
protected int horizontalAlignment
This is the horizontal alignment.
(package private) float leading
This is the leading.
protected int maxLines
Maximum number of lines allowed in the cell. The default value of this property is not to limit the maximum number of lines (contributed by dperezcar@fcc.es)
protected int rowspan
This is the rowspan.
(package private) String showTruncation
If a truncation happens due to themaxLinesproperty, then this text will be added to indicate a truncation has happened. Default value is null, and means avoiding marking the truncation. A useful value of this property could be e.g. "..." (contributed by dperezcar@fcc.es)
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.
protected boolean useBorderPadding
Adjusts the cell contents to compensate for border widths. Note that this only has an effect when rendered to PDF.
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.
protected int verticalAlignment
This is the vertical alignment.
protected String width
This is the vertical alignment.
public Cell()
Constructs an emptyCell.
public Cell(Properties attributes)
Returns aCellthat has been constructed taking in account the value of some attributes.
- Parameters:
attributes- Some attributes
public Cell(String content)
Constructs aCellwith a certain content. TheStringwill be converted into aParagraph.
- Parameters:
content- aString
public Cell(boolean dummy)
Constructs an emptyCell(for internal use only).
- Parameters:
dummy- a dummy value
public Cell(Element element) throws BadElementException
Constructs aCellwith a certainElement. if the element is aListItem,RoworCell, an exception will be thrown.
- Parameters:
element- the element
- Throws:
BadElementException- when the creator was called with aListItem,RoworCell
public boolean add(Object o)
Add anObjectto this cell.
- Specified by:
- add in interface TextElementArray
- Parameters:
o- the object to add
- Returns:
- always
true
public void addElement(Element element) throws BadElementException
Adds an element to thisCell. Remark: you can't addListItems,Rows,Cells,JPEGs,GIFs orPNGs to aCell.
- Parameters:
element- TheElementto add
- Throws:
BadElementException- if the method was called with aListItem,RoworCell
public float bottom()
This method throws anUnsupportedOperationException.
- Returns:
- NA
public float bottom(int margin)
This method throws anUnsupportedOperationException.
- Parameters:
margin-
- Returns:
- NA
public String cellWidth()
Gets the width.
- Returns:
- a value
public void clear()
Clears all theElements of thisCell.
public int colspan()
Gets the colspan.
- Returns:
- a value
public PdfPCell createPdfPCell() throws BadElementException
Creates a PdfPCell based on this Cell object.
- Returns:
- a PdfPCell
- Throws:
BadElementException-
(package private) void fill()
Makes sure there is at least 1 object in the Cell. Otherwise it might not be shown in the table.
public ArrayList getChunks()
Gets all the chunks in this element.
- Returns:
- an
ArrayList
public static Cell getDummyCell()
Get dummy cell used when merging inner tables.
- Returns:
- a cell with colspan 3 and no border
public Iterator getElements()
Gets an iterator ofElements.
- Returns:
- an
Iterator.
public boolean getGroupChange()
Does thisCellforce a group change?
- Returns:
- a value
public String getShowTruncation()
Getter forshowTruncation
- Returns:
- the showTruncation value
public boolean header()
Is thisCella header?
- Returns:
- a value
public int horizontalAlignment()
Gets the horizontal alignment.
- Returns:
- a value
public boolean isEmpty()
Checks if theCellis empty.
- Returns:
falseif there are non-emptyElements in theCell.
public boolean isTable()
Checks if theCellis empty.
- Returns:
falseif there are non-emptyElements in theCell.
public static boolean isTag(String tag)
Checks if a given tag corresponds with this object.
- Parameters:
tag- the given tag
- Returns:
- true if the tag corresponds
public boolean isUseBorderPadding()
Gets the value ofuseBorderPadding.
- Returns:
- useBorderPadding
public float leading()
Gets the leading.
- Returns:
- a value
public float left()
This method throws anUnsupportedOperationException.
- Returns:
- NA
public float left(int margin)
This method throws anUnsupportedOperationException.
- Parameters:
margin-
- Returns:
- NA
public boolean noWrap()
Get nowrap.
- Returns:
- a value
public boolean process(ElementListener listener)
Processes the element by adding it (or the different parts) to anElementListener.
- Parameters:
listener- anElementListener
- Returns:
trueif the element was processed successfully
public float right()
This method throws anUnsupportedOperationException.
- Returns:
- NA
public float right(int margin)
This method throws anUnsupportedOperationException.
- Parameters:
margin- NA
- Returns:
- NA
public int rowspan()
Gets the rowspan.
- Returns:
- a value
public void setBottom(int value)
This method throws anUnsupportedOperationException.
- Parameters:
value- NA
public void setColspan(int value)
Sets the colspan.
- Parameters:
value- the new value
public void setGroupChange(boolean value)
Sets group change.
- Parameters:
value- the new value
public void setHeader(boolean value)
Sets header.
- Parameters:
value- the new value
public void setHorizontalAlignment(String alignment)
Sets the alignment of this cell.
- Parameters:
alignment- the new alignment as aString
public void setHorizontalAlignment(int value)
Sets the horizontal alignment.
- Parameters:
value- the new value
public void setLeading(float value)
Sets the leading.
- Parameters:
value- the new value
public void setLeft(int value)
This method throws anUnsupportedOperationException.
- Parameters:
value- NA
public void setMaxLines(int value)
Setter formaxLines
- Parameters:
value- the maximum number of lines
public void setNoWrap(boolean value)
Set nowrap.
- Parameters:
value- the new value
public void setRight(int value)
This method throws anUnsupportedOperationException.
- Parameters:
value- NA
public void setRowspan(int value)
Sets the rowspan.
- Parameters:
value- the new value
public void setShowTruncation(String value)
Setter forshowTruncation
- Parameters:
value- Can be null for avoiding marking the truncation.
public void setTop(int value)
This method throws anUnsupportedOperationException.
- Parameters:
value- NA
public void setUseAscender(boolean use)
Sets the value ofuseAscender.
- Parameters:
use- use ascender height if true
public void setUseBorderPadding(boolean use)
Sets the value ofuseBorderPadding.
- Parameters:
use- adjust layour for borders if true
public void setUseDescender(boolean use)
Sets the value ofuseDescender.
- Parameters:
use- use descender height if true
public void setVerticalAlignment(String alignment)
Sets the alignment of this paragraph.
- Parameters:
alignment- the new alignment as aString
public void setVerticalAlignment(int value)
Sets the vertical alignment.
- Parameters:
value- the new value
public void setWidth(String value)
Sets the width.
- Parameters:
value- the new value
public int size()
Gets the number ofElements in the Cell.
- Returns:
- a
size.
public float top()
This method throws anUnsupportedOperationException.
- Returns:
- NA
public float top(int margin)
This method throws anUnsupportedOperationException.
- Parameters:
margin-
- Returns:
- NA
public int type()
Gets the type of the text element.
- Returns:
- a type
public int verticalAlignment()
Gets the vertical alignment.
- Returns:
- a value