edu.northwestern.at.wordhoard.swing.accounts.groups
Class GroupMembersModel

java.lang.Object
  extended by javax.swing.table.AbstractTableModel
      extended by edu.northwestern.at.wordhoard.swing.accounts.groups.GroupMembersModel
All Implemented Interfaces:
java.io.Serializable, javax.swing.table.TableModel

 class GroupMembersModel
extends javax.swing.table.AbstractTableModel

Group model.

Each group panel has a model which acts as a Swing table model, manages all communications with the server session, and maintains the following state information for the panel:

Window components register listeners on the model to listen for and react appropriately to changes in the state of the window.


Field Summary
 
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
 
Constructor Summary
GroupMembersModel(UserGroup userGroup)
          Creates a new UserGroup members model.
 
Method Summary
(package private)  void addListener(GroupMembersListener listener)
          Adds a listener.
 int getColumnCount()
          Gets the number of columns.
 java.lang.String getColumnName(int col)
          Gets the name of a column.
 int getRowCount()
          Gets the number of rows.
(package private)  int[] getSelection()
          Gets the selection.
 java.lang.Object getValueAt(int row, int col)
          Gets the value of a cell.
(package private)  void init()
          Initializes the model.
(package private)  void removeListener(GroupMembersListener listener)
          Removes a listener.
 void setGroup(UserGroup userGroup)
          Sets the UserGroup.
(package private)  void setSelection(int[] selection)
          Sets the selection.
 
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
 

Constructor Detail

GroupMembersModel

GroupMembersModel(UserGroup userGroup)
            throws java.lang.Exception
Creates a new UserGroup members model.

Parameters:
userGroup - UserGroup.
Throws:
java.lang.Exception
Method Detail

setGroup

public void setGroup(UserGroup userGroup)
Sets the UserGroup.

Parameters:
userGroup - UserGroup.

getRowCount

public int getRowCount()
Gets the number of rows.

Returns:
The number of rows.

getColumnCount

public int getColumnCount()
Gets the number of columns.

Returns:
The number of columns.

getValueAt

public java.lang.Object getValueAt(int row,
                                   int col)
Gets the value of a cell.

Parameters:
row - Row index.
col - Column index.
Returns:
Value of cell.

getColumnName

public java.lang.String getColumnName(int col)
Gets the name of a column.

Specified by:
getColumnName in interface javax.swing.table.TableModel
Overrides:
getColumnName in class javax.swing.table.AbstractTableModel
Parameters:
col - Column index.
Returns:
Name of column.

init

void init()
Initializes the model.


setSelection

void setSelection(int[] selection)
Sets the selection.

Parameters:
selection - Array of indexes of selected accounts.

addListener

void addListener(GroupMembersListener listener)
Adds a listener.

Parameters:
listener - Account listener.

removeListener

void removeListener(GroupMembersListener listener)
Removes a listener.

Parameters:
listener - Account listener.

getSelection

int[] getSelection()
Gets the selection.

Returns:
Array of indexes of selected members.