Package com.groiss.reporting.data
Class ReportingTableModel
java.lang.Object
com.groiss.ds.ObjectTableModel
com.groiss.reporting.data.ReportingTableModel
- All Implemented Interfaces:
TableModel
reporting tablemodel holds data which are read from db and calculated data like grouping rows
-
Field Summary
Fields inherited from class com.groiss.ds.ObjectTableModel
data, header
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addGroupingRows
(Map<Integer, List<Object>> groupingrows) Add Grouping Rows to Table Modelvoid
Add a row at the bottom of tablemodel.int
int
Get the amount of colums of the tablemodel.getColumnHeader
(int c) Returns the header at column c.getColumnName
(int c) Get the name of the Column.getData()
Returns the Raw List of Data without clickableIndex, rownumber or groupingrowsreturns the completeted Data table including clickableIndex at index 0 (if exists), rownumber at index 0 or 1 (depends on clickableindex) and grouping rows (which habe no clickableIndex or rownumber Note: Method builds a new table, so this may cost performance.getQuery()
int
Get amount of rows in the tablemodel.getSeriesDef
(int col) getValueAt
(int rowIndex, int columnIndex) Returns the value for the cell at columnIndex and rowIndex.boolean
isGroupingRow
(int rowIndex) Returns boolean flag if a rowIndex references to a grouping rowvoid
setSeriesDef
(Map<Integer, ReportingExportable> seriesDef) void
setValueAt
(Object val, int r, int c) Sets a cell value in the table model.void
showGroupingRows
(boolean showRows) Set Flag if grouping rows should be shown.Methods inherited from class com.groiss.ds.ObjectTableModel
addTableModelListener, getColumnClass, getHeader, isCellEditable, removeTableModelListener, setHeader
-
Constructor Details
-
ReportingTableModel
Constructor for ReportingTableModel- Parameters:
data
- the data Matrix of the reportingtablemodel (rownumbers and groupingrows are not included)
the list of lists contains instances of com.groiss.reporting.data.ReportingExportable or java.lang.Stringheader
- the header objects without a header for the row number columnsq
- The Query Objet
-
-
Method Details
-
addGroupingRows
Add Grouping Rows to Table Model- Parameters:
groupingrows
- a map of grouping rows map has the row index of this gouping row as key and the row (list of objects) as value
-
getRowCount
public int getRowCount()Description copied from class:ObjectTableModel
Get amount of rows in the tablemodel.- Specified by:
getRowCount
in interfaceTableModel
- Overrides:
getRowCount
in classObjectTableModel
-
getColumnCount
public int getColumnCount()Description copied from class:ObjectTableModel
Get the amount of colums of the tablemodel.- Specified by:
getColumnCount
in interfaceTableModel
- Overrides:
getColumnCount
in classObjectTableModel
-
getColumnHeader
Description copied from class:ObjectTableModel
Returns the header at column c.- Overrides:
getColumnHeader
in classObjectTableModel
- Parameters:
c
- the column index- Returns:
- the object representing column header
-
getColumnName
Description copied from class:ObjectTableModel
Get the name of the Column. If the column name is an object, toString is called on the value.- Specified by:
getColumnName
in interfaceTableModel
- Overrides:
getColumnName
in classObjectTableModel
- Parameters:
c
- the column index
-
isGroupingRow
public boolean isGroupingRow(int rowIndex) Returns boolean flag if a rowIndex references to a grouping row- Parameters:
rowIndex
-- Returns:
- true if passed rowIndex is a Grouping row.
-
addRow
Description copied from class:ObjectTableModel
Add a row at the bottom of tablemodel.- Overrides:
addRow
in classObjectTableModel
- Parameters:
row
- the new row
-
setValueAt
Sets a cell value in the table model.- Specified by:
setValueAt
in interfaceTableModel
- Overrides:
setValueAt
in classObjectTableModel
- Parameters:
val
- the objectr
- the row indexc
- the column index
-
getFullData
returns the completeted Data table including clickableIndex at index 0 (if exists), rownumber at index 0 or 1 (depends on clickableindex) and grouping rows (which habe no clickableIndex or rownumber Note: Method builds a new table, so this may cost performance. -
getData
Returns the Raw List of Data without clickableIndex, rownumber or groupingrows- Overrides:
getData
in classObjectTableModel
- Returns:
- the raw data table
-
showGroupingRows
public void showGroupingRows(boolean showRows) Set Flag if grouping rows should be shown.- Parameters:
showRows
- - true if sum Rows should be shown.
-
getValueAt
Description copied from class:ObjectTableModel
Returns the value for the cell at columnIndex and rowIndex.- Specified by:
getValueAt
in interfaceTableModel
- Overrides:
getValueAt
in classObjectTableModel
- Parameters:
rowIndex
- the row indexcolumnIndex
- the column index
-
getDrillDownValues
- Parameters:
re
-- Returns:
-
getClickableIndex
public int getClickableIndex()- Returns:
- the columnIndex which holds the value, which is the clickable value of the row
-
getQuery
- Returns:
- the referenced query object. null if not set.
-
setSeriesDef
-
getSeriesDef
-