|
ElegantJ PDF Library Java API Specification v1.1 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.elegantj.pdf.PDFTable
This class represents a table object
| Constructor Summary | |
PDFTable(int x,
int y,
int w,
int h)
Constructs a PDF table object |
|
PDFTable(int x,
int y,
int w,
int h,
int rowCount,
int columnCount)
Constructs a PDF table object |
|
| Method Summary | |
java.awt.Rectangle |
getCellRect(int row,
int column)
Method for taking cell rect at specified row, column position |
int |
getColumnCount()
Method which returns the number of columns for the table |
java.util.Vector |
getColumnWidths()
Method which returns the widths of the columns of the table |
int |
getDefaultAlignment()
Method which returns the default alignment of the PDFTable |
java.awt.Color |
getDefaultBackground()
Method which returns the default background for the PDFTable |
PDFPattern |
getDefaultBackgroundPattern()
Returns the PDFTable background pattern |
PDFFont |
getDefaultFont()
Method which returns the default font of the PDFTable |
java.awt.Color |
getDefaultForeground()
Method which returns the default background for the PDFTable |
int |
getRowCount()
Method which returns the number of rows for the table |
java.util.Vector |
getRowHeights()
Method which returns the heights of the rows of the table |
java.lang.String |
getValueAt(int row,
int column)
Method which returns the text value of a specified cell |
protected java.util.Vector |
makeTable()
Method which makes the table |
void |
setCellAlignmentAt(int rowIndex,
int columnIndex,
int alignment)
Method which sets the alignment for the text of the cell at the specified row and column |
void |
setCellBackgroundAt(int rowIndex,
int columnIndex,
java.awt.Color background)
Method which sets the background color of a specified cell |
void |
setCellBackgroundPatternAt(int rowIndex,
int columnIndex,
PDFPattern pattern)
Method which sets the background pattern of a specified cell |
void |
setCellFontAt(int rowIndex,
int columnIndex,
PDFFont font,
int fontSize)
Method which sets the font of a specified cell |
void |
setCellForegroundAt(int rowIndex,
int columnIndex,
java.awt.Color foreground)
Method which sets the foreground color of a specified cell |
void |
setColumnAlignmentAt(int columnIndex,
int alignment)
Method which sets the alignment for the text of the row at the specified columnIndex |
void |
setColumnBackgroundAt(int index,
java.awt.Color background)
Method which sets the background color of a specified column |
void |
setColumnBackgroundPatternAt(int index,
PDFPattern pattern)
Method which sets the background pattern of a specified column |
void |
setColumnCount(int nCols)
Method which sets the number of columns for the table |
void |
setColumnFontAt(int index,
PDFFont font,
int fontSize)
Method which sets the font of a specified column |
void |
setColumnForegroundAt(int index,
java.awt.Color foreground)
Method which sets the foreground color of a specified column |
void |
setColumnWidthAt(int index,
int columnWidth)
Method which sets the width of the specified column of the table |
void |
setColumnWidths(java.util.Vector columnWidths)
Method which sets the widths of each columns of the table Using this method, one can set width of individual columns specified in vector |
void |
setData(java.util.Vector data)
Method which sets the data for the PDFTable |
void |
setDefaultAlignment(int alignment)
Method which sets the default alignment for the whole table |
void |
setDefaultBackground(java.awt.Color background)
Method which sets the default background for the PDFTable |
void |
setDefaultBackgroundPattern(PDFPattern pattern)
Method which sets the PDFPattern as a default background of the PDFTable |
void |
setDefaultFont(PDFFont font,
int fontSize)
Method which sets the default font of the PDFTable |
void |
setDefaultForeground(java.awt.Color foreground)
Method which sets the default foreground for the PDFTable |
void |
setOutlineColor(java.awt.Color outLineColor)
Method which sets the color of the outline of the table |
void |
setOutlineWidth(int w)
Method which sets the width of the outline of the table |
void |
setRowAlignmentAt(int rowIndex,
int alignment)
Method which sets the alignment for the text of the row at the specified rowIndex |
void |
setRowBackgroundAt(int index,
java.awt.Color background)
Method which sets the background color of a specified row |
void |
setRowBackgroundPatternAt(int index,
PDFPattern pattern)
Method which sets the background pattern of a specified row |
void |
setRowCount(int nRows)
Method which sets the number of rows for the table |
void |
setRowFontAt(int index,
PDFFont font,
int fontSize)
Method which sets the font of a specified row |
void |
setRowForegroundAt(int index,
java.awt.Color foreground)
Method which sets the foreground color of a specified row |
void |
setRowHeightAt(int index,
int rowHeight)
Method which sets the height of the specified row of the table |
void |
setRowHeights(java.util.Vector rowHeights)
Method which sets the height of each rows of the table Using this method, one can set height of individual rows specified in vector |
void |
setValueAt(java.lang.String value,
int row,
int column)
Method which sets the text value of a specified cell |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public PDFTable(int x,
int y,
int w,
int h)
x - The X-coordinate of the tabley - The Y-coordinate of the tablew - The width of the tableh - The height of the table
public PDFTable(int x,
int y,
int w,
int h,
int rowCount,
int columnCount)
x - The X-coordinate of the tabley - The Y-coordinate of the tablew - The width of the tableh - The height of the tablerowCount - Number of rows in the tablecolumnCount - Number of columns in the table| Method Detail |
public void setOutlineWidth(int w)
w - The width of the outline of the tablepublic void setOutlineColor(java.awt.Color outLineColor)
outLineColor - The outLine color the outline of the tablepublic void setRowCount(int nRows)
nRows - The number of rows for the tablepublic int getRowCount()
public void setColumnCount(int nCols)
nCols - The number of columns for the tablepublic int getColumnCount()
public void setRowHeights(java.util.Vector rowHeights)
public void setRowHeightAt(int index,
int rowHeight)
index - The index of the row of the tablerowHeight - The height of the row of the tablepublic java.util.Vector getRowHeights()
public void setColumnWidths(java.util.Vector columnWidths)
columnWidths - A vector containing the width of each columns of the table
Example: Following is a vector containing width of a column: Vector columnWidthVect = new Vector(); columnWidth.addElement(new Integer(20));
public void setColumnWidthAt(int index,
int columnWidth)
index - The index of the column of the tablecolumnWidth - The width of the column of the tablepublic java.util.Vector getColumnWidths()
public void setValueAt(java.lang.String value,
int row,
int column)
value - A string containing text value of cellrow - The row index of the cellcolumn - The column index of the cell
If the text contains the \r or \n then it will be
considered by Text containing by the PDFTable cell
public java.lang.String getValueAt(int row,
int column)
row - The row index of the cellcolumn - The column index of the cell
public void setData(java.util.Vector data)
data - The Vector of the data
Example:
Data for the 2 Row and 3 Column as below
Vector data = new Vector();
vector row1 = new Vector();
row1.addElement("row1");
row1.addElement("row1");
row1.addElement("row1");
data.addElement(row1);
vector row2 = new Vector();
row2.addElement("row2");
row2.addElement("row2");
row2.addElement("row2");
data.addElement(row2);
public void setCellBackgroundAt(int rowIndex,
int columnIndex,
java.awt.Color background)
rowIndex - The row index of the cellcolumnIndex - The column index of the cellbackground - The background
public void setColumnBackgroundAt(int index,
java.awt.Color background)
index - The index of the columnbackground - The background color
public void setRowBackgroundAt(int index,
java.awt.Color background)
index - The index of the rowbackground - The background colorpublic void setDefaultBackground(java.awt.Color background)
background - The background colorpublic java.awt.Color getDefaultBackground()
public void setCellBackgroundPatternAt(int rowIndex,
int columnIndex,
PDFPattern pattern)
rowIndex - The row index of the cellcolumnIndex - The column index of the cellpattern - The PDFPattern
public void setColumnBackgroundPatternAt(int index,
PDFPattern pattern)
index - The index of the columnpattern - The PDFPattern
public void setRowBackgroundPatternAt(int index,
PDFPattern pattern)
index - The index of the rowpattern - The PDFPatternpublic void setDefaultBackgroundPattern(PDFPattern pattern)
pattern - The PDFPattern as a default background of the PDFTablepublic PDFPattern getDefaultBackgroundPattern()
public void setCellForegroundAt(int rowIndex,
int columnIndex,
java.awt.Color foreground)
rowIndex - The row index of the cellcolumnIndex - The column index of the cellforeground - The foreground color
public void setColumnForegroundAt(int index,
java.awt.Color foreground)
index - The index of the columnforeground - The foreground color
public void setRowForegroundAt(int index,
java.awt.Color foreground)
index - The index of the rowpublic void setDefaultForeground(java.awt.Color foreground)
foreground - The foreground colorpublic java.awt.Color getDefaultForeground()
public void setCellFontAt(int rowIndex,
int columnIndex,
PDFFont font,
int fontSize)
rowIndex - The row index of the cellcolumnIndex - The column index of the cellfont - font for the cellfontSize - The font size for the cell
public void setColumnFontAt(int index,
PDFFont font,
int fontSize)
index - The index of the columnfont - font for the columnfontSize - The font size for the column
public void setRowFontAt(int index,
PDFFont font,
int fontSize)
index - The index of the rowfont - font for the rowfontSize - The font size for the row
public void setDefaultFont(PDFFont font,
int fontSize)
font - font for the PDFTablefontSize - The font size for the PDFTablepublic PDFFont getDefaultFont()
public void setCellAlignmentAt(int rowIndex,
int columnIndex,
int alignment)
rowIndex - The index of the rowcolumnIndex - The index of the columnalignment - The specified alignment
The possible values for alignment are PDFText.LEFT, PDFText.RIGHT, PDFText.CENTER, PDFText.JUSTIFY
public void setRowAlignmentAt(int rowIndex,
int alignment)
rowIndex - The specified row indexalignment - The specified alignment
The possible values for alignment are PDFText.LEFT, PDFText.RIGHT, PDFText.CENTER, PDFText.JUSTIFY
public void setColumnAlignmentAt(int columnIndex,
int alignment)
columnIndex - The specified column indexalignment - The specified alignment
The possible values for alignment are PDFText.LEFT, PDFText.RIGHT, PDFText.CENTER, PDFText.JUSTIFYpublic void setDefaultAlignment(int alignment)
alignment - The specified alignment
The possible values for alignment are PDFText.LEFT, PDFText.RIGHT, PDFText.CENTER, PDFText.JUSTIFYpublic int getDefaultAlignment()
protected java.util.Vector makeTable()
public java.awt.Rectangle getCellRect(int row,
int column)
row - The row indexcolumn - The column index
|
ElegantJ PDF Library Java API Specification v1.1 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||