org.jfree.report.states
Class DataRowPreview

java.lang.Object
  extended byorg.jfree.report.states.DataRowBackend
      extended byorg.jfree.report.states.DataRowPreview
All Implemented Interfaces:
java.lang.Cloneable

public final class DataRowPreview
extends DataRowBackend

A 'preview' data row backend. Shows how the next row would look like if there were no events thrown. This class is used to calculate the differences between two states. As function columns as ReportEventListeners are dependent on an valid state, these columns cannot be queried using this class. A query on such an column will throw an InvalidStateException.

Author:
Thomas Morgner

Constructor Summary
DataRowPreview(DataRowBackend db)
          Constructs a new DataRowPreview using the given DataRowBackend as base.
 
Method Summary
 DataRowBackend previewNextRow()
          Create a preview backend.
 void setCurrentRow(int currentRow)
          Sets the current row of the tablemodel.
 void setFunctions(LevelledExpressionList functions)
          Sets the function collection used in this DataRow.
 void setReportProperties(ReportPropertiesList properties)
          Sets the report properties.
 void setTablemodel(javax.swing.table.TableModel tablemodel)
          Sets the tablemodel used in this DataRow.
 void update(DataRowBackend db)
          Updates this instance to be a preview of the given backend.
 
Methods inherited from class org.jfree.report.states.DataRowBackend
clone, findColumn, get, get, getColumnCount, getColumnName, getCurrentRow, getDataRow, getDataRowConnector, getFunctions, getReportProperties, getTablemodel, isBeforeFirstRow, isLastRow
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DataRowPreview

public DataRowPreview(DataRowBackend db)
Constructs a new DataRowPreview using the given DataRowBackend as base.

Parameters:
db - the base.
Method Detail

update

public void update(DataRowBackend db)
Updates this instance to be a preview of the given backend.

Parameters:
db - the row.

setCurrentRow

public final void setCurrentRow(int currentRow)
Sets the current row of the tablemodel. The current row is advanced while the Report is being processed. This is a readonly implementation and will always throw an IllegalStateException

Overrides:
setCurrentRow in class DataRowBackend
Parameters:
currentRow - the current row
Throws:
java.lang.IllegalStateException - as this is a readonly implementation

setFunctions

public final void setFunctions(LevelledExpressionList functions)
Sets the function collection used in this DataRow. As the function collection is statefull, a new instance of the function collection is set for every new ReportState. This is a readonly implementation and will always throw an IllegalStateException

Overrides:
setFunctions in class DataRowBackend
Parameters:
functions - the current function collection
Throws:
java.lang.IllegalStateException - as this is a readonly implementation

setTablemodel

public final void setTablemodel(javax.swing.table.TableModel tablemodel)
Sets the tablemodel used in this DataRow. The tablemodel contains the base values for the report and the currentRow-property contains a pointer to the current row within the tablemodel. This is a readonly implementation and will always throw an IllegalStateException.

Overrides:
setTablemodel in class DataRowBackend
Parameters:
tablemodel - the tablemodel used as base for the reporting.
Throws:
java.lang.IllegalStateException - as this is a readonly implementation

setReportProperties

public final void setReportProperties(ReportPropertiesList properties)
Sets the report properties.

Overrides:
setReportProperties in class DataRowBackend
Parameters:
properties - the report properties.

previewNextRow

public final DataRowBackend previewNextRow()
Create a preview backend. Such datarows will have no access to functions (all functions will return null).

Returns:
The 'preview' DataRowBackend.