jdbreport.model
Class ReportRow

java.lang.Object
  extended by jdbreport.model.ReportRow
All Implemented Interfaces:
Iterable<Cell>, TableRow
Direct Known Subclasses:
TemplateRow

public class ReportRow
extends Object
implements TableRow

Version:
2.0 12.05.2011
Author:
Andrey Kholmanskih

Field Summary
protected  ArrayList<Cell> colList
           
protected  TableCellRenderer headerRenderer
          The renderer used to draw the header of the row.
protected  Object headerValue
          The header value of the row.
 
Constructor Summary
ReportRow()
           
ReportRow(int colcount)
           
 
Method Summary
 void addColumn(Cell cellItem)
           
 void addColumn(int index)
          Inserts the null cell at the specified position in this row
 void addColumn(int index, Cell cellItem)
          Inserts the Cell at the specified position in this row
 void addPropertyChangeListener(PropertyChangeListener listener)
          Adds a PropertyChangeListener to the listener list.
 Cell createCellItem(int column)
          Creates a new Cell for specified column in the current row
protected  Cell createDefaultCell()
           
protected  TableCellRenderer createDefaultHeaderRenderer()
           
 Cell getCellItem(int column)
           
 int getColCount()
           
protected  Units getDefaultUnit()
           
 RowsGroup getGroup()
          Returns parental group
 TableCellRenderer getHeaderRenderer()
          Returns renderer for the row's header
 Object getHeaderValue()
          Returns the value of the row's header
 int getHeight()
           
 float getNativeHeight()
           
protected  Cell getNullCell()
           
 PropertyChangeListener[] getPropertyChangeListeners()
          Returns an array of all the PropertyChangeListeners added to this TableRow with addPropertyChangeListener().
 boolean isNull()
          If true, the row is null
 boolean isPageBreak()
          Returns true if this row is the end of the page.
 boolean isPageHeader()
          Determines an accessory of a row to page heading
 Iterator<Cell> iterator()
          Returns an iterator over the cells in this row in proper sequence.
 Cell removeCell(int index)
          Replaces the cell at the specified position by NullCell
 Cell removeColumn(int index)
          Removes the cell at the specified position in this row Makes the columns' count smaller
 void removePropertyChangeListener(PropertyChangeListener listener)
          Removes a PropertyChangeListener from the listener list.
 void setCellItem(Cell cellItem, int column)
          Sets Cell for specified column
 void setColCount(int value)
          Sets column's count
 void setHeaderRenderer(TableCellRenderer headerRenderer)
          Sets the TableCellRenderer used to draw the TableRow's header to headerRenderer.
 void setHeaderValue(Object headerValue)
          Sets the Object whose string representation will be used as the value for the headerRenderer.
 void setHeight(float h)
           
 void setHeight(int height)
          Sets the row's height
 void setHeight(int height, boolean dragging)
          Sets the row's height when resizing
 void setPageBreak(boolean end)
          Sets pageBreak property
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

headerValue

protected Object headerValue
The header value of the row.


headerRenderer

protected TableCellRenderer headerRenderer
The renderer used to draw the header of the row.


colList

protected ArrayList<Cell> colList
Constructor Detail

ReportRow

public ReportRow(int colcount)

ReportRow

public ReportRow()
Method Detail

getNullCell

protected Cell getNullCell()

getDefaultUnit

protected Units getDefaultUnit()

getHeight

public int getHeight()
Specified by:
getHeight in interface TableRow
Returns:
row's height in pixels

getNativeHeight

public float getNativeHeight()
Specified by:
getNativeHeight in interface TableRow
Returns:
row's height in points

setHeight

public void setHeight(int height)
Description copied from interface: TableRow
Sets the row's height

Specified by:
setHeight in interface TableRow
Parameters:
height - new row's height

setHeight

public void setHeight(int height,
                      boolean dragging)
Description copied from interface: TableRow
Sets the row's height when resizing

Specified by:
setHeight in interface TableRow
Parameters:
height - new row's height

addColumn

public void addColumn(int index)
Description copied from interface: TableRow
Inserts the null cell at the specified position in this row

Specified by:
addColumn in interface TableRow
Parameters:
index - index at which the column is to be inserted.

addColumn

public void addColumn(Cell cellItem)

addColumn

public void addColumn(int index,
                      Cell cellItem)
Description copied from interface: TableRow
Inserts the Cell at the specified position in this row

Specified by:
addColumn in interface TableRow
Parameters:
index - index at which the specified Cell is to be inserted.
cellItem - Cell to be inserted.

removeColumn

public Cell removeColumn(int index)
Description copied from interface: TableRow
Removes the cell at the specified position in this row Makes the columns' count smaller

Specified by:
removeColumn in interface TableRow
Parameters:
index - the index of the cell to removed.
Returns:
the Cell previously at the specified position.

removeCell

public Cell removeCell(int index)
Description copied from interface: TableRow
Replaces the cell at the specified position by NullCell

Specified by:
removeCell in interface TableRow
Parameters:
index - the index of the cell to removed.
Returns:
the Cell previously at the specified position.

getCellItem

public Cell getCellItem(int column)
Specified by:
getCellItem in interface TableRow
Returns:
Cell for specified column

setCellItem

public void setCellItem(Cell cellItem,
                        int column)
Description copied from interface: TableRow
Sets Cell for specified column

Specified by:
setCellItem in interface TableRow
Parameters:
cellItem - - a new Cell
column - the column's index

getColCount

public int getColCount()
Specified by:
getColCount in interface TableRow
Returns:
column's count

setColCount

public void setColCount(int value)
Description copied from interface: TableRow
Sets column's count

Specified by:
setColCount in interface TableRow

getHeaderRenderer

public TableCellRenderer getHeaderRenderer()
Description copied from interface: TableRow
Returns renderer for the row's header

Specified by:
getHeaderRenderer in interface TableRow
Returns:
TableCellRenderer

setHeaderRenderer

public void setHeaderRenderer(TableCellRenderer headerRenderer)
Sets the TableCellRenderer used to draw the TableRow's header to headerRenderer.

Parameters:
headerRenderer - the new headerRenderer

getHeaderValue

public Object getHeaderValue()
Description copied from interface: TableRow
Returns the value of the row's header

Specified by:
getHeaderValue in interface TableRow
Returns:
the value of the row's header

setHeaderValue

public void setHeaderValue(Object headerValue)
Sets the Object whose string representation will be used as the value for the headerRenderer. When the TableRow is created, the default headerValue is null.

Specified by:
setHeaderValue in interface TableRow
Parameters:
headerValue - the new headerValue

addPropertyChangeListener

public void addPropertyChangeListener(PropertyChangeListener listener)
Description copied from interface: TableRow
Adds a PropertyChangeListener to the listener list.

Specified by:
addPropertyChangeListener in interface TableRow
Parameters:
listener - the PropertyChangeListener to be added

removePropertyChangeListener

public void removePropertyChangeListener(PropertyChangeListener listener)
Removes a PropertyChangeListener from the listener list. The PropertyChangeListener to be removed was registered for all properties.

Specified by:
removePropertyChangeListener in interface TableRow
Parameters:
listener - the listener to be removed

getPropertyChangeListeners

public PropertyChangeListener[] getPropertyChangeListeners()
Returns an array of all the PropertyChangeListeners added to this TableRow with addPropertyChangeListener().

Returns:
all of the PropertyChangeListeners added or an empty array if no listeners have been added

createDefaultHeaderRenderer

protected TableCellRenderer createDefaultHeaderRenderer()
Returns:
the default header renderer

isNull

public boolean isNull()
Description copied from interface: TableRow
If true, the row is null

Specified by:
isNull in interface TableRow
Returns:
if true, the row is null

isPageBreak

public boolean isPageBreak()
Description copied from interface: TableRow
Returns true if this row is the end of the page.

Specified by:
isPageBreak in interface TableRow
Returns:
pageBreak property

setPageBreak

public void setPageBreak(boolean end)
Description copied from interface: TableRow
Sets pageBreak property

Specified by:
setPageBreak in interface TableRow
Parameters:
end - if true, the sets horizontal page break after row

createDefaultCell

protected Cell createDefaultCell()

createCellItem

public Cell createCellItem(int column)
Description copied from interface: TableRow
Creates a new Cell for specified column in the current row

Specified by:
createCellItem in interface TableRow
Returns:
created Cell

setHeight

public void setHeight(float h)
Parameters:
h - - new height of a row in 1/72 of inches

iterator

public Iterator<Cell> iterator()
Description copied from interface: TableRow
Returns an iterator over the cells in this row in proper sequence.

Specified by:
iterator in interface Iterable<Cell>
Specified by:
iterator in interface TableRow
Returns:
iterator of cells

getGroup

public RowsGroup getGroup()
Description copied from interface: TableRow
Returns parental group

Specified by:
getGroup in interface TableRow
Returns:
parental group

isPageHeader

public boolean isPageHeader()
Description copied from interface: TableRow
Determines an accessory of a row to page heading

Specified by:
isPageHeader in interface TableRow
Returns:
истина, если строка в заголовке страницы, иначе ложь