org.norther.tammi.sprig.report.model
Class ReportModelAdapter

java.lang.Object
  extended by javax.swing.table.AbstractTableModel
      extended by org.norther.tammi.acorn.jfc.AbstractChartModel
          extended by org.norther.tammi.sprig.report.model.ReportModelAdapter
All Implemented Interfaces:
Serializable, TableModel, ChartModel, ReportModel

public abstract class ReportModelAdapter
extends AbstractChartModel
implements ReportModel

An abstract report model adapter.

Version:
$Id: ReportModelAdapter.java,v 1.17 2009/10/28 15:23:00 cvsimp Exp $
Author:
Ilkka Priha
See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
 
Constructor Summary
ReportModelAdapter(TableModel model)
          Constructs a new adapter.
ReportModelAdapter(TableModel model, Locale locale)
          Constructs a new adapter with a locale.
 
Method Summary
protected  ChartModel getChartModel()
          Gets the chart model.
 int getColumnCount()
           
 Comparable<?> getColumnKey(int column)
          Gets the key of the indexed column.
 String getColumnName(int column)
           
 Formatter getFormatter()
          Gets the formatter.
 Introspector getIntrospector()
          Gets the introspector.
 Locale getLocale()
          Gets the locale.
protected abstract  MBeanServer getMBeanServer()
          Gets the current MBean server if available.
 int getRowCount()
           
 Comparable<?> getRowKey(int row)
          Gets the key of the indexed row.
 String getRowName(int row)
          Gets a default name for the row using spreadsheet conventions: 1, 2, 3, etc.
 TableModel getTableModel()
          Gets the table model.
 Object getValueAt(int row, int column)
           
 boolean isCellEditable(int row, int column)
           
 boolean isLocalized()
          Checks if the model is localized.
 void setValueAt(Object value, int row, int column)
           
 
Methods inherited from class org.norther.tammi.acorn.jfc.AbstractChartModel
findColumnKey, findRow, findRowKey
 
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 org.norther.tammi.sprig.report.model.ReportModel
getResourceMap, getVariableRegistry
 
Methods inherited from interface javax.swing.table.TableModel
addTableModelListener, getColumnClass, removeTableModelListener
 

Constructor Detail

ReportModelAdapter

public ReportModelAdapter(TableModel model)
Constructs a new adapter.

Parameters:
model - the model adaptee.

ReportModelAdapter

public ReportModelAdapter(TableModel model,
                          Locale locale)
Constructs a new adapter with a locale.

Parameters:
model - the model adaptee.
locale - the report locale.
Method Detail

getRowCount

public int getRowCount()
Specified by:
getRowCount in interface TableModel

getColumnCount

public int getColumnCount()
Specified by:
getColumnCount in interface TableModel

getRowName

public String getRowName(int row)
Description copied from class: AbstractChartModel
Gets a default name for the row using spreadsheet conventions: 1, 2, 3, etc. If row cannot be found, returns an empty string.

Specified by:
getRowName in interface ChartModel
Overrides:
getRowName in class AbstractChartModel
Parameters:
row - the row being queried.
Returns:
a string containing the default name of row.

getColumnName

public String getColumnName(int column)
Specified by:
getColumnName in interface TableModel
Overrides:
getColumnName in class AbstractTableModel

getRowKey

public Comparable<?> getRowKey(int row)
Description copied from interface: ChartModel
Gets the key of the indexed row.

Specified by:
getRowKey in interface ChartModel
Overrides:
getRowKey in class AbstractChartModel
Parameters:
row - the index of the row.
Returns:
the key of the row.

getColumnKey

public Comparable<?> getColumnKey(int column)
Description copied from interface: ChartModel
Gets the key of the indexed column.

Specified by:
getColumnKey in interface ChartModel
Overrides:
getColumnKey in class AbstractChartModel
Parameters:
column - the index of the column.
Returns:
the key of the column.

isCellEditable

public boolean isCellEditable(int row,
                              int column)
Specified by:
isCellEditable in interface TableModel
Overrides:
isCellEditable in class AbstractTableModel

getValueAt

public Object getValueAt(int row,
                         int column)
Specified by:
getValueAt in interface TableModel

setValueAt

public void setValueAt(Object value,
                       int row,
                       int column)
Specified by:
setValueAt in interface TableModel
Overrides:
setValueAt in class AbstractTableModel

getTableModel

public TableModel getTableModel()
Description copied from interface: ReportModel
Gets the table model.

Specified by:
getTableModel in interface ReportModel
Returns:
the table model.

getLocale

public Locale getLocale()
Description copied from interface: ReportModel
Gets the locale.

Specified by:
getLocale in interface ReportModel
Returns:
the locale.

isLocalized

public boolean isLocalized()
Description copied from interface: ReportModel
Checks if the model is localized.

Specified by:
isLocalized in interface ReportModel
Returns:
true if localized, false otherwise.

getFormatter

public Formatter getFormatter()
Description copied from interface: ReportModel
Gets the formatter.

Specified by:
getFormatter in interface ReportModel
Returns:
the formatter.

getIntrospector

public Introspector getIntrospector()
Description copied from interface: ReportModel
Gets the introspector.

Specified by:
getIntrospector in interface ReportModel
Returns:
the introspector.

getChartModel

protected ChartModel getChartModel()
Gets the chart model.

Returns:
the chart model.

getMBeanServer

protected abstract MBeanServer getMBeanServer()
Gets the current MBean server if available.

Returns:
the MBean server or null.


Copyright © 2004 The Norther Organization. All rights reserved.