Class MapTableModel

java.lang.Object
javax.swing.table.AbstractTableModel
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:
  • Field Details

    • 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 Details

    • 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 Details

    • 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 -