net.mazewar
Class ScoreTableModel

java.lang.Object
  extended by net.mazewar.ScoreTableModel
All Implemented Interfaces:
javax.swing.table.TableModel, MazeListener

public class ScoreTableModel
extends java.lang.Object
implements javax.swing.table.TableModel, MazeListener

An implementation of a TableModel that is designed to listen to Maze events an update the score appropriately.

Version:
$Id: ScoreTableModel.java 354 2004-01-26 02:15:32Z geoffw $
Author:
Geoffrey Washburn <geoffw@cis.upenn.edu>

Constructor Summary
ScoreTableModel()
           
 
Method Summary
 void addTableModelListener(javax.swing.event.TableModelListener l)
           
 void clientAdded(Client client)
          Notification that new client has been added to the maze.
 void clientFired(Client client)
          Notification that a client has fired a projectile.
 void clientKilled(Client source, Client target)
          Notification that client source has killed client target.
 void clientRemoved(Client client)
          Notification that a client has been removed, or exiting the maze.
 java.lang.Class getColumnClass(int columnIndex)
           
 int getColumnCount()
           
 java.lang.String getColumnName(int columnIndex)
           
 int getRowCount()
           
 java.lang.Object getValueAt(int rowIndex, int columnIndex)
           
 boolean isCellEditable(int rowIndex, int columnIndex)
           
 void mazeUpdate()
          General notification that the state of the maze has changed.
 void removeTableModelListener(javax.swing.event.TableModelListener l)
           
 void setValueAt(java.lang.Object aValue, int rowIndex, int columnIndex)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ScoreTableModel

public ScoreTableModel()
Method Detail

addTableModelListener

public void addTableModelListener(javax.swing.event.TableModelListener l)
Specified by:
addTableModelListener in interface javax.swing.table.TableModel

getColumnClass

public java.lang.Class getColumnClass(int columnIndex)
Specified by:
getColumnClass in interface javax.swing.table.TableModel

getColumnCount

public int getColumnCount()
Specified by:
getColumnCount in interface javax.swing.table.TableModel

getColumnName

public java.lang.String getColumnName(int columnIndex)
Specified by:
getColumnName in interface javax.swing.table.TableModel

getRowCount

public int getRowCount()
Specified by:
getRowCount in interface javax.swing.table.TableModel

getValueAt

public java.lang.Object getValueAt(int rowIndex,
                                   int columnIndex)
Specified by:
getValueAt in interface javax.swing.table.TableModel

isCellEditable

public boolean isCellEditable(int rowIndex,
                              int columnIndex)
Specified by:
isCellEditable in interface javax.swing.table.TableModel

removeTableModelListener

public void removeTableModelListener(javax.swing.event.TableModelListener l)
Specified by:
removeTableModelListener in interface javax.swing.table.TableModel

setValueAt

public void setValueAt(java.lang.Object aValue,
                       int rowIndex,
                       int columnIndex)
Specified by:
setValueAt in interface javax.swing.table.TableModel

mazeUpdate

public void mazeUpdate()
Description copied from interface: MazeListener
General notification that the state of the maze has changed.

Specified by:
mazeUpdate in interface MazeListener

clientAdded

public void clientAdded(Client client)
Description copied from interface: MazeListener
Notification that new client has been added to the maze.

Specified by:
clientAdded in interface MazeListener
Parameters:
client - Client that was added.

clientFired

public void clientFired(Client client)
Description copied from interface: MazeListener
Notification that a client has fired a projectile.

Specified by:
clientFired in interface MazeListener
Parameters:
client - Client that fired.

clientKilled

public void clientKilled(Client source,
                         Client target)
Description copied from interface: MazeListener
Notification that client source has killed client target.

Specified by:
clientKilled in interface MazeListener
Parameters:
source - Client that fired the projectile.
target - Client that was killed.

clientRemoved

public void clientRemoved(Client client)
Description copied from interface: MazeListener
Notification that a client has been removed, or exiting the maze.

Specified by:
clientRemoved in interface MazeListener
Parameters:
client - Client that left.