DynamicPDF by ceTe Software

com.cete.dynamicpdf.pageelements
Class Table2

java.lang.Object
  extended by com.cete.dynamicpdf.PageElement
      extended by com.cete.dynamicpdf.pageelements.TaggablePageElement
          extended by com.cete.dynamicpdf.pageelements.RotatingPageElement
              extended by com.cete.dynamicpdf.pageelements.Table2
All Implemented Interfaces:
IArea, ICoordinate

public class Table2
extends RotatingPageElement
implements IArea, ICoordinate

This class can be used to create tables. A table must contain at least one Column and one Row with at least one Cell in that Row. Formatting of each cell in the table is done in a hierarchical manner in that a Cell's formatting take precedent over a Row's formatting which in term takes precedent over a Table's formatting. The column object contains no formatting information. Using the Tables getOverflowColumns and getOverflowRows methods you can allow your table to easily flow onto other pages.

Licensing:
This class is a DynamicPDF Generator Professional Edition feature. One of the following licenses is required for non-evaluation usage:

View Example


Constructor Summary
Table2(float x, float y, float width, float height)
          Initializes a new instance of the Table2 class.
Table2(float x, float y, float width, float height, Font font, float fontSize)
          Initializes a new instance of the Table2 class.
Table2(float x, float y, float width, float height, Font font, float fontSize, Color textColor, Color backColor)
          Initializes a new instance of the Table2 class.
 
Method Summary
protected  void drawRotated(PageWriter writer)
          Draws the table to the given PageWriter object.
 Color getBackgroundColor()
          Gets the Color object to use for the background of the table.
 Border getBorder()
          Gets the Border object to use for the border of the table.
 CellDefault getCellDefault()
          Gets the CellDefault object of the cells in the table.
 float getCellSpacing()
          Gets the cellspacing for the cells in the table.
 Column2List getColumns()
          Gets the Column2List object contained in the table.
 float getHeight()
          Gets the height of the table.
 Table2 getOverflowColumns()
          Returns a Table2 object containing the overflow columns.
 Table2 getOverflowColumns(float x, float y)
          Returns a Table2 object containing the overflow columns.
 Table2 getOverflowColumns(float x, float y, float width, float height)
          Returns a Table2 object containing the overflow columns.
 Table2 getOverflowRows()
          Returns a Table2 object containing the overflow rows.
 Table2 getOverflowRows(float x, float y)
          Returns a Table2 object containing the overflow rows.
 Table2 getOverflowRows(float x, float y, float width, float height)
          Returns a Table2 object containing the overflow rows.
 int getRepeatColumnHeaderCount()
          Gets the number of initial rows in the table that should also be drawn as the first rows on all subsequent row overflow tables.
 int getRepeatRowHeaderCount()
          Gets the number of columns that will be repeated as the row header.
 float getRequiredHeight()
          Returns the height required to vertically fit the entire table on the page.
 float getRequiredWidth()
          Returns the width required to horizontally fit the entire table on the page.
 Row2List getRows()
          Gets the Row2List object contained in the table.
 int getVisibleColumnCount()
          Returns the number of columns that will be displayed in the current table.
 float getVisibleHeight()
          Returns the actual height of the table that will be placed on the page.
 int getVisibleRowCount()
          Returns the number of rows that will be displayed in the current table.
 int getVisibleStartColumn()
          Returns the table staring column number.
 int getVisibleStartRow()
          Returns the table staring row number.
 float getVisibleWidth()
          Returns the actual width of the table that will be placed on the page.
 float getWidth()
          Gets the width of the table.
 boolean hasOverflowColumns()
          Returns a value indicating if there are columns remaining that will not be drawn to the table.
 boolean hasOverflowRows()
          Returns a value indicating if there are rows remaining that will not be drawn to the table.
 void setBackgroundColor(Color value)
          Sets the Color object to use for the background of the table.
 void setCellSpacing(float value)
          Sets the cellspacing for the cells in the table.
 void setHeight(float value)
          Sets the height of the table.
 void setRepeatColumnHeaderCount(int value)
          Sets the number of initial rows in the table that should also be drawn as the first rows on all subsequent row overflow tables.
 void setRepeatRowHeaderCount(int value)
          Sets the number of columns that will be repeated as the row header.
 void setWidth(float value)
          Sets the width of the table.
 
Methods inherited from class com.cete.dynamicpdf.pageelements.RotatingPageElement
draw, getAngle, getX, getY, setAngle, setX, setY
 
Methods inherited from class com.cete.dynamicpdf.pageelements.TaggablePageElement
getTag, getTagOrder, setTag, setTagOrder
 
Methods inherited from class com.cete.dynamicpdf.PageElement
getRequiredLicenseLevel, getStrID, setRequiredLicenseLevel, setStrID
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.cete.dynamicpdf.pageelements.ICoordinate
getX, getY, setX, setY
 

Constructor Detail

Table2

public Table2(float x,
              float y,
              float width,
              float height)
Initializes a new instance of the Table2 class.

Parameters:
x - X coordinate of the table.
y - Y coordinate of the table.
width - Width of the table.
height - Height of the table.

Table2

public Table2(float x,
              float y,
              float width,
              float height,
              Font font,
              float fontSize)
Initializes a new instance of the Table2 class.

Parameters:
x - X coordinate of the table.
y - Y coordinate of the table.
width - Width of the table.
height - Height of the table.
font - Font for the text in the table.
fontSize - Font size for the text in the table.

Table2

public Table2(float x,
              float y,
              float width,
              float height,
              Font font,
              float fontSize,
              Color textColor,
              Color backColor)
Initializes a new instance of the Table2 class.

Parameters:
x - X coordinate of the table.
y - Y coordinate of the table.
width - Width of the table.
height - Height of the table.
font - Font for the text in the table.
fontSize - Font size for the text in the table.
textColor - Color of the text in the table.
backColor - Background color of the table.
Method Detail

getOverflowRows

public Table2 getOverflowRows()
Returns a Table2 object containing the overflow rows. View Example

Returns:
a Table2 object.
See Also:
Table2

getOverflowRows

public Table2 getOverflowRows(float x,
                              float y)
Returns a Table2 object containing the overflow rows. View Example

Parameters:
x - X coordinate of the new table.
y - Y coordinate of the new table.
Returns:
A Table2 object.
See Also:
Table2

getOverflowRows

public Table2 getOverflowRows(float x,
                              float y,
                              float width,
                              float height)
Returns a Table2 object containing the overflow rows. View Example

Parameters:
x - X coordinate of the new table.
y - Y coordinate of the new table.
width - Width of the new table.
height - Height of the new table.
Returns:
A Table2 object.
See Also:
Table2

getVisibleStartRow

public int getVisibleStartRow()
Returns the table staring row number.

Returns:
the table staring row number.

getVisibleStartColumn

public int getVisibleStartColumn()
Returns the table staring column number.

Returns:
the table staring column number.

getOverflowColumns

public Table2 getOverflowColumns()
Returns a Table2 object containing the overflow columns. View Example

Returns:
a Table2

getOverflowColumns

public Table2 getOverflowColumns(float x,
                                 float y)
Returns a Table2 object containing the overflow columns. View Example

Parameters:
x - X coordinate of the new table.
y - Y coordinate of the new table.
Returns:
a Table2

getOverflowColumns

public Table2 getOverflowColumns(float x,
                                 float y,
                                 float width,
                                 float height)
Returns a Table2 object containing the overflow columns. View Example

Parameters:
x - X coordinate of the new table.
y - Y coordinate of the new table.
width - Width of the new table.
height - Height of the new table.
Returns:
a Table2

getVisibleWidth

public float getVisibleWidth()
Returns the actual width of the table that will be placed on the page.

Returns:
the actual width of the table that will be placed on the page.

getVisibleHeight

public float getVisibleHeight()
Returns the actual height of the table that will be placed on the page.

Returns:
the actual height of the table that will be placed on the page.

getRequiredWidth

public float getRequiredWidth()
Returns the width required to horizontally fit the entire table on the page.

Returns:
float The width to fit the entire table on the page horizontally.

getRequiredHeight

public float getRequiredHeight()
Returns the height required to vertically fit the entire table on the page.

Returns:
The height to fit the entire table on the page vertically.

hasOverflowRows

public boolean hasOverflowRows()
Returns a value indicating if there are rows remaining that will not be drawn to the table.

Returns:
boolean value indication whether or not overflow rows exists.

hasOverflowColumns

public boolean hasOverflowColumns()
Returns a value indicating if there are columns remaining that will not be drawn to the table.

Returns:
boolean value indication whether or not overflow columns exists.

getVisibleRowCount

public int getVisibleRowCount()
Returns the number of rows that will be displayed in the current table.

Returns:
The number are rows that will display.

getVisibleColumnCount

public int getVisibleColumnCount()
Returns the number of columns that will be displayed in the current table.

Returns:
The number are columns that will display.

getWidth

public float getWidth()
Gets the width of the table.

Specified by:
getWidth in interface IArea
Returns:
the width of the table.

setWidth

public void setWidth(float value)
Sets the width of the table.

Specified by:
setWidth in interface IArea
Parameters:
value - the width of the table.

getHeight

public float getHeight()
Gets the height of the table.

Specified by:
getHeight in interface IArea
Overrides:
getHeight in class RotatingPageElement
Returns:
the height of the table.

setHeight

public void setHeight(float value)
Sets the height of the table.

Specified by:
setHeight in interface IArea
Overrides:
setHeight in class RotatingPageElement
Parameters:
value - the height of the table.

getRows

public Row2List getRows()
Gets the Row2List object contained in the table.

Returns:
the row list.
See Also:
Row2List

getColumns

public Column2List getColumns()
Gets the Column2List object contained in the table.

Returns:
the column list.
See Also:
Column2List

getCellDefault

public CellDefault getCellDefault()
Gets the CellDefault object of the cells in the table.

Returns:
the cell default of the table.

getRepeatRowHeaderCount

public int getRepeatRowHeaderCount()
Gets the number of columns that will be repeated as the row header. This is set to 1 by default.

Returns:
the number of columns that will be repeated as the row header.

setRepeatRowHeaderCount

public void setRepeatRowHeaderCount(int value)
Sets the number of columns that will be repeated as the row header. This number is only considered if RepeatColumnHeader is set to true. This is set to 1 by default.

Parameters:
value - the number of columns that will be repeated as the row header.

getRepeatColumnHeaderCount

public int getRepeatColumnHeaderCount()
Gets the number of initial rows in the table that should also be drawn as the first rows on all subsequent row overflow tables. This is set to 0 by default.

Returns:
the number of rows that will be repeated as the column header.

setRepeatColumnHeaderCount

public void setRepeatColumnHeaderCount(int value)
Sets the number of initial rows in the table that should also be drawn as the first rows on all subsequent row overflow tables. This is set to 0 by default.

Parameters:
value - the number of rows that will be repeated as the column header.

getCellSpacing

public float getCellSpacing()
Gets the cellspacing for the cells in the table.

Returns:
the cellspacing for the cells in the table.

setCellSpacing

public void setCellSpacing(float value)
Sets the cellspacing for the cells in the table.

Parameters:
value - the cellspacing for the cells in the table.

getBorder

public Border getBorder()
Gets the Border object to use for the border of the table.

Returns:
the border for the cells in the table.

getBackgroundColor

public Color getBackgroundColor()
Gets the Color object to use for the background of the table.

Returns:
the background color for the cells in the table.
See Also:
Color

setBackgroundColor

public void setBackgroundColor(Color value)
Sets the Color object to use for the background of the table.

Parameters:
value - the background color for the cells in the table.
See Also:
Color

drawRotated

protected void drawRotated(PageWriter writer)
Draws the table to the given PageWriter object.

Specified by:
drawRotated in class RotatingPageElement
Parameters:
writer - PageWriter object to receive the table's output.
See Also:
PageWriter

DynamicPDF by ceTe Software

API Reference for DynamicPDF v10.04 for Java generated on September 25, 2019
© Copyright 2019, ceTe Software