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.AbstractTableModelThe
MapTableModelclass extends aAbstractTableModelto 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 intcolumnCountprotected java.lang.String[]columnNamesprotected java.lang.Object[][]dataprotected java.util.HashSetexcludeListprotected java.util.HashSetincludeListprotected introwCount
-
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 intgetColumnCount()java.lang.StringgetColumnName(int col)intgetRowCount()java.lang.ObjectgetValueAt(int row, int col)voidinitializeModelFromMap(java.util.Map map, java.util.Map descriptiveNameMap)Initialize a single row table model filled with the supplied attributes and values.protected booleanisAcceptable(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.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
-
-
-
-
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:
isCellEditablein interfacejavax.swing.table.TableModel- Overrides:
isCellEditablein classjavax.swing.table.AbstractTableModel- Parameters:
row-col-
-
getColumnName
public java.lang.String getColumnName(int col)
- Specified by:
getColumnNamein interfacejavax.swing.table.TableModel- Overrides:
getColumnNamein classjavax.swing.table.AbstractTableModel- Parameters:
col-
-
-