net.sf.j3d.threeD.ui.panels
Class EditablePropertiesTableModel

java.lang.Object
  extended by javax.swing.table.AbstractTableModel
      extended by net.sf.j3d.threeD.ui.panels.EditablePropertiesTableModel
All Implemented Interfaces:
Serializable, TableModel

public class EditablePropertiesTableModel
extends AbstractTableModel

An EditablePropertiesTableModel object can be used to manage the data needed when displaying the properties of an Editable object in a table. The table model also handles applying changes made in the table to the stored Editable object.

See Also:
Serialized Form

Field Summary
static String[] columnNames
           
 
Constructor Summary
EditablePropertiesTableModel()
          Constructs a new EditablePropertiesTableModel object.
EditablePropertiesTableModel(Editable editing)
          Constructs a new EditablePropertiesTableModel object using the specified Editable object.
 
Method Summary
 int getColumnCount()
          Returns the number of columns (4) of this table model.
 String getColumnName(int index)
          Returns the name of the column at the specified index.
 Editable getEditing()
          Returns the Editable object used by this EditablePropertiesTableModel object.
 int getRowCount()
          Returns the number of rows (editable properties displayed) in this table model.
 Object getValueAt(int row, int column)
          Returns the value for the cell at the specified row and column index.
 boolean isCellEditable(int row, int column)
          Returns true if the cell at the specified row and column is editable.
 void setEditing(Editable editing)
          Sets the Editable object used by this EditablePropertiesTableModel object to the specified Editable object and notifies listeners that all table data may have changed.
 void setValueAt(Object value, int row, int column)
          Sets the value of the Editable object property that is represented in the cell at the specified row and column index to the specified value and notifies listeners that the cell value may have changed.
 
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getColumnClass, getListeners, getTableModelListeners, removeTableModelListener
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

columnNames

public static final String[] columnNames
Constructor Detail

EditablePropertiesTableModel

public EditablePropertiesTableModel()
Constructs a new EditablePropertiesTableModel object.


EditablePropertiesTableModel

public EditablePropertiesTableModel(Editable editing)
Constructs a new EditablePropertiesTableModel object using the specified Editable object.

Method Detail

setEditing

public void setEditing(Editable editing)
Sets the Editable object used by this EditablePropertiesTableModel object to the specified Editable object and notifies listeners that all table data may have changed.


getEditing

public Editable getEditing()
Returns the Editable object used by this EditablePropertiesTableModel object.


getColumnName

public String getColumnName(int index)
Returns the name of the column at the specified index.

Specified by:
getColumnName in interface TableModel
Overrides:
getColumnName in class AbstractTableModel

isCellEditable

public boolean isCellEditable(int row,
                              int column)
Returns true if the cell at the specified row and column is editable.

Specified by:
isCellEditable in interface TableModel
Overrides:
isCellEditable in class AbstractTableModel

getRowCount

public int getRowCount()
Returns the number of rows (editable properties displayed) in this table model.


getColumnCount

public int getColumnCount()
Returns the number of columns (4) of this table model.


getValueAt

public Object getValueAt(int row,
                         int column)
Returns the value for the cell at the specified row and column index.


setValueAt

public void setValueAt(Object value,
                       int row,
                       int column)
Sets the value of the Editable object property that is represented in the cell at the specified row and column index to the specified value and notifies listeners that the cell value may have changed. If the cell is not editable (does not represent an editable property) this method will do nothing.

Specified by:
setValueAt in interface TableModel
Overrides:
setValueAt in class AbstractTableModel