Package ball.swing.table
Class AbstractTableModelImpl
- java.lang.Object
-
- javax.swing.table.AbstractTableModel
-
- ball.swing.table.AbstractTableModelImpl
-
- All Implemented Interfaces:
Serializable
,EventListener
,TableModelListener
,TableModel
- Direct Known Subclasses:
ArrayListTableModel
public abstract class AbstractTableModelImpl extends AbstractTableModel implements TableModelListener
AbstractTableModel
implementation.Bean Property Summary
Name Mode Type isHidden isBound isConstrained columnClass [RW] Class
<
?
>
false false false columnCount R int
false false false columnName [RW] String
false false false rowCount R int
false false false tableModelListeners R TableModelListener[]
false false false - Author:
- Allen D. Ball
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractTableModelImpl(int columns)
Construct aTableModel
with the specified number of columns.protected
AbstractTableModelImpl(String... names)
Construct aTableModel
with the specified column names.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected Object[]
column(int x)
Convenience method to get a column's values as an array.Class<?>
getColumnClass(int x)
int
getColumnCount()
String
getColumnName(int x)
abstract int
getRowCount()
abstract Object
getValueAt(int y, int x)
protected String[]
header()
Convenience method to get the column names as an array.boolean
isCellEditable(int y, int x)
protected Object[]
row(int y)
Convenience method to get a row's values as an array.void
setColumnClass(int x, Class<?> type)
void
setColumnName(int x, String name)
void
setValueAt(Object value, int y, int x)
void
tableChanged(TableModelEvent event)
-
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, removeTableModelListener
-
-
-
-
Constructor Detail
-
AbstractTableModelImpl
protected AbstractTableModelImpl(String... names)
Construct aTableModel
with the specified column names.- Parameters:
names
- The column names.
-
AbstractTableModelImpl
protected AbstractTableModelImpl(int columns)
Construct aTableModel
with the specified number of columns.- Parameters:
columns
- The number of columns.
-
-
Method Detail
-
header
protected String[] header()
Convenience method to get the column names as an array.- Returns:
- The array of column names.
-
column
protected Object[] column(int x)
Convenience method to get a column's values as an array.- Parameters:
x
- The column index.- Returns:
- The array of column values.
-
row
protected Object[] row(int y)
Convenience method to get a row's values as an array.- Parameters:
y
- The row index.- Returns:
- The array of row values.
-
getColumnCount
public int getColumnCount()
- Specified by:
getColumnCount
in interfaceTableModel
-
getColumnClass
public Class<?> getColumnClass(int x)
- Specified by:
getColumnClass
in interfaceTableModel
- Overrides:
getColumnClass
in classAbstractTableModel
-
setColumnClass
public void setColumnClass(int x, Class<?> type)
-
getColumnName
public String getColumnName(int x)
- Specified by:
getColumnName
in interfaceTableModel
- Overrides:
getColumnName
in classAbstractTableModel
-
setColumnName
public void setColumnName(int x, String name)
-
getRowCount
public abstract int getRowCount()
- Specified by:
getRowCount
in interfaceTableModel
-
isCellEditable
public boolean isCellEditable(int y, int x)
- Specified by:
isCellEditable
in interfaceTableModel
- Overrides:
isCellEditable
in classAbstractTableModel
-
getValueAt
public abstract Object getValueAt(int y, int x)
- Specified by:
getValueAt
in interfaceTableModel
-
setValueAt
public void setValueAt(Object value, int y, int x)
- Specified by:
setValueAt
in interfaceTableModel
- Overrides:
setValueAt
in classAbstractTableModel
-
tableChanged
public void tableChanged(TableModelEvent event)
- Specified by:
tableChanged
in interfaceTableModelListener
-
-