com.pixelmed.database
Class MapTableModel

java.lang.Object
  extended by javax.swing.table.AbstractTableModel
      extended by com.pixelmed.database.MapTableModel
All Implemented Interfaces:
Serializable, TableModel

public class MapTableModel
extends AbstractTableModel

The MapTableModel class extends a AbstractTableModel to abstract the contents of a database as a tree in order to provide support for a MapTableBrowser.

For details of some of the methods implemented here see javax.swing.table.AbstractTableModel.

See Also:
Serialized Form

Field Summary
protected  int columnCount
           
protected  String[] columnNames
           
protected  Object[][] data
           
protected  HashSet excludeList
           
protected  HashSet includeList
           
protected  int rowCount
           
 
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
 
Constructor Summary
MapTableModel()
          Construct an empty single row table model.
MapTableModel(Map map, Map descriptiveNameMap)
          Construct a single row table model filled with the supplied attributes and values.
MapTableModel(Map map, Map descriptiveNameMap, HashSet includeList, HashSet excludeList)
          Construct a single row table model filled with the supplied attributes and values.
 
Method Summary
 int getColumnCount()
           
 String getColumnName(int col)
           
 int getRowCount()
           
 Object getValueAt(int row, int col)
           
 void initializeModelFromMap(Map map, Map descriptiveNameMap)
          Initialize a single row table model filled with the supplied attributes and values.
protected  boolean isAcceptable(HashSet includeList, HashSet excludeList, String name)
          Check whether or not the named attribute is acceptable for inclusion as a column in the table.
 boolean isCellEditable(int row, int col)
           
 
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getColumnClass, getListeners, getTableModelListeners, removeTableModelListener, setValueAt
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

columnCount

protected int columnCount

rowCount

protected int rowCount

columnNames

protected String[] columnNames

data

protected Object[][] data

includeList

protected HashSet includeList

excludeList

protected HashSet excludeList
Constructor Detail

MapTableModel

public MapTableModel()

Construct an empty single row table model.


MapTableModel

public MapTableModel(Map map,
                     Map descriptiveNameMap)

Construct a single row table model filled with the supplied attributes and values.

Parameters:
map - a map of string names for attributes to their string values
descriptiveNameMap - a map of string names for attributes to descriptions for use as column titles (may be null)

MapTableModel

public MapTableModel(Map map,
                     Map descriptiveNameMap,
                     HashSet includeList,
                     HashSet excludeList)

Construct a single row table model filled with the supplied attributes and values.

Parameters:
map - a map of string names for attributes to their string values
descriptiveNameMap - a map of string names for attributes to descriptions for use as column titles (may be null)
includeList - a set of upper case string names for suitable attributes (may be null)
excludeList - a set of upper case string names for unsuitable attributes (may be null)
Method Detail

isAcceptable

protected boolean isAcceptable(HashSet includeList,
                               HashSet excludeList,
                               String name)

Check whether or not the named attribute is acceptable for inclusion as a column in the table.

Parameters:
includeList - a set of upper case string names for suitable attributes (currently ignored)
excludeList - a set of upper case string names for unsuitable attributes
name - the name of the attribute to be checked (case insensitive)
Returns:
true if the attribute is acceptable

initializeModelFromMap

public void initializeModelFromMap(Map map,
                                   Map descriptiveNameMap)

Initialize a single row table model filled with the supplied attributes and values.

Parameters:
map - a map of string names for attributes to their string values
descriptiveNameMap - a map of string names for attributes to descriptions for use as column titles (may be null)

getColumnCount

public int getColumnCount()

getRowCount

public int getRowCount()

getValueAt

public Object getValueAt(int row,
                         int col)
Parameters:
row -
col -

isCellEditable

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

getColumnName

public String getColumnName(int col)
Specified by:
getColumnName in interface TableModel
Overrides:
getColumnName in class AbstractTableModel
Parameters:
col -