com.jzy3d.surfedit.swing.table.events
Class TableCellListener

java.lang.Object
  extended by com.jzy3d.surfedit.swing.table.events.TableCellListener
All Implemented Interfaces:
java.beans.PropertyChangeListener, java.lang.Runnable, java.util.EventListener

public class TableCellListener
extends java.lang.Object
implements java.beans.PropertyChangeListener, java.lang.Runnable

This class listens for changes made to the data in the table via the TableCellEditor.

The source of the Action is a TableCellListener instance.

See Also:
http://tips4java.wordpress.com/2009/06/07/table-cell-listener/

Constructor Summary
TableCellListener(javax.swing.JTable table, javax.swing.Action action)
          Create a TableCellListener.
 
Method Summary
 int getColumn()
          Get the column that was last edited
 java.lang.Object getNewValue()
          Get the new value in the cell
 java.lang.Object getOldValue()
          Get the old value of the cell
 int getRow()
          Get the row that was last edited
 javax.swing.JTable getTable()
          Get the table of the cell that was changed
 void propertyChange(java.beans.PropertyChangeEvent e)
           
 void run()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TableCellListener

public TableCellListener(javax.swing.JTable table,
                         javax.swing.Action action)
Create a TableCellListener.

Parameters:
table - the table to be monitored for data changes
action - the Action to invoke when cell data is changed
Method Detail

getColumn

public int getColumn()
Get the column that was last edited

Returns:
the column that was edited

getNewValue

public java.lang.Object getNewValue()
Get the new value in the cell

Returns:
the new value in the cell

getOldValue

public java.lang.Object getOldValue()
Get the old value of the cell

Returns:
the old value of the cell

getRow

public int getRow()
Get the row that was last edited

Returns:
the row that was edited

getTable

public javax.swing.JTable getTable()
Get the table of the cell that was changed

Returns:
the table of the cell that was changed

propertyChange

public void propertyChange(java.beans.PropertyChangeEvent e)
Specified by:
propertyChange in interface java.beans.PropertyChangeListener

run

public void run()
Specified by:
run in interface java.lang.Runnable