edu.ucla.stat.SOCR.TG_distributome.editor
Class ElementTableModel

java.lang.Object
  extended by javax.swing.table.AbstractTableModel
      extended by edu.ucla.stat.SOCR.TG_distributome.editor.ElementTableModel
All Implemented Interfaces:
java.io.Serializable, javax.swing.table.TableModel

public class ElementTableModel
extends javax.swing.table.AbstractTableModel

Abstract Table Model for displaying the attributes of an provenance element.

Version:
10 September 2007
See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
 
Constructor Summary
ElementTableModel(java.lang.String elementName, java.lang.String[] attrNames)
          Constructs an Element Table Model.
 
Method Summary
 java.lang.String[] getAttributeNames()
          Gets the names of the attributes.
 java.lang.String getAttributeValue(java.lang.String attrName)
          Gets the value of the attribute.
 java.lang.Class getColumnClass(int columnIndex)
          Returns the most specific superclass for all the cell values in the column.
 int getColumnCount()
          Returns the number of columns in the model.
 java.lang.String getColumnName(int columnIndex)
          Returns the name of the specified column.
 java.lang.String getElementName()
          Gets the name of the element.
 int getRowCount()
          Returns the number of rows in the model.
 java.lang.Object getValueAt(int rowIndex, int columnIndex)
          Returns the value of the specified table cell.
 boolean isCellEditable(int rowIndex, int columnIndex)
          Determines if the specified table cell is editable.
 void setAttribute(java.lang.String attrName, java.lang.String attrValue)
          Sets the value of the attribute.
 void setValueAt(java.lang.Object newValue, int rowIndex, int columnIndex)
          Sets the value of the specified table cell.
 
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, removeTableModelListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ElementTableModel

public ElementTableModel(java.lang.String elementName,
                         java.lang.String[] attrNames)
Constructs an Element Table Model.

Parameters:
elementName - Name of the element.
attrNames - Names of the attributes of the element.
Method Detail

getElementName

public java.lang.String getElementName()
Gets the name of the element.

Returns:
Name of the element.

getAttributeNames

public java.lang.String[] getAttributeNames()
Gets the names of the attributes.

Returns:
Names of the attributes.

getAttributeValue

public java.lang.String getAttributeValue(java.lang.String attrName)
Gets the value of the attribute.

Parameters:
attrName - Name of the attribute.
Returns:
Value of the attribute.

setAttribute

public void setAttribute(java.lang.String attrName,
                         java.lang.String attrValue)
Sets the value of the attribute.

Parameters:
attrName - Name of the attribute.
attrValue - Value for the attribute.

getRowCount

public int getRowCount()
Returns the number of rows in the model.

Returns:
Number of rows in the model.

getColumnCount

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

Returns:
Number of columns in the model.

getColumnName

public java.lang.String getColumnName(int columnIndex)
Returns the name of the specified column.

Specified by:
getColumnName in interface javax.swing.table.TableModel
Overrides:
getColumnName in class javax.swing.table.AbstractTableModel
Parameters:
columnIndex - Index of the column.
Returns:
Name of the column.

getColumnClass

public java.lang.Class getColumnClass(int columnIndex)
Returns the most specific superclass for all the cell values in the column.

Specified by:
getColumnClass in interface javax.swing.table.TableModel
Overrides:
getColumnClass in class javax.swing.table.AbstractTableModel
Parameters:
columnIndex - Index of the column.
Returns:
Common ancestor class of the object values in the model.

isCellEditable

public boolean isCellEditable(int rowIndex,
                              int columnIndex)
Determines if the specified table cell is editable.

Specified by:
isCellEditable in interface javax.swing.table.TableModel
Overrides:
isCellEditable in class javax.swing.table.AbstractTableModel
Parameters:
rowIndex - Index of the row.
columnIndex - Index of the column.
Returns:
True if the table cell is editable; false otherwise.

getValueAt

public java.lang.Object getValueAt(int rowIndex,
                                   int columnIndex)
Returns the value of the specified table cell.

Parameters:
rowIndex - Index of the row.
columnIndex - Index of the column.
Returns:
Value of the specified table cell.

setValueAt

public void setValueAt(java.lang.Object newValue,
                       int rowIndex,
                       int columnIndex)
Sets the value of the specified table cell.

Specified by:
setValueAt in interface javax.swing.table.TableModel
Overrides:
setValueAt in class javax.swing.table.AbstractTableModel
Parameters:
newValue - New value for the table cell.
rowIndex - Index of the row.
columnIndex - Index of the column.