org.ka2ddo.yaac.gui
Class LocalObjectTableModel

java.lang.Object
  extended by javax.swing.table.AbstractTableModel
      extended by org.ka2ddo.yaac.gui.LocalObjectTableModel
All Implemented Interfaces:
java.io.Serializable, javax.swing.table.TableModel, LocalObjectTracker.LocalObjectListener

public class LocalObjectTableModel
extends javax.swing.table.AbstractTableModel
implements LocalObjectTracker.LocalObjectListener

This class provides the table information for displaying all locally managed Objects/Items.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
 
Method Summary
 void addTableModelListener(javax.swing.event.TableModelListener l)
          Adds a listener to the list that's notified each time a change to the data model occurs.
 java.lang.Class<?> getColumnClass(int columnIndex)
          Returns the Class for interpreting the value of the specified column
 int getColumnCount()
          Returns the number of columns in the model.
 java.lang.String getColumnName(int column)
          Returns the name for the column,
 int getRowCount()
          Returns the number of rows in the model.
 java.lang.Object getValueAt(int rowIndex, int columnIndex)
          Returns the value for the cell at columnIndex and rowIndex.
 boolean isCellEditable(int rowIndex, int columnIndex)
          Reports whether the specified cell can be modified by the user.
 void objectAdded(int index, LocalObjectTracker.ObjectLink objectLink)
          Report that an Object was added to the LocalObjectTracker.
 void objectDeleted(int index, LocalObjectTracker.ObjectLink objectLink)
          Report that an Object was deleted from the LocalObjectTracker.
 void objectModified(int index, LocalObjectTracker.ObjectLink objectLink)
          Report that an Object was modified in the LocalObjectTracker.
 void removeTableModelListener(javax.swing.event.TableModelListener l)
          Removes a listener from the list that's notified each time a change to the data model occurs.
 void setValueAt(java.lang.Object aValue, int rowIndex, int columnIndex)
          Set the value of editable cells of the table.
 
Methods inherited from class javax.swing.table.AbstractTableModel
findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getColumnCount

public int getColumnCount()
Returns the number of columns in the model.

Specified by:
getColumnCount in interface javax.swing.table.TableModel
Returns:
the number of columns in the model
See Also:
getRowCount()

getColumnClass

public java.lang.Class<?> getColumnClass(int columnIndex)
Returns the Class for interpreting the value of the specified column

Specified by:
getColumnClass in interface javax.swing.table.TableModel
Overrides:
getColumnClass in class javax.swing.table.AbstractTableModel
Parameters:
columnIndex - the column being queried
Returns:
the Class for the specified column

getColumnName

public java.lang.String getColumnName(int column)
Returns the name for the column,

Specified by:
getColumnName in interface javax.swing.table.TableModel
Overrides:
getColumnName in class javax.swing.table.AbstractTableModel
Parameters:
column - the column being queried
Returns:
a string containing the name of column

getRowCount

public int getRowCount()
Returns the number of rows in the model. A JTable uses this method to determine how many rows it should display. This method should be quick, as it is called frequently during rendering.

Specified by:
getRowCount in interface javax.swing.table.TableModel
Returns:
the number of rows in the model
See Also:
getColumnCount()

getValueAt

public java.lang.Object getValueAt(int rowIndex,
                                   int columnIndex)
Returns the value for the cell at columnIndex and rowIndex.

Specified by:
getValueAt in interface javax.swing.table.TableModel
Parameters:
rowIndex - the row whose value is to be queried
columnIndex - the column whose value is to be queried
Returns:
the value Object at the specified cell

isCellEditable

public boolean isCellEditable(int rowIndex,
                              int columnIndex)
Reports whether the specified cell can be modified by the user.

Specified by:
isCellEditable in interface javax.swing.table.TableModel
Overrides:
isCellEditable in class javax.swing.table.AbstractTableModel
Parameters:
rowIndex - the row being queried
columnIndex - the column being queried
Returns:
boolean true if cell is editable

setValueAt

public void setValueAt(java.lang.Object aValue,
                       int rowIndex,
                       int columnIndex)
Set the value of editable cells of the table.

Specified by:
setValueAt in interface javax.swing.table.TableModel
Overrides:
setValueAt in class javax.swing.table.AbstractTableModel
Parameters:
aValue - value to assign to cell
rowIndex - row of cell
columnIndex - column of cell

addTableModelListener

public void addTableModelListener(javax.swing.event.TableModelListener l)
Adds a listener to the list that's notified each time a change to the data model occurs.

Specified by:
addTableModelListener in interface javax.swing.table.TableModel
Overrides:
addTableModelListener in class javax.swing.table.AbstractTableModel
Parameters:
l - the TableModelListener

removeTableModelListener

public void removeTableModelListener(javax.swing.event.TableModelListener l)
Removes a listener from the list that's notified each time a change to the data model occurs.

Specified by:
removeTableModelListener in interface javax.swing.table.TableModel
Overrides:
removeTableModelListener in class javax.swing.table.AbstractTableModel
Parameters:
l - the TableModelListener

objectAdded

public void objectAdded(int index,
                        LocalObjectTracker.ObjectLink objectLink)
Report that an Object was added to the LocalObjectTracker.

Specified by:
objectAdded in interface LocalObjectTracker.LocalObjectListener
Parameters:
index - zero-based index into tracker list
objectLink - ObjectLink containing the new Object

objectModified

public void objectModified(int index,
                           LocalObjectTracker.ObjectLink objectLink)
Report that an Object was modified in the LocalObjectTracker.

Specified by:
objectModified in interface LocalObjectTracker.LocalObjectListener
Parameters:
index - zero-based index into tracker list
objectLink - ObjectLink containing the modified Object

objectDeleted

public void objectDeleted(int index,
                          LocalObjectTracker.ObjectLink objectLink)
Report that an Object was deleted from the LocalObjectTracker.

Specified by:
objectDeleted in interface LocalObjectTracker.LocalObjectListener
Parameters:
index - zero-based index into tracker list
objectLink - ObjectLink containing the deleted Object