jwo.landserf.structure
Class AttributeTableModel

java.lang.Object
  extended byjavax.swing.table.AbstractTableModel
      extended byjwo.landserf.structure.AttributeTableModel
All Implemented Interfaces:
Serializable, TableModel

public class AttributeTableModel
extends AbstractTableModel

Wraps an attribute table to provide links to a GUI component that requires an AbstractTableModel (e.g JTable).

Version:
2.2, 19th February, 2005.
Author:
Jo Wood
See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
 
Constructor Summary
AttributeTableModel(AttributeTable attTable)
          Creates a wrapper around an attribute table.
 
Method Summary
 Class getColumnClass(int column)
          Reports the type of object stored in the given column.
 int getColumnCount()
          Reports the number of columns in the table.
 String getColumnName(int col)
          Reports the given column heading.
 int getRowCount()
          Reports the number of rows in the table.
 Object getValueAt(int row, int col)
          Reports the value stored in the table at the given coordinates.
 boolean isCellEditable(int row, int col)
          Reports whether the cell represented by the given coordinates is editable.
 void setValueAt(Object value, int row, int col)
          Sets the value stored in the table at the given coordinates.
 
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, removeTableModelListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AttributeTableModel

public AttributeTableModel(AttributeTable attTable)
Creates a wrapper around an attribute table.

Parameters:
attTable - Attribute table to wrap inside a TableModel.
Method Detail

getColumnName

public String getColumnName(int col)
Reports the given column heading.

Parameters:
col - Column number to query.
Returns:
Column heading.

getRowCount

public int getRowCount()
Reports the number of rows in the table.

Returns:
Number of rows.

getColumnCount

public int getColumnCount()
Reports the number of columns in the table.

Returns:
Number of columns.

getValueAt

public Object getValueAt(int row,
                         int col)
Reports the value stored in the table at the given coordinates.

Parameters:
row - Row coordinate to query.
col - Column coordinate to query.
Returns:
Object stored at the given coordinates.

isCellEditable

public boolean isCellEditable(int row,
                              int col)
Reports whether the cell represented by the given coordinates is editable. Currently all cells are editable.

Parameters:
row - Row coordinate to query.
col - Column coordinate to query.
Returns:
True if cell is editable.

getColumnClass

public Class getColumnClass(int column)
Reports the type of object stored in the given column.

Parameters:
column - Column to query.
Returns:
Type of object stored in the given column.

setValueAt

public void setValueAt(Object value,
                       int row,
                       int col)
Sets the value stored in the table at the given coordinates.

Parameters:
value - Value to store in table.
row - Row coordinate of cell to set.
col - Column coordinate of cell to set.


Copyright Jo Wood, 1996-2005, last modified, 11th March, 2005