Package com.pixelmed.database
Class MapTableModel
- java.lang.Object
-
- javax.swing.table.AbstractTableModel
-
- com.pixelmed.database.MapTableModel
-
- All Implemented Interfaces:
java.io.Serializable
,javax.swing.table.TableModel
public class MapTableModel extends javax.swing.table.AbstractTableModel
The
MapTableModel
class extends aAbstractTableModel
to abstract the contents of a database as a tree in order to provide support for aMapTableBrowser
.For details of some of the methods implemented here see
javax.swing.table.AbstractTableModel
.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected int
columnCount
protected java.lang.String[]
columnNames
protected java.lang.Object[][]
data
protected java.util.HashSet
excludeList
protected java.util.HashSet
includeList
protected int
rowCount
-
Constructor Summary
Constructors Constructor Description MapTableModel()
Construct an empty single row table model.MapTableModel(java.util.Map map, java.util.Map descriptiveNameMap)
Construct a single row table model filled with the supplied attributes and values.MapTableModel(java.util.Map map, java.util.Map descriptiveNameMap, java.util.HashSet includeList, java.util.HashSet excludeList)
Construct a single row table model filled with the supplied attributes and values.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getColumnCount()
java.lang.String
getColumnName(int col)
int
getRowCount()
java.lang.Object
getValueAt(int row, int col)
void
initializeModelFromMap(java.util.Map map, java.util.Map descriptiveNameMap)
Initialize a single row table model filled with the supplied attributes and values.protected boolean
isAcceptable(java.util.HashSet includeList, java.util.HashSet excludeList, java.lang.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
-
-
-
-
Constructor Detail
-
MapTableModel
public MapTableModel()
Construct an empty single row table model.
-
MapTableModel
public MapTableModel(java.util.Map map, java.util.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 valuesdescriptiveNameMap
- a map of string names for attributes to descriptions for use as column titles (may be null)
-
MapTableModel
public MapTableModel(java.util.Map map, java.util.Map descriptiveNameMap, java.util.HashSet includeList, java.util.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 valuesdescriptiveNameMap
- 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(java.util.HashSet includeList, java.util.HashSet excludeList, java.lang.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 attributesname
- the name of the attribute to be checked (case insensitive)- Returns:
- true if the attribute is acceptable
-
initializeModelFromMap
public void initializeModelFromMap(java.util.Map map, java.util.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 valuesdescriptiveNameMap
- 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 java.lang.Object getValueAt(int row, int col)
- Parameters:
row
-col
-
-
isCellEditable
public boolean isCellEditable(int row, int col)
- Specified by:
isCellEditable
in interfacejavax.swing.table.TableModel
- Overrides:
isCellEditable
in classjavax.swing.table.AbstractTableModel
- Parameters:
row
-col
-
-
getColumnName
public java.lang.String getColumnName(int col)
- Specified by:
getColumnName
in interfacejavax.swing.table.TableModel
- Overrides:
getColumnName
in classjavax.swing.table.AbstractTableModel
- Parameters:
col
-
-
-