com.groiss.reporting.data
Class ReportingTableModel

java.lang.Object
  extended by com.groiss.ds.ObjectTableModel
      extended by com.groiss.reporting.data.ReportingTableModel
All Implemented Interfaces:
javax.swing.table.TableModel

public class ReportingTableModel
extends ObjectTableModel

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
ReportingTableModel(java.util.List<java.util.List<java.lang.Object>> data, java.util.List<?> header, Query q)
          Constructor for ReportingTableModel
 
Method Summary
 void addGroupingRows(java.util.Map<java.lang.Integer,java.util.List<java.lang.Object>> groupingrows)
          Add Grouping Rows to Table Model
 void addRow(java.util.List row)
          Add a row at the bottom of tablemodel.
 int getClickableIndex()
           
 int getColumnCount()
          Get the amount of colums of the tablemodel.
 java.lang.Object getColumnHeader(int c)
          Returns the header at column c.
 java.lang.String getColumnName(int c)
          Get the name of the Column.
 java.util.List<java.util.List<java.lang.Object>> getData()
          Returns the Raw List of Data without clickableIndex, rownumber or groupingrows
 Pair<java.lang.String,java.lang.String> getDrillDownValues(ReportingExportable re)
           
 java.util.List<java.util.List<java.lang.Object>> 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.
 Query getQuery()
           
 int getRowCount()
          Get amount of rows in the tablemodel.
 java.lang.Object 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 row
 void setHTMLExport(boolean isHTMLExport)
          Set flag if tablemodel is used to export results to HTML.
 void setValueAt(java.lang.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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReportingTableModel

public ReportingTableModel(java.util.List<java.util.List<java.lang.Object>> data,
                           java.util.List<?> header,
                           Query q)
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.String
header - the header objects without a header for the row number columns
q - The Query Objet
Method Detail

addGroupingRows

public void addGroupingRows(java.util.Map<java.lang.Integer,java.util.List<java.lang.Object>> groupingrows)
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 interface javax.swing.table.TableModel
Overrides:
getRowCount in class ObjectTableModel

getColumnCount

public int getColumnCount()
Description copied from class: ObjectTableModel
Get the amount of colums of the tablemodel.

Specified by:
getColumnCount in interface javax.swing.table.TableModel
Overrides:
getColumnCount in class ObjectTableModel

getColumnHeader

public java.lang.Object getColumnHeader(int c)
Description copied from class: ObjectTableModel
Returns the header at column c.

Overrides:
getColumnHeader in class ObjectTableModel
Parameters:
c - the column index
Returns:
the object representing column header

getColumnName

public java.lang.String getColumnName(int c)
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 interface javax.swing.table.TableModel
Overrides:
getColumnName in class ObjectTableModel
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

public void addRow(java.util.List row)
Description copied from class: ObjectTableModel
Add a row at the bottom of tablemodel.

Overrides:
addRow in class ObjectTableModel
Parameters:
row - the new row

setValueAt

public void setValueAt(java.lang.Object val,
                       int r,
                       int c)
Sets a cell value in the table model.

Specified by:
setValueAt in interface javax.swing.table.TableModel
Overrides:
setValueAt in class ObjectTableModel
Parameters:
val - the object
r - the row index
c - the column index

getFullData

public java.util.List<java.util.List<java.lang.Object>> 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

public java.util.List<java.util.List<java.lang.Object>> getData()
Returns the Raw List of Data without clickableIndex, rownumber or groupingrows

Overrides:
getData in class ObjectTableModel
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

public java.lang.Object getValueAt(int rowIndex,
                                   int columnIndex)
Description copied from class: ObjectTableModel
Returns the value for the cell at columnIndex and rowIndex.

Specified by:
getValueAt in interface javax.swing.table.TableModel
Overrides:
getValueAt in class ObjectTableModel
Parameters:
rowIndex - the row index
columnIndex - the column index

getDrillDownValues

public Pair<java.lang.String,java.lang.String> getDrillDownValues(ReportingExportable re)
Parameters:
re -
Returns:

setHTMLExport

public void setHTMLExport(boolean isHTMLExport)
Set flag if tablemodel is used to export results to HTML. needed to build linked reports Links in Colums and to enable clickable columsn * @param isHTMLExport true if TableModel is used for a HTML Export.


getClickableIndex

public int getClickableIndex()
Returns:
the columnIndex which holds the value, which is the clickable value of the row

getQuery

public Query getQuery()
Returns:
the referenced query object. null if not set.


@enterprise 8.0.22989 Copyright © 2001-2017 Groiss Informatics GmbH. All Rights Reserved.