jdbreport.design.model
Class TemplateModel

java.lang.Object
  extended by javax.swing.table.AbstractTableModel
      extended by jdbreport.model.JReportModel
          extended by jdbreport.design.model.TemplateModel
All Implemented Interfaces:
Serializable, TableModel, ReportModel

public class TemplateModel
extends JReportModel

Version:
2.0 21.01.2011
Author:
Andrey Kholmanskih
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class jdbreport.model.JReportModel
JReportModel.ReportCellWrap
 
Field Summary
 
Fields inherited from class jdbreport.model.JReportModel
VERSION
 
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
 
Constructor Summary
TemplateModel(Map<Object,CellStyle> styles)
           
 
Method Summary
 int addRows(int count, int index, int type)
          Adds rows' count of the defined type to the index of the model.
protected  TableRowModel createRowModel()
          Creates TableRowModel by default
 CellObject getCellObject(int row, int column)
          Returns the CellObject by row and column
 Map<String,CellFunctionObject> getFunctionsList()
           
 List<JdbcReportSource> getSourcesList()
           
 String getToolTipText(int row, int column)
          Returns the string to be used as the tooltip for the cell by row and column.
protected  Map<CellObject,jdbreport.design.model.TotalInfo> getTotalList()
           
 Map<Object,Object> getVars()
           
 int insertDetailGroup(int rowIndex)
           
 boolean isCellEditable(int rowIndex, int columnIndex)
           
 boolean isCellField(int row, int col)
           
 void setFunctionName(GridRect selectionRect, String functionName)
          Sets the function's name for the selected cells
protected  void setFunctionsList(Map<String,CellFunctionObject> functionsList)
           
 void setRowType(int[] selectedRows, int type)
          Sets type of the selected rows
protected  void setSourcesList(List<JdbcReportSource> sourcesList)
           
protected  void setTotalList(Map<CellObject,jdbreport.design.model.TotalInfo> list)
           
protected  void setVars(Map<Object,Object> vars)
          Sets variables map
 void updateRowAndPageHeight(HeighCalculator hCalc)
           
 
Methods inherited from class jdbreport.model.JReportModel
addBorder, addColumns, addColumns, addPropertyChangeListener, addPropertyChangeListener, addRows, addStyle, calcRowWidths, clearUnion, createDefaultColumn, createReportCell, delete, deleteCell, endUpdate, findRightColumn, findStyleID, firePropertyChange, firePropertyChange, firePropertyChange, getCellHeight, getCellPosition, getCellRect, getCellSize, getCellSize, getCellText, getCellWrap, getColumnCount, getColumnModel, getColumnName, getColumnWidth, getDefaultColumnWidth, getOwnerColumn, getOwnerReportCell, getOwnerRow, getPropertyChangeListeners, getPropertyChangeListeners, getReportCell, getReportPage, getReportTitle, getRowCount, getRowHeight, getRowModel, getSelectedCells, getStyleList, getStyles, getToolTipText, getValueAt, isBold, isCanUpdatePages, isColMoving, isColSizing, isColumnBreak, isEditable, isFontStyle, isItalic, isLastRowInPage, isPrintLeftToRight, isRowBreak, isRowMoving, isRowSizing, isShowHeader, isShowRowHeader, isStretchPage, isStrikethrough, isUnderline, isUpdate, isVisible, removeColumns, removePropertyChangeListener, removePropertyChangeListener, removeRows, removeRows, replaceStyleID, setBackground, setCanUpdatePages, setColMoving, setColSizing, setColumnBreak, setColumnCount, setColumnWidths, setDecimals, setDefaultColumnWidth, setEditable, setFontName, setFontSize, setFontStyle, setForeground, setHorizontalAlignment, setPrintLeftToRight, setReportPage, setReportTitle, setRowBreak, setRowHeight, setRowMoving, setRowSizing, setShowHeader, setShowRowHeader, setStretchPage, setStyleList, setValueAt, setVerticalAlignment, setVisible, startUpdate, unionCells, updateCarryRows, updatePages, updateRowHeight
 
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getColumnClass, getListeners, getTableModelListeners, removeTableModelListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.swing.table.TableModel
addTableModelListener, getColumnClass, removeTableModelListener
 

Constructor Detail

TemplateModel

public TemplateModel(Map<Object,CellStyle> styles)
Method Detail

createRowModel

protected TableRowModel createRowModel()
Description copied from class: JReportModel
Creates TableRowModel by default

Overrides:
createRowModel in class JReportModel
Returns:
TableRowModel

getCellObject

public CellObject getCellObject(int row,
                                int column)
Returns the CellObject by row and column

Parameters:
row - the row's number
column - the column's number
Returns:
the CellObject

setFunctionName

public void setFunctionName(GridRect selectionRect,
                            String functionName)
Sets the function's name for the selected cells

Parameters:
selectionRect - coordinates of the selected cells
functionName - the function name

isCellField

public boolean isCellField(int row,
                           int col)
Parameters:
row - the row's number
col - the column's number
Returns:
true, if the cell's type is the CellObject.TYPE_FIELD

getToolTipText

public String getToolTipText(int row,
                             int column)
Description copied from interface: ReportModel
Returns the string to be used as the tooltip for the cell by row and column.

Specified by:
getToolTipText in interface ReportModel
Overrides:
getToolTipText in class JReportModel
Parameters:
row - the row's number
column - the column's number
Returns:
the tooltip string

getVars

public Map<Object,Object> getVars()
Returns:
the variables map

setVars

protected void setVars(Map<Object,Object> vars)
Sets variables map

Parameters:
vars - the variables map

getFunctionsList

public Map<String,CellFunctionObject> getFunctionsList()
Returns:
the functions' map

setFunctionsList

protected void setFunctionsList(Map<String,CellFunctionObject> functionsList)
Parameters:
functionsList - the functions' map

getSourcesList

public List<JdbcReportSource> getSourcesList()
Returns:
the Data Base sources' list

setSourcesList

protected void setSourcesList(List<JdbcReportSource> sourcesList)
Parameters:
sourcesList - the Data Base sources' list

getTotalList

protected Map<CellObject,jdbreport.design.model.TotalInfo> getTotalList()

setTotalList

protected void setTotalList(Map<CellObject,jdbreport.design.model.TotalInfo> list)

setRowType

public void setRowType(int[] selectedRows,
                       int type)
Sets type of the selected rows

Parameters:
selectedRows - the selected rows
type - the row's type

isCellEditable

public boolean isCellEditable(int rowIndex,
                              int columnIndex)
Specified by:
isCellEditable in interface TableModel
Overrides:
isCellEditable in class JReportModel

insertDetailGroup

public int insertDetailGroup(int rowIndex)

addRows

public int addRows(int count,
                   int index,
                   int type)
Adds rows' count of the defined type to the index of the model. The new rows will contain null values. Notification of the row being added will be generated.

Parameters:
count - - rows' count
index - - the row index of the rows to be inserted
type - - the row's type
Returns:
rows' count in the model

updateRowAndPageHeight

public void updateRowAndPageHeight(HeighCalculator hCalc)
Specified by:
updateRowAndPageHeight in interface ReportModel
Overrides:
updateRowAndPageHeight in class JReportModel