Package ball.swing.table
Class MapTableModel
- java.lang.Object
-
- javax.swing.table.AbstractTableModel
-
- ball.swing.table.AbstractTableModelImpl
-
- ball.swing.table.ArrayListTableModel<Object>
-
- ball.swing.table.MapTableModel
-
- All Implemented Interfaces:
Serializable
,EventListener
,TableModelListener
,TableModel
- Direct Known Subclasses:
MapsTableModel
public class MapTableModel extends ArrayListTableModel<Object>
Map
TableModel
implementation.- Author:
- Allen D. Ball
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
-
-
Constructor Summary
Constructors Constructor Description MapTableModel(Map<?,?> map)
MapTableModel(Map<?,?> map, int columns)
MapTableModel(Map<?,?> map, String... names)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Object
getValueAt(Object row, int x)
Implementation method to retrieve a column value from a row object.protected Map<?,?>
map()
Method to get the underlyingMap
.void
tableChanged(TableModelEvent event)
-
Methods inherited from class ball.swing.table.ArrayListTableModel
getRowCount, getValueAt, list
-
Methods inherited from class ball.swing.table.AbstractTableModelImpl
column, getColumnClass, getColumnCount, getColumnName, header, isCellEditable, row, setColumnClass, setColumnName, setValueAt
-
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, removeTableModelListener
-
-
-
-
Constructor Detail
-
MapTableModel
public MapTableModel(Map<?,?> map, String... names)
- Parameters:
map
- The underlyingMap
.names
- The column names.- See Also:
AbstractTableModelImpl(String...)
-
MapTableModel
public MapTableModel(Map<?,?> map, int columns)
- Parameters:
map
- The underlyingMap
.columns
- The number of columns.- See Also:
AbstractTableModelImpl(int)
-
MapTableModel
public MapTableModel(Map<?,?> map)
- Parameters:
map
- The underlyingMap
.
-
-
Method Detail
-
getValueAt
protected Object getValueAt(Object row, int x)
Description copied from class:ArrayListTableModel
Implementation method to retrieve a column value from a row object.- Specified by:
getValueAt
in classArrayListTableModel<Object>
- Parameters:
row
- TheObject
representing the row.x
- The column index.- Returns:
- The column value from the row.
-
tableChanged
public void tableChanged(TableModelEvent event)
- Specified by:
tableChanged
in interfaceTableModelListener
- Overrides:
tableChanged
in classAbstractTableModelImpl
-
-