net.openai.ai.nn.gui.properties
Class PropertyTableModel

java.lang.Object
  |
  +--javax.swing.table.AbstractTableModel
        |
        +--net.openai.ai.nn.gui.properties.PropertyTableModel
All Implemented Interfaces:
java.io.Serializable, javax.swing.table.TableModel

public class PropertyTableModel
extends javax.swing.table.AbstractTableModel

TableModel for the propertyeditor. Retrieves/sets values of/for a single object. This class is a wrapper that implements the TableModel-interface around a propertylist-object.

Version:
$Id: PropertyTableModel.java,v 1.1 2002/03/17 18:04:48 tweber Exp $ History:
$Log: PropertyTableModel.java,v $
Revision 1.1 2002/03/17 18:04:48 tweber
First release of the propertysystem
Author:
Thomas Weber
See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
 
Constructor Summary
PropertyTableModel()
          Creates a new instance of PropertyTableModel
 
Method Summary
 int getColumnCount()
          Returns the number of columns.
 java.lang.String getColumnName(int column)
          Returns the name of a specific column.
 Property getPropertyAt(int row)
          Returns a specific property out of the internal propertylist
 int getRowCount()
          Returns the amount of propertys in the internal list.
 java.lang.Object getValueAt(int row, int col)
          Returns the value at a specific tableposition.
 boolean isCellEditable(int row, int column)
          Returns the read/write status of a property.
 void setClientObject(PropertyList propertylist, java.lang.Object clientobject)
          Sets the propertylist and the clientobject that holds the wanted values.
 void setValueAt(java.lang.Object value, int row, int col)
           
 
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
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PropertyTableModel

public PropertyTableModel()
Creates a new instance of PropertyTableModel

Method Detail

getColumnCount

public int getColumnCount()
Returns the number of columns. This is a constant value. (NAME/VALUE)

Returns:
Columncount (always 2)

getPropertyAt

public Property getPropertyAt(int row)
Returns a specific property out of the internal propertylist

Parameters:
row - Indexnr of the property to be returned
Returns:
Propertyinstance that is stored at index 'row' in the internal list

getRowCount

public int getRowCount()
Returns the amount of propertys in the internal list. (= Number of rows of the table)

Returns:
Number of propertys (=rows)

getValueAt

public java.lang.Object getValueAt(int row,
                                   int col)
Returns the value at a specific tableposition. For column=0 the propertyname is returned, column=1 returns the value of a property.

Parameters:
row - Rownumber of the property
col - Columnnumber. 0=name, 1=value
Returns:
Ether a propertyname or -value at the position 'row' of the propertylist

setValueAt

public void setValueAt(java.lang.Object value,
                       int row,
                       int col)
Specified by:
setValueAt in interface javax.swing.table.TableModel
Overrides:
setValueAt in class javax.swing.table.AbstractTableModel

getColumnName

public java.lang.String getColumnName(int column)
Returns the name of a specific column. This are fixed values. 0=name, 1=value

Specified by:
getColumnName in interface javax.swing.table.TableModel
Overrides:
getColumnName in class javax.swing.table.AbstractTableModel
Parameters:
column - Columnnumber.
Returns:
"NAME" if column=0 or "VALUE" if column=1

setClientObject

public void setClientObject(PropertyList propertylist,
                            java.lang.Object clientobject)
Sets the propertylist and the clientobject that holds the wanted values.

Parameters:
propertylist - List of propertys to be displayed and queried
clientobject - Object that holds the values for the table.

isCellEditable

public boolean isCellEditable(int row,
                              int column)
Returns the read/write status of a property. If column=0, this is always false. Otherwise it depends on the property.

Specified by:
isCellEditable in interface javax.swing.table.TableModel
Overrides:
isCellEditable in class javax.swing.table.AbstractTableModel
Parameters:
row - Indexnumber in the propertylist
column - Columnnumber.
Returns:
if column=0, false is returned. If the property at position 'row' has a setter then TRUE is returned.


Copyright - 2001 OpenAI Labs. All Rights Reserved.