public class ValueJTableModel extends java.lang.Object implements javax.swing.table.TableModel, ValueTableModel
| Modifier and Type | Field and Description |
|---|---|
protected javax.swing.event.EventListenerList |
listenerList
Storage for the listeners registered with this model.
|
| Constructor and Description |
|---|
ValueJTableModel(ValueTableModel vtm)
Creates the value GUI table model.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addTableModelListener(javax.swing.event.TableModelListener listener)
Adds a listener to the table model.
|
void |
fireTableChanged(javax.swing.event.TableModelEvent event)
Sends the specified event to all registered listeners.
|
void |
fireTableDataChanged()
Sends a
TableModelEvent to all registered listeners to inform
them that the table data has changed. |
java.lang.Class |
getColumnClass(int columnIndex)
Returns the
Class for all Object instances
in the specified column. |
int |
getColumnCount()
Returns the number of columns in the model.
|
int |
getColumnIndex(java.lang.String columnName)
Gets the column index for the specified column name.
|
java.lang.String |
getColumnName(int columnIndex)
Returns the name of a column in the model.
|
int |
getRowCount()
Returns the number of rows in the model.
|
java.lang.Object |
getValueAt(int rowIndex,
int columnIndex)
Returns the value (
Object) at a particular cell in the
table. |
void |
importValues(ValueTableModel vtm)
Import the values from the value table model for all rows.
|
boolean |
isCellEditable(int rowIndex,
int columnIndex)
Returns
true if the specified cell is editable, and
false if it is not. |
static void |
main(java.lang.String[] args) |
void |
removeTableModelListener(javax.swing.event.TableModelListener listener)
Removes a listener from the table model so that it will no longer receive
notification of changes to the table model.
|
void |
setValueAt(java.lang.Object aValue,
int rowIndex,
int columnIndex)
Sets the value at a particular cell in the table.
|
protected javax.swing.event.EventListenerList listenerList
public ValueJTableModel(ValueTableModel vtm)
vtm - the value table model.public void addTableModelListener(javax.swing.event.TableModelListener listener)
addTableModelListener in interface javax.swing.table.TableModellistener - the listener.public void fireTableChanged(javax.swing.event.TableModelEvent event)
event - the event to send.public void fireTableDataChanged()
TableModelEvent to all registered listeners to inform
them that the table data has changed.public java.lang.Class getColumnClass(int columnIndex)
Class for all Object instances
in the specified column.getColumnClass in interface ValueTableModelgetColumnClass in interface javax.swing.table.TableModelcolumnIndex - the column index.public int getColumnCount()
getColumnCount in interface ValueTableModelgetColumnCount in interface javax.swing.table.TableModelpublic int getColumnIndex(java.lang.String columnName)
getColumnIndex in interface ValueTableModelcolumnName - the column name.public java.lang.String getColumnName(int columnIndex)
getColumnName in interface ValueTableModelgetColumnName in interface javax.swing.table.TableModelcolumnIndex - the column index.public int getRowCount()
getRowCount in interface ValueTableModelgetRowCount in interface javax.swing.table.TableModelpublic java.lang.Object getValueAt(int rowIndex,
int columnIndex)
Object) at a particular cell in the
table.getValueAt in interface ValueTableModelgetValueAt in interface javax.swing.table.TableModelrowIndex - the row index.columnIndex - the column index.public void importValues(ValueTableModel vtm)
importValues in interface ValueTableModelvtm - the value table model.public boolean isCellEditable(int rowIndex,
int columnIndex)
true if the specified cell is editable, and
false if it is not.isCellEditable in interface ValueTableModelisCellEditable in interface javax.swing.table.TableModelrowIndex - the row index of the cell.columnIndex - the column index of the cell.public void removeTableModelListener(javax.swing.event.TableModelListener listener)
removeTableModelListener in interface javax.swing.table.TableModellistener - the listener to remove.public void setValueAt(java.lang.Object aValue,
int rowIndex,
int columnIndex)
setValueAt in interface ValueTableModelsetValueAt in interface javax.swing.table.TableModelaValue - the value (null permitted).rowIndex - the row index.columnIndex - the column index.public static void main(java.lang.String[] args)