ElegantJ PDF Library Java API Specification v1.1

com.elegantj.pdf
Class PDFTable

java.lang.Object
  extended bycom.elegantj.pdf.PDFTable

public class PDFTable
extends java.lang.Object

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

PDFTable

public PDFTable(int x,
                int y,
                int w,
                int h)
Constructs a PDF table object

Parameters:
x - The X-coordinate of the table
y - The Y-coordinate of the table
w - The width of the table
h - The height of the table

PDFTable

public PDFTable(int x,
                int y,
                int w,
                int h,
                int rowCount,
                int columnCount)
Constructs a PDF table object

Parameters:
x - The X-coordinate of the table
y - The Y-coordinate of the table
w - The width of the table
h - The height of the table
rowCount - Number of rows in the table
columnCount - Number of columns in the table
Method Detail

setOutlineWidth

public void setOutlineWidth(int w)
Method which sets the width of the outline of the table

Parameters:
w - The width of the outline of the table

setOutlineColor

public void setOutlineColor(java.awt.Color outLineColor)
Method which sets the color of the outline of the table

Parameters:
outLineColor - The outLine color the outline of the table

setRowCount

public void setRowCount(int nRows)
Method which sets the number of rows for the table

Parameters:
nRows - The number of rows for the table

getRowCount

public int getRowCount()
Method which returns the number of rows for the table

Returns:
The number of rows for the table

setColumnCount

public void setColumnCount(int nCols)
Method which sets the number of columns for the table

Parameters:
nCols - The number of columns for the table

getColumnCount

public int getColumnCount()
Method which returns the number of columns for the table

Returns:
The number of columns for the table

setRowHeights

public 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


setRowHeightAt

public void setRowHeightAt(int index,
                           int rowHeight)
Method which sets the height of the specified row of the table

Parameters:
index - The index of the row of the table
rowHeight - The height of the row of the table

getRowHeights

public java.util.Vector getRowHeights()
Method which returns the heights of the rows of the table

Returns:
A vector containing the heights of the rows of the table

setColumnWidths

public 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

Parameters:
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));
	

setColumnWidthAt

public void setColumnWidthAt(int index,
                             int columnWidth)
Method which sets the width of the specified column of the table

Parameters:
index - The index of the column of the table
columnWidth - The width of the column of the table

getColumnWidths

public java.util.Vector getColumnWidths()
Method which returns the widths of the columns of the table

Returns:
A vector containing the widths of the columns of the table

setValueAt

public void setValueAt(java.lang.String value,
                       int row,
                       int column)
Method which sets the text value of a specified cell

Parameters:
value - A string containing text value of cell
row - The row index of the cell
column - 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

getValueAt

public java.lang.String getValueAt(int row,
                                   int column)
Method which returns the text value of a specified cell

Parameters:
row - The row index of the cell
column - The column index of the cell
Returns:
A string containing text value of cell

setData

public void setData(java.util.Vector data)
Method which sets the data for the PDFTable

Parameters:
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);
	

setCellBackgroundAt

public void setCellBackgroundAt(int rowIndex,
                                int columnIndex,
                                java.awt.Color background)
Method which sets the background color of a specified cell

Parameters:
rowIndex - The row index of the cell
columnIndex - The column index of the cell
background - The background

setColumnBackgroundAt

public void setColumnBackgroundAt(int index,
                                  java.awt.Color background)
Method which sets the background color of a specified column

Parameters:
index - The index of the column
background - The background color

setRowBackgroundAt

public void setRowBackgroundAt(int index,
                               java.awt.Color background)
Method which sets the background color of a specified row

Parameters:
index - The index of the row
background - The background color

setDefaultBackground

public void setDefaultBackground(java.awt.Color background)
Method which sets the default background for the PDFTable

Parameters:
background - The background color

getDefaultBackground

public java.awt.Color getDefaultBackground()
Method which returns the default background for the PDFTable

Returns:
The default background for the PDFTable

setCellBackgroundPatternAt

public void setCellBackgroundPatternAt(int rowIndex,
                                       int columnIndex,
                                       PDFPattern pattern)
Method which sets the background pattern of a specified cell

Parameters:
rowIndex - The row index of the cell
columnIndex - The column index of the cell
pattern - The PDFPattern

setColumnBackgroundPatternAt

public void setColumnBackgroundPatternAt(int index,
                                         PDFPattern pattern)
Method which sets the background pattern of a specified column

Parameters:
index - The index of the column
pattern - The PDFPattern

setRowBackgroundPatternAt

public void setRowBackgroundPatternAt(int index,
                                      PDFPattern pattern)
Method which sets the background pattern of a specified row

Parameters:
index - The index of the row
pattern - The PDFPattern

setDefaultBackgroundPattern

public void setDefaultBackgroundPattern(PDFPattern pattern)
Method which sets the PDFPattern as a default background of the PDFTable

Parameters:
pattern - The PDFPattern as a default background of the PDFTable

getDefaultBackgroundPattern

public PDFPattern getDefaultBackgroundPattern()
Returns the PDFTable background pattern

Returns:
The PDFTable background pattern

setCellForegroundAt

public void setCellForegroundAt(int rowIndex,
                                int columnIndex,
                                java.awt.Color foreground)
Method which sets the foreground color of a specified cell

Parameters:
rowIndex - The row index of the cell
columnIndex - The column index of the cell
foreground - The foreground color

setColumnForegroundAt

public void setColumnForegroundAt(int index,
                                  java.awt.Color foreground)
Method which sets the foreground color of a specified column

Parameters:
index - The index of the column
foreground - The foreground color

setRowForegroundAt

public void setRowForegroundAt(int index,
                               java.awt.Color foreground)
Method which sets the foreground color of a specified row

Parameters:
index - The index of the row

setDefaultForeground

public void setDefaultForeground(java.awt.Color foreground)
Method which sets the default foreground for the PDFTable

Parameters:
foreground - The foreground color

getDefaultForeground

public java.awt.Color getDefaultForeground()
Method which returns the default background for the PDFTable

Returns:
The default background for the PDFTable

setCellFontAt

public void setCellFontAt(int rowIndex,
                          int columnIndex,
                          PDFFont font,
                          int fontSize)
Method which sets the font of a specified cell

Parameters:
rowIndex - The row index of the cell
columnIndex - The column index of the cell
font - font for the cell
fontSize - The font size for the cell

setColumnFontAt

public void setColumnFontAt(int index,
                            PDFFont font,
                            int fontSize)
Method which sets the font of a specified column

Parameters:
index - The index of the column
font - font for the column
fontSize - The font size for the column

setRowFontAt

public void setRowFontAt(int index,
                         PDFFont font,
                         int fontSize)
Method which sets the font of a specified row

Parameters:
index - The index of the row
font - font for the row
fontSize - The font size for the row

setDefaultFont

public void setDefaultFont(PDFFont font,
                           int fontSize)
Method which sets the default font of the PDFTable

Parameters:
font - font for the PDFTable
fontSize - The font size for the PDFTable

getDefaultFont

public PDFFont getDefaultFont()
Method which returns the default font of the PDFTable

Returns:
The default font of the PDFTable

setCellAlignmentAt

public 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

Parameters:
rowIndex - The index of the row
columnIndex - The index of the column
alignment - The specified alignment The possible values for alignment are PDFText.LEFT, PDFText.RIGHT, PDFText.CENTER, PDFText.JUSTIFY

setRowAlignmentAt

public void setRowAlignmentAt(int rowIndex,
                              int alignment)
Method which sets the alignment for the text of the row at the specified rowIndex

Parameters:
rowIndex - The specified row index
alignment - The specified alignment The possible values for alignment are PDFText.LEFT, PDFText.RIGHT, PDFText.CENTER, PDFText.JUSTIFY

setColumnAlignmentAt

public void setColumnAlignmentAt(int columnIndex,
                                 int alignment)
Method which sets the alignment for the text of the row at the specified columnIndex

Parameters:
columnIndex - The specified column index
alignment - The specified alignment The possible values for alignment are PDFText.LEFT, PDFText.RIGHT, PDFText.CENTER, PDFText.JUSTIFY

setDefaultAlignment

public void setDefaultAlignment(int alignment)
Method which sets the default alignment for the whole table

Parameters:
alignment - The specified alignment The possible values for alignment are PDFText.LEFT, PDFText.RIGHT, PDFText.CENTER, PDFText.JUSTIFY

getDefaultAlignment

public int getDefaultAlignment()
Method which returns the default alignment of the PDFTable

Returns:
The default alignment of the PDFTable

makeTable

protected java.util.Vector makeTable()
Method which makes the table


getCellRect

public java.awt.Rectangle getCellRect(int row,
                                      int column)
Method for taking cell rect at specified row, column position

Parameters:
row - The row index
column - The column index

ElegantJ PDF Library Java API Specification v1.1

For any feedback, suggestion, or query, please revert back to support@elegantjpdf.com

Copyright(c)
Elegant Microweb Technologies Pvt. Ltd.
www.elegantmicroweb.com
www.elegantjpdf.com
All Rights Reserved.