- java.lang.Object
-
- com.lowagie.text.Row
-
- All Implemented Interfaces:
WithHorizontalAlignment,Element
public class Row extends Object implements Element, WithHorizontalAlignment
ARowis part of aTableand contains someCells.All
Rows are constructed by aTable-object. You don't have to construct anyRowyourself. In fact you can't construct aRowoutside the package.Since a
Cellcan span several rows and/or columns a row can contain reserved space without any content.
-
-
Field Summary
Fields Modifier and Type Field Description static intCELLid of the Cell element in a Rowprotected TableRectangle[]cellsThis is the array of Objects (CellorTable).protected intcolumnsThis is the number of columns in theRow.protected intcurrentColumnThis is a valid position theRow.protected inthorizontalAlignmentThis is the vertical alignment.static intNULLid of a null element in a Rowprotected boolean[]reservedThis is the array that keeps track of reserved cells.static intTABLEid of the Table element in a Row-
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, 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, MODIFICATIONDATE, MULTI_COLUMN_TEXT, PARAGRAPH, PHRASE, PRODUCER, PTABLE, RECTANGLE, ROW, SECTION, SUBJECT, TITLE, YMARK
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedRow(int columns)Constructs aRowwith a certain number of columns.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TableRectanglegetCell(int column)Gets aCellorTablefrom a certain column.ArrayList<Element>getChunks()Gets all the chunks in this element.intgetColumns()Gets the number of columns.intgetHorizontalAlignment()Gets the horizontal alignment.booleanisContent()Checks if this element is a content object.booleanisEmpty()Checks if the row is empty.booleanisNestable()Checks if this element is nestable.booleanprocess(ElementListener listener)Processes the element by adding it (or the different parts) to aElementListener.voidsetHorizontalAlignment(HorizontalAlignment alignment)Sets horizontal alignment mode.inttype()Gets the type of the text element.
-
-
-
Field Detail
-
NULL
public static final int NULL
id of a null element in a Row- See Also:
- Constant Field Values
-
CELL
public static final int CELL
id of the Cell element in a Row- See Also:
- Constant Field Values
-
TABLE
public static final int TABLE
id of the Table element in a Row- See Also:
- Constant Field Values
-
columns
protected int columns
This is the number of columns in theRow.
-
currentColumn
protected int currentColumn
This is a valid position theRow.
-
reserved
protected boolean[] reserved
This is the array that keeps track of reserved cells.
-
cells
protected TableRectangle[] cells
This is the array of Objects (CellorTable).
-
horizontalAlignment
protected int horizontalAlignment
This is the vertical alignment.
-
-
Method Detail
-
process
public boolean process(ElementListener listener)
Processes the element by adding it (or the different parts) to aElementListener.
-
type
public int type()
Gets the type of the text element.
-
isContent
public boolean isContent()
Description copied from interface:ElementChecks if this element is a content object. If not, it's a metadata object.- Specified by:
isContentin interfaceElement- Returns:
- true if this is a 'content' element; false if this is a 'metadata' element
- Since:
- iText 2.0.8
- See Also:
Element.isContent()
-
isNestable
public boolean isNestable()
Description copied from interface:ElementChecks if this element is nestable.- Specified by:
isNestablein interfaceElement- Returns:
- true if this element can be nested inside other elements.
- Since:
- iText 2.0.8
- See Also:
Element.isNestable()
-
getCell
public TableRectangle getCell(int column)
Gets aCellorTablefrom a certain column.- Parameters:
column- the column theCell/Tableis in.- Returns:
- the
Cell,Tableor Object if the column was reserved or null if empty.
-
isEmpty
public boolean isEmpty()
Checks if the row is empty.- Returns:
trueif none of the columns is reserved.
-
getColumns
public int getColumns()
Gets the number of columns.- Returns:
- a value
-
getHorizontalAlignment
public int getHorizontalAlignment()
Gets the horizontal alignment.- Returns:
- a value
-
setHorizontalAlignment
public void setHorizontalAlignment(HorizontalAlignment alignment)
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
-
-