Package com.pixelmed.database
Class MapTableModel
java.lang.Object
javax.swing.table.AbstractTableModel
com.pixelmed.database.MapTableModel
- All Implemented Interfaces:
Serializable,TableModel
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:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected intprotected String[]protected Object[][]protected HashSetprotected HashSetprotected intFields inherited from class javax.swing.table.AbstractTableModel
listenerList -
Constructor Summary
ConstructorsConstructorDescriptionConstruct 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
Modifier and TypeMethodDescriptionintgetColumnName(int col) intgetValueAt(int row, int col) voidinitializeModelFromMap(Map map, Map descriptiveNameMap) Initialize a single row table model filled with the supplied attributes and values.protected booleanisAcceptable(HashSet includeList, HashSet excludeList, String name) Check whether or not the named attribute is acceptable for inclusion as a column in the table.booleanisCellEditable(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
-
Field Details
-
columnCount
protected int columnCount -
rowCount
protected int rowCount -
columnNames
-
data
-
includeList
-
excludeList
-
-
Constructor Details
-
MapTableModel
public MapTableModel()Construct an empty single row table model.
-
MapTableModel
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
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 Details
-
isAcceptable
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
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
- Parameters:
row-col-
-
isCellEditable
public boolean isCellEditable(int row, int col) - Specified by:
isCellEditablein interfaceTableModel- Overrides:
isCellEditablein classAbstractTableModel- Parameters:
row-col-
-
getColumnName
- Specified by:
getColumnNamein interfaceTableModel- Overrides:
getColumnNamein classAbstractTableModel- Parameters:
col-
-