jap.forward
Class JAPRoutingInfoServiceRegistrationTableModel

java.lang.Object
  extended by javax.swing.table.AbstractTableModel
      extended by jap.forward.JAPRoutingInfoServiceRegistrationTableModel
All Implemented Interfaces:
java.io.Serializable, java.util.Observer, javax.swing.table.TableModel

public class JAPRoutingInfoServiceRegistrationTableModel
extends javax.swing.table.AbstractTableModel
implements java.util.Observer

This is the implementation of the infoservice registration table data, showed in the server status box. The status values in the table are updated automatically, when they have been changed.

See Also:
Serialized Form

Field Summary
private  java.util.Vector m_propagandaInstances
          This is the list of all known propaganda instances, displayed in the table.
private static long serialVersionUID
          serial version UID
 
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
 
Constructor Summary
JAPRoutingInfoServiceRegistrationTableModel()
          Creates a new instance of JAPRoutingInfoServiceRegistrationTableModel.
 
Method Summary
 void clearPropagandaInstancesTable()
          Removes all propaganda instances from the table.
 int getColumnCount()
          Returns the number of columns in the infoservice registration table.
 java.lang.String getColumnName(int a_column)
          Returns the name of the specified column.
 int getRowCount()
          Returns the number of rows in the infoservice registration table.
 java.lang.Object getValueAt(int a_row, int a_column)
          Returns a value of a cell in the table.
 void update(java.util.Observable a_notifier, java.lang.Object a_message)
          This is the implementation of the observer of the propaganda instances.
 void updatePropagandaInstancesList(java.util.Vector a_newPropagandaInstancesList)
          Updates the list of all displayed propaganda instances.
 
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getColumnClass, getListeners, getTableModelListeners, isCellEditable, removeTableModelListener, setValueAt
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
serial version UID

See Also:
Constant Field Values

m_propagandaInstances

private java.util.Vector m_propagandaInstances
This is the list of all known propaganda instances, displayed in the table.

Constructor Detail

JAPRoutingInfoServiceRegistrationTableModel

public JAPRoutingInfoServiceRegistrationTableModel()
Creates a new instance of JAPRoutingInfoServiceRegistrationTableModel. We do only some initialization here.

Method Detail

updatePropagandaInstancesList

public void updatePropagandaInstancesList(java.util.Vector a_newPropagandaInstancesList)
Updates the list of all displayed propaganda instances. We add only new unknown instances here, because removing of the old ones is done automatically, when they are stopped.

Parameters:
a_newPropagandaInstancesList - A Vector with propaganda instances. The new ones are added to the internal list.

update

public void update(java.util.Observable a_notifier,
                   java.lang.Object a_message)
This is the implementation of the observer of the propaganda instances. So if the instances change the state, the table is updated automatically. If the instances reach the state HALTED, they are removed from the table.

Specified by:
update in interface java.util.Observer
Parameters:
a_notifier - The propaganda instance, which has changed the state.

getRowCount

public int getRowCount()
Returns the number of rows in the infoservice registration table. This is equal to the number of propaganda instances.

Specified by:
getRowCount in interface javax.swing.table.TableModel
Returns:
The number of rows in the infoservice registration table.

getColumnCount

public int getColumnCount()
Returns the number of columns in the infoservice registration table. This is always 2, where column 0 is the name of the infoservice and column 2 is the connection state.

Specified by:
getColumnCount in interface javax.swing.table.TableModel
Returns:
The number of columns in the infoservice registration table.

getColumnName

public java.lang.String getColumnName(int a_column)
Returns the name of the specified column. The name is resolved via JAPMessages.

Specified by:
getColumnName in interface javax.swing.table.TableModel
Overrides:
getColumnName in class javax.swing.table.AbstractTableModel
Parameters:
a_column - The number of the column to get the name for. If this is not a valid column number, null is returned.
Returns:
The name for the column.

getValueAt

public java.lang.Object getValueAt(int a_row,
                                   int a_column)
Returns a value of a cell in the table. In column 0 always the names of the infoservices and in column 1 always the registration status appear. If the specified values for row or column are outside the borders of the table, null is returned.

Specified by:
getValueAt in interface javax.swing.table.TableModel
Parameters:
a_row - The row (propaganda instance) to get the value for.
a_column - The column to get the value for.
Returns:
A String with the value of the specified cell.

clearPropagandaInstancesTable

public void clearPropagandaInstancesTable()
Removes all propaganda instances from the table. Also observing of those propaganda instances is stopped.