org.norther.tammi.acorn.jfc
Class ArrayMapChartModel

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

public class ArrayMapChartModel
extends AbstractChartModel
implements Serializable

An array map table model.

Author:
Ilkka Priha
See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
 
Constructor Summary
ArrayMapChartModel(OrderedMap map, int length)
          Constructs a new model.
ArrayMapChartModel(OrderedMap map, int length, Comparable[] rows)
          Constructs a new model with named rows.
 
Method Summary
protected  OrderedMap getArrayMap()
          Gets the map.
 int getColumnCount()
           
 Comparable getColumnKey(int column)
          Gets the key of the indexed column.
 String getColumnName(int column)
           
 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.
 Object getValueAt(int row, int column)
           
 boolean isCellEditable(int row, int column)
           
 boolean isEditable()
          Checks whether the model is editable.
 void setEditable(boolean flag)
          Sets whether the model is editable.
 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

ArrayMapChartModel

public ArrayMapChartModel(OrderedMap map,
                          int length)
Constructs a new model.

Parameters:
map - the map of column arrays.
length - the length of column arrays.

ArrayMapChartModel

public ArrayMapChartModel(OrderedMap map,
                          int length,
                          Comparable[] rows)
Constructs a new model with named rows.

Parameters:
map - the map of column arrays.
length - the length of column arrays.
rows - the row keys column.
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

isEditable

public boolean isEditable()
Checks whether the model is editable.

Returns:
true if editable, false otherwise.

setEditable

public void setEditable(boolean flag)
Sets whether the model is editable.

Parameters:
flag - true if editable, false otherwise.

getArrayMap

protected OrderedMap getArrayMap()
Gets the map.

Returns:
the map.


Copyright © 2004 The Norther Organization. All rights reserved.