com.cometway.swing
Class AgentTableModel

java.lang.Object
  extended by javax.swing.table.AbstractTableModel
      extended by com.cometway.swing.AgentTableModel
All Implemented Interfaces:
java.io.Serializable, javax.swing.table.TableModel

public class AgentTableModel
extends javax.swing.table.AbstractTableModel

This is a swing TableModel implementation for editing startup agents.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
 
Constructor Summary
AgentTableModel(java.util.Vector agentList)
          Constructor the AgentTableModel.
 
Method Summary
 java.lang.Class getColumnClass(int column)
          Returns the Class of data in the specified Column.
 int getColumnCount()
          Returns the number of columns (7).
 java.lang.String getColumnName(int column)
          Returns the name of the specified column.
 int getRowCount()
          Returns the number of rows in this TableModel.
 java.lang.Object getValueAt(int row, int col)
          Returns the value of the specified row and column.
 boolean isCellEditable(int row, int column)
          Returns true if the specified cell is editable; false otherwise.
 void notifyAgentsChanged()
          Call this method to indicate that the agent descriptions in the table have changed.
 void setAgentList(java.util.Vector agentList)
          Sets the list of agents this TableModel is rendering.
 void setValueAt(java.lang.Object value, int row, int col)
          Sets the value of the specified cell.
 void sortByAgentID()
          Sorts the agents by their agent_id property.
 
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

AgentTableModel

public AgentTableModel(java.util.Vector agentList)
Constructor the AgentTableModel.

Parameters:
agentList - The list of agent descriptions to model.
Method Detail

getColumnCount

public int getColumnCount()
Returns the number of columns (7).


getColumnClass

public java.lang.Class getColumnClass(int column)
Returns the Class of data in the specified Column.

Specified by:
getColumnClass in interface javax.swing.table.TableModel
Overrides:
getColumnClass in class javax.swing.table.AbstractTableModel

getColumnName

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

Specified by:
getColumnName in interface javax.swing.table.TableModel
Overrides:
getColumnName in class javax.swing.table.AbstractTableModel

getRowCount

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


getValueAt

public java.lang.Object getValueAt(int row,
                                   int col)
Returns the value of the specified row and column.


isCellEditable

public boolean isCellEditable(int row,
                              int column)
Returns true if the specified cell is editable; false otherwise.

Specified by:
isCellEditable in interface javax.swing.table.TableModel
Overrides:
isCellEditable in class javax.swing.table.AbstractTableModel

notifyAgentsChanged

public void notifyAgentsChanged()
Call this method to indicate that the agent descriptions in the table have changed.


setAgentList

public void setAgentList(java.util.Vector agentList)
Sets the list of agents this TableModel is rendering.


setValueAt

public void setValueAt(java.lang.Object value,
                       int row,
                       int col)
Sets the value of the specified cell.

Specified by:
setValueAt in interface javax.swing.table.TableModel
Overrides:
setValueAt in class javax.swing.table.AbstractTableModel

sortByAgentID

public void sortByAgentID()
Sorts the agents by their agent_id property.