org.norther.tammi.acorn.jfc
Class ChartModelAdapter

java.lang.Object
  extended by javax.swing.table.AbstractTableModel
      extended by org.norther.tammi.acorn.jfc.AbstractChartModel
          extended by org.norther.tammi.acorn.jfc.ChartModelAdapter
All Implemented Interfaces:
Serializable, TableModel, ChartModel
Direct Known Subclasses:
FilteredChartModel, NamedChartModel

public class ChartModelAdapter
extends AbstractChartModel
implements Serializable

A chart model adapter.

Author:
Ilkka Priha
See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
 
Constructor Summary
ChartModelAdapter(ChartModel model)
          Constructs a new model.
 
Method Summary
 int getColumnCount()
           
protected  int getColumnIndex(int column)
          Gets the unadapted column index.
 Comparable getColumnKey(int column)
          Gets the key of the indexed column.
 String getColumnName(int column)
           
protected  ChartModel getModel()
          Gets the chart model.
 int getRowCount()
           
protected  int getRowIndex(int row)
          Gets the unadapted row index.
 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.
 Object getValueAt(int row, int column)
           
 boolean isCellEditable(int row, int column)
           
 void setValueAt(Object value, int row, int column)
           
 
Methods inherited from class org.norther.tammi.acorn.jfc.AbstractChartModel
findColumn, findRow, findRow
 
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

ChartModelAdapter

public ChartModelAdapter(ChartModel model)
Constructs a new model.

Parameters:
model - the model.
Method Detail

getRowCount

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

getColumnCount

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

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.

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

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

getModel

protected ChartModel getModel()
Gets the chart model.

Returns:
the chart model.

getRowIndex

protected int getRowIndex(int row)
Gets the unadapted row index.

Parameters:
row - the adapted row index.
Returns:
the unadapted row index.

getColumnIndex

protected int getColumnIndex(int column)
Gets the unadapted column index.

Parameters:
column - the adapted column index.
Returns:
the unadapted column index.


Copyright © 2004 The Norther Organization. All rights reserved.