Package adams.gui.visualization.report
Class ReportFactory.Model
- java.lang.Object
-
- javax.swing.table.AbstractTableModel
-
- adams.gui.core.AbstractBaseTableModel
-
- adams.gui.visualization.report.ReportFactory.Model
-
- All Implemented Interfaces:
LoggingLevelHandler
,LoggingSupporter
,SpreadSheetSupporter
,CustomSearchTableModel
,Serializable
,TableModel
- Enclosing class:
- ReportFactory
public static class ReportFactory.Model extends AbstractBaseTableModel implements CustomSearchTableModel
A specialized model for a Report.- Version:
- $Revision$
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected List<AbstractField>
m_Fields
for faster access, caching the fields.protected int
m_NumDecimals
the number of decimals for numeric values (-1 means all).protected Report
m_Report
the underlying report.-
Fields inherited from class adams.gui.core.AbstractBaseTableModel
m_Logger, m_LoggingIsEnabled, m_LoggingLevel
-
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Class
getColumnClass(int column)
Returns the class for the column.int
getColumnCount()
Returns the number of columns in the table.String
getColumnName(int column)
Returns the name of the result.int
getNumDecimals()
Returns the number of decimals used to display numeric values.Report
getReport()
Returns the underlying report.int
getRowCount()
Returns the number of rows/targets in the report.Object
getValueAt(int row, int column)
Returns the value at the given position.boolean
isSearchMatch(SearchParameters params, int row)
Tests whether the search matches the specified row.void
setNumDecimals(int value)
Sets the number of decimals to display for numeric values.-
Methods inherited from class adams.gui.core.AbstractBaseTableModel
configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, setLoggingLevel, toSpreadSheet, toString
-
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, isCellEditable, removeTableModelListener, setValueAt
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface javax.swing.table.TableModel
addTableModelListener, isCellEditable, removeTableModelListener, setValueAt
-
-
-
-
Field Detail
-
m_Report
protected Report m_Report
the underlying report.
-
m_Fields
protected List<AbstractField> m_Fields
for faster access, caching the fields.
-
m_NumDecimals
protected int m_NumDecimals
the number of decimals for numeric values (-1 means all).
-
-
Constructor Detail
-
Model
public Model()
Initializes the model.
-
Model
public Model(Report report)
Initializes the model.- Parameters:
report
- the report to base the model on
-
-
Method Detail
-
getReport
public Report getReport()
Returns the underlying report.- Returns:
- the report
-
getRowCount
public int getRowCount()
Returns the number of rows/targets in the report.- Specified by:
getRowCount
in interfaceTableModel
- Returns:
- the number of rows
-
getColumnCount
public int getColumnCount()
Returns the number of columns in the table.- Specified by:
getColumnCount
in interfaceTableModel
- Returns:
- the number of columns
-
getColumnName
public String getColumnName(int column)
Returns the name of the result.- Specified by:
getColumnName
in interfaceTableModel
- Overrides:
getColumnName
in classAbstractTableModel
- Parameters:
column
- the column to retrieve the name for- Returns:
- the name of the column
-
getValueAt
public Object getValueAt(int row, int column)
Returns the value at the given position.- Specified by:
getValueAt
in interfaceTableModel
- Parameters:
row
- the row in the tablecolumn
- the column in the table- Returns:
- the value
-
getColumnClass
public Class getColumnClass(int column)
Returns the class for the column.- Specified by:
getColumnClass
in interfaceTableModel
- Overrides:
getColumnClass
in classAbstractTableModel
- Parameters:
column
- the column to retrieve the class for- Returns:
- the class
-
isSearchMatch
public boolean isSearchMatch(SearchParameters params, int row)
Tests whether the search matches the specified row.- Specified by:
isSearchMatch
in interfaceCustomSearchTableModel
- Parameters:
params
- the search parametersrow
- the row of the underlying, unsorted model- Returns:
- true if the search matches this row
-
setNumDecimals
public void setNumDecimals(int value)
Sets the number of decimals to display for numeric values.- Parameters:
value
- the number of decimals (use -1 to display all)
-
getNumDecimals
public int getNumDecimals()
Returns the number of decimals used to display numeric values.- Returns:
- the number of decimals
-
-