org.norther.tammi.acorn.jfc
Class AbstractChartModel

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

public abstract class AbstractChartModel
extends AbstractTableModel
implements ChartModel

An extension to abstract table model supporting named rows.

Author:
Ilkka Priha
See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
 
Constructor Summary
AbstractChartModel()
          Constructs a new model.
 
Method Summary
 int findColumn(Comparable columnKey)
          Finds the keyed column.
 int findRow(Comparable rowKey)
          Finds the keyed row.
 int findRow(String rowName)
          Finds the named row.
 Comparable getColumnKey(int column)
          Gets the key of the indexed column.
 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.
 
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getColumnClass, getColumnName, getListeners, getTableModelListeners, isCellEditable, removeTableModelListener, setValueAt
 
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, getColumnCount, getColumnName, getRowCount, getValueAt, isCellEditable, removeTableModelListener, setValueAt
 

Constructor Detail

AbstractChartModel

public AbstractChartModel()
Constructs a new model.

Method Detail

getRowKey

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

Specified by:
getRowKey in interface ChartModel
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
Parameters:
column - the index of the column.
Returns:
the key of the column.

getRowName

public String getRowName(int row)
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
Parameters:
row - the row being queried.
Returns:
a string containing the default name of row.

findRow

public int findRow(Comparable rowKey)
Finds the keyed row.

Parameters:
rowKey - the row to find.
Returns:
the row index or -1 if not found.

findColumn

public int findColumn(Comparable columnKey)
Finds the keyed column.

Parameters:
columnKey - the column ro find.
Returns:
the column index or -1 if not found.

findRow

public int findRow(String rowName)
Finds the named row.

Parameters:
rowName - the row ro find.
Returns:
the row index or -1 if not found.


Copyright © 2004 The Norther Organization. All rights reserved.