java.lang.Object
com.lowagie.text.Rectangle
com.lowagie.text.TableRectangle
com.lowagie.text.Cell
- All Implemented Interfaces:
WithHorizontalAlignment,WithVerticalAlignment,Element,TextElementArray
@Deprecated
public class Cell
extends TableRectangle
implements TextElementArray, WithHorizontalAlignment, WithVerticalAlignment
Deprecated.
A
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");
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionDeprecated.TheArrayListofElements that are part of the content of the Cell.protected intDeprecated.The colspan of the cell.protected booleanDeprecated.Does thisCellforce a group change?protected booleanDeprecated.Is thisCella header?protected intDeprecated.The horizontal alignment of the cell content.protected intDeprecated.Maximum number of lines allowed in the cell.protected booleanDeprecated.protected intDeprecated.The rowspan of the cell.protected booleanDeprecated.Indicates that the largest ascender height should be used to determine the height of the first line.protected booleanDeprecated.Adjusts the cell contents to compensate for border widths.protected booleanDeprecated.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).protected intDeprecated.The vertical alignment of the cell content.protected floatDeprecated.The width of the cell as a String.Fields inherited from class com.lowagie.text.Rectangle
backgroundColor, border, borderColor, borderColorBottom, borderColorLeft, borderColorRight, borderColorTop, borderWidth, borderWidthBottom, borderWidthLeft, borderWidthRight, borderWidthTop, BOTTOM, BOX, LEFT, llx, lly, NO_BORDER, offsetToTop, RIGHT, rotation, TOP, UNDEFINED, urx, ury, useVariableBordersFields 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, CCITT_BLACKIS1, CCITT_ENCODEDBYTEALIGN, CCITT_ENDOFBLOCK, CCITT_ENDOFLINE, CCITTG3_1D, CCITTG3_2D, CCITTG4, CELL, CHAPTER, CHUNK, CREATIONDATE, CREATOR, FOOTNOTE, HEADER, IMGRAW, IMGTEMPLATE, JBIG2, JPEG, JPEG2000, KEYWORDS, LIST, LISTITEM, MARKED, MODIFICATIONDATE, MULTI_COLUMN_TEXT, PARAGRAPH, PHRASE, PRODUCER, PTABLE, RECTANGLE, ROW, SECTION, SUBJECT, TABLE, TITLE, YMARK -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanDeprecated.Add anObjectto this cell.voidaddElement(Element element) Deprecated.Adds an element to thisCell.floatbottom(int margin) Deprecated.This method throws anUnsupportedOperationException.voidclear()Deprecated.Clears all theElements of thisCell.Deprecated.Creates a PdfPCell based on this Cell object.floatDeprecated.This method throws anUnsupportedOperationException.Deprecated.Gets all the chunks in this element.intDeprecated.Gets the colspan.Deprecated.Gets an iterator ofElements.booleanDeprecated.Does thisCellforce a group change?intDeprecated.Gets the horizontal alignment.floatDeprecated.Gets the leading.floatgetLeft()Deprecated.This method throws anUnsupportedOperationException.intDeprecated.Getter for maxLinesfloatgetRight()Deprecated.This method throws anUnsupportedOperationException.intDeprecated.Gets the rowspan.Deprecated.Getter for showTruncationfloatgetTop()Deprecated.This method throws anUnsupportedOperationException.intDeprecated.Gets the vertical alignment.floatgetWidth()Deprecated.Gets the width.Deprecated.Gets the width as a String.booleanisEmpty()Deprecated.Checks if theCellis empty.booleanisHeader()Deprecated.Is thisCella header?booleanisTable()Deprecated.Checks if thisCellis a placeholder for a (nested) table.booleanDeprecated.Gets the value of useAscenderbooleanDeprecated.Gets the value of useBorderPadding.booleanDeprecated.gets the value of useDescenderfloatleft(int margin) Deprecated.This method throws anUnsupportedOperationException.booleanprocess(ElementListener listener) Deprecated.Processes the element by adding it (or the different parts) to anElementListener.floatright(int margin) Deprecated.This method throws anUnsupportedOperationException.voidsetBottom(int value) Deprecated.This method throws anUnsupportedOperationException.voidsetColspan(int value) Deprecated.Sets the colspan.voidsetGroupChange(boolean value) Deprecated.Sets group change.voidsetHeader(boolean value) Deprecated.Sets header.voidsetHorizontalAlignment(HorizontalAlignment alignment) Deprecated.Sets horizontal alignment mode.voidsetLeading(float value) Deprecated.Sets the leading.voidsetLeft(int value) Deprecated.This method throws anUnsupportedOperationException.voidsetMaxLines(int value) Deprecated.Setter for maxLinesvoidsetRight(int value) Deprecated.This method throws anUnsupportedOperationException.voidsetRowspan(int value) Deprecated.Sets the rowspan.voidsetShowTruncation(String value) Deprecated.Setter for showTruncationvoidsetTop(int value) Deprecated.This method throws anUnsupportedOperationException.voidsetUseAscender(boolean use) Deprecated.Sets the value of useAscender.voidsetUseBorderPadding(boolean use) Deprecated.Sets the value of useBorderPadding.voidsetUseDescender(boolean use) Deprecated.Sets the value of useDescender.voidsetVerticalAlignment(VerticalAlignment alignment) Deprecated.Sets vertical alignment mode.voidsetWidth(float value) Deprecated.Sets the width.voidDeprecated.Sets the width.intsize()Deprecated.Gets the number ofElements in the Cell.floattop(int margin) Deprecated.This method throws anUnsupportedOperationException.inttype()Deprecated.Gets the type of the text element.Methods inherited from class com.lowagie.text.Rectangle
cloneNonPositionParameters, disableBorderSide, enableBorderSide, getBackgroundColor, getBorder, getBorderColor, getBorderColorBottom, getBorderColorLeft, getBorderColorRight, getBorderColorTop, getBorderWidth, getBorderWidthBottom, getBorderWidthLeft, getBorderWidthRight, getBorderWidthTop, getBottom, getGrayFill, getHeight, getLeft, getRelativeTop, 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, setRelativeTop, setRight, setRotation, setTop, setUseVariableBorders, softCloneNonPositionParameters, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.lowagie.text.Element
isContent, isNestable, toString
-
Field Details
-
arrayList
Deprecated.TheArrayListofElements that are part of the content of the Cell. -
horizontalAlignment
protected int horizontalAlignmentDeprecated.The horizontal alignment of the cell content. -
verticalAlignment
protected int verticalAlignmentDeprecated.The vertical alignment of the cell content. -
width
protected float widthDeprecated.The width of the cell as a String. It can be an absolute value "100" or a percentage "20%". -
percentage
protected boolean percentageDeprecated. -
colspan
protected int colspanDeprecated.The colspan of the cell. -
rowspan
protected int rowspanDeprecated.The rowspan of the cell. -
header
protected boolean headerDeprecated.Is thisCella header? -
maxLines
protected int maxLinesDeprecated.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) -
useAscender
protected boolean useAscenderDeprecated.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. -
useDescender
protected boolean useDescenderDeprecated.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. -
useBorderPadding
protected boolean useBorderPaddingDeprecated.Adjusts the cell contents to compensate for border widths. Note that this only has an effect when rendered to PDF. -
groupChange
protected boolean groupChangeDeprecated.Does thisCellforce a group change?
-
-
Constructor Details
-
Cell
public Cell()Deprecated.Constructs an emptyCell. -
Cell
public Cell(boolean dummy) Deprecated.Constructs an emptyCell(for internal use only).- Parameters:
dummy- a dummy value
-
Cell
Deprecated.Constructs aCellwith a certain content.The
Stringwill be converted into aParagraph.- Parameters:
content- aString
-
Cell
Deprecated.Constructs aCellwith a certainElement.if the element is a
ListItem,RoworCell, an exception will be thrown.- Parameters:
element- the element- Throws:
BadElementException- when the creator was called with aListItem,RoworCell
-
-
Method Details
-
process
Deprecated.Processes the element by adding it (or the different parts) to anElementListener. -
type
public int type()Deprecated.Gets the type of the text element. -
getChunks
Deprecated.Gets all the chunks in this element. -
getHorizontalAlignment
public int getHorizontalAlignment()Deprecated.Gets the horizontal alignment.- Returns:
- a value
-
setHorizontalAlignment
Deprecated.Description copied from interface:WithHorizontalAlignmentSets horizontal alignment mode.- Specified by:
setHorizontalAlignmentin interfaceWithHorizontalAlignment- Parameters:
alignment- New alignment mode. If null, current alignment must be left unchanged
-
getVerticalAlignment
public int getVerticalAlignment()Deprecated.Gets the vertical alignment.- Returns:
- a value
-
setVerticalAlignment
Deprecated.Description copied from interface:WithVerticalAlignmentSets vertical alignment mode.- Specified by:
setVerticalAlignmentin interfaceWithVerticalAlignment- Parameters:
alignment- New alignment mode. If null, current alignment must be left unchanged
-
getWidth
public float getWidth()Deprecated.Gets the width. -
setWidth
public void setWidth(float value) Deprecated.Sets the width.- Parameters:
value- the new value
-
setWidth
Deprecated.Sets the width. It can be an absolute value "100" or a percentage "20%"- Parameters:
value- the new value
-
getWidthAsString
Deprecated.Gets the width as a String.- Returns:
- a value
-
getColspan
public int getColspan()Deprecated.Gets the colspan.- Returns:
- a value
-
setColspan
public void setColspan(int value) Deprecated.Sets the colspan.- Parameters:
value- the new value
-
getRowspan
public int getRowspan()Deprecated.Gets the rowspan.- Returns:
- a value
-
setRowspan
public void setRowspan(int value) Deprecated.Sets the rowspan.- Parameters:
value- the new value
-
getLeading
public float getLeading()Deprecated.Gets the leading.- Returns:
- a value
-
setLeading
public void setLeading(float value) Deprecated.Sets the leading.- Parameters:
value- the new value
-
isHeader
public boolean isHeader()Deprecated.Is thisCella header?- Returns:
- a value
-
setHeader
public void setHeader(boolean value) Deprecated.Sets header.- Parameters:
value- the new value
-
getMaxLines
public int getMaxLines()Deprecated.Getter for maxLines- Returns:
- the maxLines value
-
setMaxLines
public void setMaxLines(int value) Deprecated.Setter for maxLines- Parameters:
value- the maximum number of lines
-
getShowTruncation
Deprecated.Getter for showTruncation- Returns:
- the showTruncation value
-
setShowTruncation
Deprecated.Setter for showTruncation- Parameters:
value- Can be null for avoiding marking the truncation.
-
isUseAscender
public boolean isUseAscender()Deprecated.Gets the value of useAscender- Returns:
- useAscender
-
setUseAscender
public void setUseAscender(boolean use) Deprecated.Sets the value of useAscender.- Parameters:
use- use ascender height if true
-
isUseDescender
public boolean isUseDescender()Deprecated.gets the value of useDescender- Returns:
- useDescender
-
setUseDescender
public void setUseDescender(boolean use) Deprecated.Sets the value of useDescender.- Parameters:
use- use descender height if true
-
isUseBorderPadding
public boolean isUseBorderPadding()Deprecated.Gets the value of useBorderPadding.- Returns:
- useBorderPadding
-
setUseBorderPadding
public void setUseBorderPadding(boolean use) Deprecated.Sets the value of useBorderPadding.- Parameters:
use- adjust layout for borders if true
-
getGroupChange
public boolean getGroupChange()Deprecated.Does thisCellforce a group change?- Returns:
- a value
-
setGroupChange
public void setGroupChange(boolean value) Deprecated.Sets group change.- Parameters:
value- the new value
-
size
public int size()Deprecated.Gets the number ofElements in the Cell.- Returns:
- a
size.
-
getElements
Deprecated.Gets an iterator ofElements.- Returns:
- an
Iterator.
-
clear
public void clear()Deprecated.Clears all theElements of thisCell. -
isEmpty
public boolean isEmpty()Deprecated.Checks if theCellis empty.- Returns:
falseif there are non-emptyElements in theCell.
-
isTable
public boolean isTable()Deprecated.Checks if thisCellis a placeholder for a (nested) table.- Returns:
- true if the only element in this cell is a table
-
addElement
Deprecated.Adds an element to thisCell.Remark: you can't add
ListItems,Rows,Cells,JPEGs,GIFs orPNGs to aCell.- Parameters:
element- TheElementto add- Throws:
BadElementException- if the method was called with aListItem,RoworCell
-
add
Deprecated.Add anObjectto this cell.- Specified by:
addin interfaceTextElementArray- Parameters:
o- the object to add- Returns:
- always
true
-
createPdfPCell
Deprecated.Creates a PdfPCell based on this Cell object.- Returns:
- a PdfPCell
- Throws:
BadElementException- on error
-
getTop
public float getTop()Deprecated.This method throws anUnsupportedOperationException. -
setTop
public void setTop(int value) Deprecated.This method throws anUnsupportedOperationException.- Parameters:
value- NA
-
getBottom
public float getBottom()Deprecated.This method throws anUnsupportedOperationException. -
setBottom
public void setBottom(int value) Deprecated.This method throws anUnsupportedOperationException.- Parameters:
value- NA
-
getLeft
public float getLeft()Deprecated.This method throws anUnsupportedOperationException. -
setLeft
public void setLeft(int value) Deprecated.This method throws anUnsupportedOperationException.- Parameters:
value- NA
-
getRight
public float getRight()Deprecated.This method throws anUnsupportedOperationException. -
setRight
public void setRight(int value) Deprecated.This method throws anUnsupportedOperationException.- Parameters:
value- NA
-
top
public float top(int margin) Deprecated.This method throws anUnsupportedOperationException.- Parameters:
margin- NA- Returns:
- NA
-
bottom
public float bottom(int margin) Deprecated.This method throws anUnsupportedOperationException.- Parameters:
margin- NA- Returns:
- NA
-
left
public float left(int margin) Deprecated.This method throws anUnsupportedOperationException.- Parameters:
margin- NA- Returns:
- NA
-
right
public float right(int margin) Deprecated.This method throws anUnsupportedOperationException.- Parameters:
margin- NA- Returns:
- NA
-