org.jcreme.tutorial
Class ProcessInfoReport

java.lang.Object
  extended byorg.jcreme.tutorial.ProcessInfoReport
All Implemented Interfaces:
DataChangeListener, Report

public class ProcessInfoReport
extends java.lang.Object
implements Report, DataChangeListener

Version:
$Revision: 1.1 $
Author:
$Author: dbregeon $

Field Summary
protected  java.lang.String[] columnNames
           
protected  java.util.HashSet listeners
           
protected  ProcessInfoSource processInfoSource
           
protected  java.util.Vector rows
           
 
Constructor Summary
ProcessInfoReport()
           
 
Method Summary
 void addReportChangeListener(ReportChangeListener listener)
          Adds a listener to the report.
 void clear()
          This method enables to clear the report lines.
 void dataChanged(DataChangeEvent e)
          This method is called when a DataChangeEvent is received.
protected  void fireReportChangeEvent(int type, int firstRow, int lastRow)
           
 java.lang.Class getColumnClass(int columnIndex)
          This method enables to access the class of the objects returned by the getValueAt for this column.
 int getColumnCount()
          This enables to know the range of values for the column indexes.
 int getColumnIndex(java.lang.String columnName)
          This method enables to get the column index from its name.
 java.lang.String getColumnName(int index)
          This is a convenience method to recover the name of the column from its index.
 java.lang.String[] getColumnNames()
          This method enables to get the names of the columns present in the Report.
 ReportFilter getFilter()
          This methods returns a filter to apply to this report.
 int getRowCount()
          This enables to know the range of values for the row indexes.
 java.lang.String getTitle()
          This method enables to access the title of the Report.
 java.lang.Object getValueAt(int row, int column)
          This method gives access to the value at the given row and column for this report.
 void removeReportChangeListener(ReportChangeListener listener)
          Removes a listener from the list.
 void setFilter(ReportFilter filter)
          This method enables to change the filter that applies to this report.
 void setProcessInfoSource(ProcessInfoSource source)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

columnNames

protected java.lang.String[] columnNames

processInfoSource

protected ProcessInfoSource processInfoSource

rows

protected java.util.Vector rows

listeners

protected java.util.HashSet listeners
Constructor Detail

ProcessInfoReport

public ProcessInfoReport()
Method Detail

dataChanged

public void dataChanged(DataChangeEvent e)
Description copied from interface: DataChangeListener
This method is called when a DataChangeEvent is received.

Specified by:
dataChanged in interface DataChangeListener
Parameters:
e - the event that reports the changed data.
See Also:
DataChangeListener.dataChanged(DataChangeEvent)

getTitle

public java.lang.String getTitle()
Description copied from interface: Report
This method enables to access the title of the Report. This title may change when the filter changes.

Specified by:
getTitle in interface Report
Returns:
the title of the Report.
See Also:
Report.getTitle()

getColumnNames

public java.lang.String[] getColumnNames()
Description copied from interface: Report
This method enables to get the names of the columns present in the Report.

Specified by:
getColumnNames in interface Report
Returns:
the column names of the report.
See Also:
Report.getColumnNames()

getColumnIndex

public int getColumnIndex(java.lang.String columnName)
Description copied from interface: Report
This method enables to get the column index from its name. This is necessary since values must be accessed by row index and column index.

Specified by:
getColumnIndex in interface Report
Parameters:
columnName - the name of the column for which we search the index.
Returns:
the particular index of a column.
See Also:
Report.getColumnIndex(java.lang.String)

getColumnName

public java.lang.String getColumnName(int index)
Description copied from interface: Report
This is a convenience method to recover the name of the column from its index.

Specified by:
getColumnName in interface Report
Parameters:
index - the index of the column for which we search the name.
Returns:
the name of a column at a particular index.
See Also:
Report.getColumnName(int)

getColumnCount

public int getColumnCount()
Description copied from interface: Report
This enables to know the range of values for the column indexes.

Specified by:
getColumnCount in interface Report
Returns:
the number of columns in the report.
See Also:
Report.getColumnCount()

getRowCount

public int getRowCount()
Description copied from interface: Report
This enables to know the range of values for the row indexes.

Specified by:
getRowCount in interface Report
Returns:
the number of rows in the report.
See Also:
Report.getRowCount()

getValueAt

public java.lang.Object getValueAt(int row,
                                   int column)
Description copied from interface: Report
This method gives access to the value at the given row and column for this report.

Specified by:
getValueAt in interface Report
Parameters:
row - the row for which we want a value.
column - the column for which we want a value.
Returns:
the value in the report for the particular row and the particular column.
See Also:
Report.getValueAt(int, int)

addReportChangeListener

public void addReportChangeListener(ReportChangeListener listener)
Description copied from interface: Report
Adds a listener to the report.

Specified by:
addReportChangeListener in interface Report
Parameters:
listener - the listener that will receive ReportChangeEvents.
See Also:
Report.addReportChangeListener(org.jcreme.reporting.ReportChangeListener)

removeReportChangeListener

public void removeReportChangeListener(ReportChangeListener listener)
Description copied from interface: Report
Removes a listener from the list.

Specified by:
removeReportChangeListener in interface Report
Parameters:
listener - the listener to remove from the list of listeners on this report.
See Also:
Report.removeReportChangeListener(org.jcreme.reporting.ReportChangeListener)

clear

public void clear()
Description copied from interface: Report
This method enables to clear the report lines.

Specified by:
clear in interface Report
See Also:
Report.clear()

getFilter

public ReportFilter getFilter()
Description copied from interface: Report
This methods returns a filter to apply to this report. It is not defined whether this filter must be applied outside the report when data is added or if the report uses the filter directly.

Specified by:
getFilter in interface Report
Returns:
the filter currently applied to that report.
See Also:
Report.getFilter()

setFilter

public void setFilter(ReportFilter filter)
Description copied from interface: Report
This method enables to change the filter that applies to this report.

Specified by:
setFilter in interface Report
Parameters:
filter - the new filter to use on this report.
See Also:
Report.setFilter(org.jcreme.filters.ReportFilter)

getColumnClass

public java.lang.Class getColumnClass(int columnIndex)
Description copied from interface: Report
This method enables to access the class of the objects returned by the getValueAt for this column. This method reflects the TableModel method.

Specified by:
getColumnClass in interface Report
Parameters:
columnIndex - the index of the queried column.
Returns:
the class of the objects in a particular column. Objects can actually be of a subclass of the returned class.
See Also:
Report.getColumnClass(int)

setProcessInfoSource

public void setProcessInfoSource(ProcessInfoSource source)
Parameters:
source -

fireReportChangeEvent

protected void fireReportChangeEvent(int type,
                                     int firstRow,
                                     int lastRow)


Copyright 2006 null. All Rights Reserved.