aspose.pdf
Class Cell

java.lang.Object
  extended by aspose.pdf.Cell

public class Cell
extends java.lang.Object

Represents a cell in a Table.

Typical usages are the following:

[Java] Pdf pdf1 = new Pdf(); Section sec1 = pdf1.getSections().add(); aspose.pdf.Table table1 = new aspose.pdf.Table(); sec1.getParagraphs().add(table1); table1.setColumnWidths("70 2cm"); Row row1 = table1.getRows().add(); Cell cell1Row1 = row1.getCells().add("ColumnsSpan = 2"); cell1Row1.setColumnsSpan(2); cell1Row1.setBorder(new BorderInfo(BorderSide.All.getValue(), 0.5F)); Row row2 = table1.getRows().add(); Cell cell1Row2 = row2.getCells().add("cell1"); cell1Row2.setBorder(new BorderInfo(BorderSide.All.getValue(), 0.5F)); Cell cell2Row2 = row2.getCells().add("cell2"); cell2Row2.setBorder(new BorderInfo(BorderSide.All.getValue(), 0.5F, new aspose.pdf.Color("Red"))); pdf1.save(...); [XML] <?xml version="1.0" encoding="utf-8" ?> <Pdf xmlns="Aspose.Pdf"> <Section> <Table ColumnWidths="70 2cm"> <Row> <Cell ColumnsSpan="2"> <Border> <All LineWidth="0.5"></All> </Border> <Text> <Segment>ColumnsSpan = 2</Segment> </Text> </Cell> </Row> <Row> <Cell> <Border> <All LineWidth="0.5"></All> </Border> <Text> <Segment>cell1</Segment> </Text> </Cell> <Cell> <Border> <All LineWidth="0.5" Color="Red"></All> </Border> <Text> <Segment>cell2</Segment> </Text> </Cell> </Row> </Table> </Section> </Pdf>


Field Summary
 boolean isVerticalAlignmentSet
           
 float MinWidth
          Gets minimum cell width according to its content.
 
Constructor Summary
Cell()
          Constructor - initializes a new instance of the Cell class.
Cell(Row row)
          Constructor - initializes a new instance of the Cell class in a table.
Cell(Table table)
          Constructor - initializes a new instance of the Cell class in a table.
 
Method Summary
 java.lang.Object clone()
          Clones a new Cell object.
 java.lang.Object completeClone()
          Clones a new Cell object.
 AlignmentType getAlignment()
          Gets a AlignmentType Object that indicates the alignment type of the cell.
 Color getBackgroundColor()
          Gets a Color object that indicates the background color of the cell.
 BorderInfo getBorder()
          Gets a BorderInfo object that indicates the cell's border info.
 int getColumnIndex()
          Gets an int value that indicates the column index.
 int getColumnNumber()
          Gets an int value that indicates the number of the column.
 int getColumnsSpan()
          Gets an int value that indicates how many columns the cell spans.
 TextInfo getDefaultCellTextInfo()
          Gets a TextInfo object that indicates the default cell text format info.
 MarginInfo getDefaultPadding()
          The place for border.
 float getFitWidth()
          Deprecated. Please use Table.getColumnWidths() instead.
 float getHeight()
          Gets a float value that indicates the height of the cell.
 java.lang.String getID()
          Gets a String that indicates the ID of the cell.
 boolean getIsBorderSetbyUser()
          Gets a boolean value indicates whether border has been set by user.
 boolean getIsPositionGot()
          Gets a boolean value indicates whether position has been gotten.
 boolean getIsPositionProcessed()
          Gets a boolean value indicates whether position has been processed.
 boolean getIsVerticalTextsInCell()
          get VerticalTextsInCell
 MarginInfo getPadding()
          Gets a MarginInfo object that indicates the cell's padding.
 Paragraphs getParagraphs()
          Gets a Paragraphs collection that indicates all paragraphs in the cell.
 float getPosX()
          Gets a float value that indicates the x-coordinate of beginning position of the cell.
 float getPosY()
          Gets a float value that indicates the y-coordinate of beginning position of the cell.
 Row getRow()
          Gets a Row object that contains the cell.
 int getRowSpan()
          Gets an int value that indicates how many rows the cell spans.
 Table getTable()
          Gets a Table object that contains the cell.
 VerticalAlignmentType getVerticalAlignment()
          Gets a VerticalAlignmentType object that indicates the vertical alignment type.
 VerticalTextRotationType getVerticalTextRotationAngle()
          Gets a VerticalTextRotationType object that indicates the text rotation angle in floating box or cells.
 float getWidth()
          Gets a float value that indicates the width of the cell.
 boolean isNoBorder()
          Gets a boolean value that indicates whether the cell have borders.
 boolean isTemp()
          Gets a boolean value indicates whether it is temporarily.
 void setAlignment(AlignmentType cellAlign)
          Sets a AlignmentType Object that indicates the alignment type of the cell.
 void setBackgroundColor(Color backColor)
          Sets a Color object that indicates the background color of the cell.
 void setBorder(BorderInfo cellBorder)
          Sets a BorderInfo object that indicates the cell's border info.
 void setColumnIndex(int columnIndex)
          Sets an int value that indicates the column index.
 void setColumnNumber(int columnNum)
          Sets an int value that indicates the number of the column.
 void setColumnsSpan(int spanCols)
          Sets an int value that indicates how many columns the cell spans.
 void setDefaultCellTextInfo(TextInfo defaultCellsTextInfo)
          Sets a TextInfo object that indicates the default cell text format info.
 void setFitWidth(float fitWidth)
          Deprecated. Please use Table.setColumnWidths() instead.
 void setHeight(float cellHeight)
          Sets a float value that indicates the height of the cell.
 void setID(java.lang.String cellID)
          Sets a String that indicates the ID of the cell.
 void setIsBorderSetbyUser(boolean isBorderSetbyUser)
          Sets a boolean value indicates whether border is set by user.
 void setIsPositionGot(boolean isPositionGot)
          Sets a boolean value indicates whether position has been gotten.
 void setIsPositionProcessed(boolean isPositionProcessed)
          Sets a boolean value indicates whether position has been processed.
 void setIsVerticalTextsInCell(boolean isVerticalTextsInCell)
          set isVerticalTextsInCell value
 void setNoBorder(boolean isNoBorder)
          Sets a boolean value that indicates whether the cell have borders.
 void setPadding(MarginInfo cellPadding)
          Sets a MarginInfo object that indicates the cell's padding.
 void setParagraphs(Paragraphs cellParas)
          Sets a Paragraphs collection that indicates all paragraphs in the cell.
 void setPosX(float posX)
          Sets a float value that indicates the x-coordinate of beginning position of the cell.
 void setPosY(float posY)
          Sets a float value that indicates the y-coordinate of beginning position of the cell.
 void setRow(Row parentRow)
          Sets a Row object that contains the cell.
 void setRowSpan(int rowSpan)
          Sets an int value that indicates how many rows the cell spans.
 void setTable(Table tab)
          Sets a Table object that contains the cell.
 void setTemp(boolean isTemp)
          Sets a boolean value indicates whether it is temporarily.
 void setVerticalAlignment(VerticalAlignmentType verticalAlignment)
          Sets a VerticalAlignmentType object that indicates the vertical alignment type.
 void setVerticalTextRotationAngle(VerticalTextRotationType verticalAngle)
          Sets a VerticalTextRotationType object that indicates the text rotation angle in floating box or cells.
 void setWidth(float cellWidth)
          Sets a float value that indicates the width of the cell.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

isVerticalAlignmentSet

public boolean isVerticalAlignmentSet

MinWidth

public float MinWidth
Gets minimum cell width according to its content.

Constructor Detail

Cell

public Cell()
Constructor - initializes a new instance of the Cell class.


Cell

public Cell(Table table)
Constructor - initializes a new instance of the Cell class in a table.

Parameters:
table - The Table object where the cell is in.

Cell

public Cell(Row row)
Constructor - initializes a new instance of the Cell class in a table.

Parameters:
row - The Row object where the cell is in.
Method Detail

getIsBorderSetbyUser

public boolean getIsBorderSetbyUser()
Gets a boolean value indicates whether border has been set by user.

Returns:
A boolean value.

setIsBorderSetbyUser

public void setIsBorderSetbyUser(boolean isBorderSetbyUser)
Sets a boolean value indicates whether border is set by user.

Parameters:
isBorderSetbyUser - A boolean value.

getBorder

public BorderInfo getBorder()
Gets a BorderInfo object that indicates the cell's border info.

Returns:
A BorderInfo object.

setBorder

public void setBorder(BorderInfo cellBorder)
Sets a BorderInfo object that indicates the cell's border info.

Parameters:
cellBorder - A BorderInfo object.

isNoBorder

public boolean isNoBorder()
Gets a boolean value that indicates whether the cell have borders.

Returns:
A boolean value.

setNoBorder

public void setNoBorder(boolean isNoBorder)
Sets a boolean value that indicates whether the cell have borders.

Parameters:
isNoBorder - Boolean value.

getBackgroundColor

public Color getBackgroundColor()
Gets a Color object that indicates the background color of the cell.

Returns:
A Color object.

setBackgroundColor

public void setBackgroundColor(Color backColor)
Sets a Color object that indicates the background color of the cell.

Parameters:
backColor - Color object.

getPadding

public MarginInfo getPadding()
Gets a MarginInfo object that indicates the cell's padding.

Returns:
A MarginInfo object.

setPadding

public void setPadding(MarginInfo cellPadding)
Sets a MarginInfo object that indicates the cell's padding.

Parameters:
cellPadding - A MarginInfo object.

getDefaultPadding

public MarginInfo getDefaultPadding()
The place for border.

Returns:
An MarginInfo object.

getIsPositionProcessed

public boolean getIsPositionProcessed()
Gets a boolean value indicates whether position has been processed.

Returns:
A boolean value.

setIsPositionProcessed

public void setIsPositionProcessed(boolean isPositionProcessed)
Sets a boolean value indicates whether position has been processed.

Parameters:
isPositionProcessed - A boolean value.

getPosX

public float getPosX()
Gets a float value that indicates the x-coordinate of beginning position of the cell.

Returns:
A float value.

setPosX

public void setPosX(float posX)
Sets a float value that indicates the x-coordinate of beginning position of the cell.

Parameters:
posX - A float value.

getPosY

public float getPosY()
Gets a float value that indicates the y-coordinate of beginning position of the cell.

Returns:
A float value.

setPosY

public void setPosY(float posY)
Sets a float value that indicates the y-coordinate of beginning position of the cell.

Parameters:
posY - A float value.

getColumnNumber

public int getColumnNumber()
Gets an int value that indicates the number of the column.

Returns:
An int value.

setColumnNumber

public void setColumnNumber(int columnNum)
Sets an int value that indicates the number of the column.

Parameters:
columnNum - An int value.

getColumnIndex

public int getColumnIndex()
Gets an int value that indicates the column index.

Returns:
An int value.

setColumnIndex

public void setColumnIndex(int columnIndex)
Sets an int value that indicates the column index.

Parameters:
columnIndex - An int value.

getFitWidth

public float getFitWidth()
Deprecated. Please use Table.getColumnWidths() instead.

Gets a float value that indicates the fit width of the cell. The unit is point. In XML, the default unit is point,but cm and inch are also supported. For example, FitWidth="2cm" or FitWidth="2inch".

Returns:
A float value.

setFitWidth

public void setFitWidth(float fitWidth)
Deprecated. Please use Table.setColumnWidths() instead.

Sets a float value that indicates the fit width of the cell.

Parameters:
fitWidth - A float value.

getWidth

public float getWidth()
Gets a float value that indicates the width of the cell.

Returns:
A float value.

setWidth

public void setWidth(float cellWidth)
Sets a float value that indicates the width of the cell.

Parameters:
cellWidth - A float value.

getHeight

public float getHeight()
Gets a float value that indicates the height of the cell.

Returns:
A float value.

setHeight

public void setHeight(float cellHeight)
Sets a float value that indicates the height of the cell.

Parameters:
cellHeight - A float value.

getParagraphs

public Paragraphs getParagraphs()
Gets a Paragraphs collection that indicates all paragraphs in the cell.

Returns:
A Paragraphs object.

setParagraphs

public void setParagraphs(Paragraphs cellParas)
Sets a Paragraphs collection that indicates all paragraphs in the cell.

Parameters:
cellParas - A Paragraphs object.

getID

public java.lang.String getID()
Gets a String that indicates the ID of the cell.

Returns:
A String value.

setID

public void setID(java.lang.String cellID)
Sets a String that indicates the ID of the cell.

Parameters:
cellID - A String value.

getTable

public Table getTable()
Gets a Table object that contains the cell.

Returns:
A Table value.

setTable

public void setTable(Table tab)
Sets a Table object that contains the cell.

Parameters:
tab - A Table object.

getRow

public Row getRow()
Gets a Row object that contains the cell.

Returns:
A Row object.

setRow

public void setRow(Row parentRow)
Sets a Row object that contains the cell.

Parameters:
parentRow - A Row object.

getColumnsSpan

public int getColumnsSpan()
Gets an int value that indicates how many columns the cell spans.

Returns:
An int value.

setColumnsSpan

public void setColumnsSpan(int spanCols)
Sets an int value that indicates how many columns the cell spans.

Parameters:
spanCols - An int value.

getDefaultCellTextInfo

public TextInfo getDefaultCellTextInfo()
Gets a TextInfo object that indicates the default cell text format info.

Returns:
A TextInfo object.

setDefaultCellTextInfo

public void setDefaultCellTextInfo(TextInfo defaultCellsTextInfo)
Sets a TextInfo object that indicates the default cell text format info.

Parameters:
defaultCellsTextInfo - A TextInfo object.

getIsVerticalTextsInCell

public boolean getIsVerticalTextsInCell()
get VerticalTextsInCell

Returns:
A boolen value;

setIsVerticalTextsInCell

public void setIsVerticalTextsInCell(boolean isVerticalTextsInCell)
set isVerticalTextsInCell value

Parameters:
isVerticalTextsInCell - A boolean value.

getVerticalTextRotationAngle

public VerticalTextRotationType getVerticalTextRotationAngle()
Gets a VerticalTextRotationType object that indicates the text rotation angle in floating box or cells.

Returns:
A VerticalTextRotationType object.

setVerticalTextRotationAngle

public void setVerticalTextRotationAngle(VerticalTextRotationType verticalAngle)
Sets a VerticalTextRotationType object that indicates the text rotation angle in floating box or cells.

Parameters:
verticalAngle - A VerticalTextRotationType object.

getVerticalAlignment

public VerticalAlignmentType getVerticalAlignment()
Gets a VerticalAlignmentType object that indicates the vertical alignment type.

Returns:
A VerticalAlignmentType object.

setVerticalAlignment

public void setVerticalAlignment(VerticalAlignmentType verticalAlignment)
Sets a VerticalAlignmentType object that indicates the vertical alignment type.

Parameters:
verticalAlignment - VerticalAlignmentType object.

isTemp

public boolean isTemp()
Gets a boolean value indicates whether it is temporarily.

Returns:
A boolean value.

setTemp

public void setTemp(boolean isTemp)
Sets a boolean value indicates whether it is temporarily.

Parameters:
isTemp - A boolean value.

getRowSpan

public int getRowSpan()
Gets an int value that indicates how many rows the cell spans.

Returns:
An int value.

setRowSpan

public void setRowSpan(int rowSpan)
Sets an int value that indicates how many rows the cell spans.

Parameters:
rowSpan - An int value.

clone

public java.lang.Object clone()

Clones a new Cell object. This method clones only the format but not contents of the cell.

Overrides:
clone in class java.lang.Object
Returns:
The new cloned Cell object.

completeClone

public java.lang.Object completeClone()

Clones a new Cell object. This method clones both format and contents of the cell.

Returns:
The new cloned Cell object.

getAlignment

public AlignmentType getAlignment()
Gets a AlignmentType Object that indicates the alignment type of the cell.

Returns:
A AlignmentType object.

setAlignment

public void setAlignment(AlignmentType cellAlign)
Sets a AlignmentType Object that indicates the alignment type of the cell.

Parameters:
cellAlign - A AlignmentType object.

getIsPositionGot

public boolean getIsPositionGot()
Gets a boolean value indicates whether position has been gotten.

Returns:
A boolean value.

setIsPositionGot

public void setIsPositionGot(boolean isPositionGot)
Sets a boolean value indicates whether position has been gotten.

Parameters:
isPositionGot - A boolean value.