FreeHEP API
Version current

org.freehep.util.parameterdatabase
Class DatabaseTable

java.lang.Object
  extended byorg.freehep.util.parameterdatabase.DatabaseTable
All Implemented Interfaces:
DatabaseListener, TableModel

public class DatabaseTable
extends Object
implements TableModel, DatabaseListener

Source Code:
DatabaseTable.java

Field Summary
protected  LinkedList tableModelListeners
          The list of TableModelListeners.
 
Constructor Summary
DatabaseTable(ParameterDatabase database)
          Create a new table to view the parameters in the database.
DatabaseTable(ParameterDatabase database, boolean local)
          Create a new table to view the parameters in the database.
 
Method Summary
 void addTableModelListener(TableModelListener listener)
           
 void databaseUpdated()
          This is called when any parameter of the database is changed.
 void fireTableChanged()
           
 Class getColumnClass(int columnIndex)
           
 int getColumnCount()
           
 String getColumnName(int columnIndex)
           
 JComponent getForm()
          Return a reference to the JComponent which contains the table.
 int getRowCount()
           
 Object getValueAt(int rowIndex, int columnIndex)
           
 boolean isCellEditable(int rowIndex, int columnIndex)
           
 void removeTableModelListener(TableModelListener listener)
           
 void setKeyObject(Object key)
          Set the object used to search the parameter database.
 void setValueAt(Object aValue, int rowIndex, int columnIndex)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

tableModelListeners

protected LinkedList tableModelListeners
The list of TableModelListeners.

Constructor Detail

DatabaseTable

public DatabaseTable(ParameterDatabase database)
Create a new table to view the parameters in the database.


DatabaseTable

public DatabaseTable(ParameterDatabase database,
                     boolean local)
Create a new table to view the parameters in the database. If local is true, then this table will show a "local variable" column. If it is false, then the "local variable" column is omitted.

Method Detail

getForm

public JComponent getForm()
Return a reference to the JComponent which contains the table.


setKeyObject

public void setKeyObject(Object key)
Set the object used to search the parameter database.


databaseUpdated

public void databaseUpdated()
This is called when any parameter of the database is changed. It is important when a parameter is updated programatically so that the user interface reflects the current state of the database.

Specified by:
databaseUpdated in interface DatabaseListener

fireTableChanged

public void fireTableChanged()

addTableModelListener

public void addTableModelListener(TableModelListener listener)
Specified by:
addTableModelListener in interface TableModel

removeTableModelListener

public void removeTableModelListener(TableModelListener listener)
Specified by:
removeTableModelListener in interface TableModel

getColumnClass

public Class getColumnClass(int columnIndex)
Specified by:
getColumnClass in interface TableModel

getColumnCount

public int getColumnCount()
Specified by:
getColumnCount in interface TableModel

getColumnName

public String getColumnName(int columnIndex)
Specified by:
getColumnName in interface TableModel

isCellEditable

public boolean isCellEditable(int rowIndex,
                              int columnIndex)
Specified by:
isCellEditable in interface TableModel

getRowCount

public int getRowCount()
Specified by:
getRowCount in interface TableModel

getValueAt

public Object getValueAt(int rowIndex,
                         int columnIndex)
Specified by:
getValueAt in interface TableModel

setValueAt

public void setValueAt(Object aValue,
                       int rowIndex,
                       int columnIndex)
Specified by:
setValueAt in interface TableModel

FreeHEP API
Version current

Copyright © 2000-2004 FreeHEP, All Rights Reserved.