net.sf.freecol.client.gui.panel
Class PlayersTable.PlayersTableModel

java.lang.Object
  extended by javax.swing.table.AbstractTableModel
      extended by net.sf.freecol.client.gui.panel.PlayersTable.PlayersTableModel
All Implemented Interfaces:
java.io.Serializable, javax.swing.table.TableModel
Enclosing class:
PlayersTable

private class PlayersTable.PlayersTableModel
extends javax.swing.table.AbstractTableModel

The TableModel for the players table.


Field Summary
private  NationOptions nationOptions
           
private  java.util.List<Nation> nations
           
private  java.util.Map<Nation,Player> players
           
private  PreGameController preGameController
           
private  Player thisPlayer
           
 
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
 
Constructor Summary
PlayersTable.PlayersTableModel(PreGameController pgc, NationOptions nationOptions, Player owningPlayer)
          A standard constructor.
 
Method Summary
 java.lang.Class<?> getColumnClass(int column)
          Returns the Class of the objects in the given column.
 int getColumnCount()
          Returns the amount of columns in this statesTable.
 java.lang.String getColumnName(int column)
          Returns the name of the specified column.
 int getRowCount()
          Returns the amount of rows in this statesTable.
 java.lang.Object getValueAt(int row, int column)
          Returns the value at the requested location.
 boolean isCellEditable(int row, int column)
          Returns 'true' if the specified cell is editable, 'false' otherwise.
 void setValueAt(java.lang.Object value, int row, int column)
          Sets the value at the specified location.
 void update()
           
 
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
 

Field Detail

nations

private java.util.List<Nation> nations

players

private java.util.Map<Nation,Player> players

thisPlayer

private Player thisPlayer

preGameController

private final PreGameController preGameController

nationOptions

private NationOptions nationOptions
Constructor Detail

PlayersTable.PlayersTableModel

public PlayersTable.PlayersTableModel(PreGameController pgc,
                                      NationOptions nationOptions,
                                      Player owningPlayer)
A standard constructor.

Parameters:
pgc - The PreGameController to use when updates need to be notified across the network.
nationOptions - a NationOptions value
owningPlayer - a Player value
Method Detail

update

public void update()

getColumnClass

public java.lang.Class<?> getColumnClass(int column)
Returns the Class of the objects in the given column.

Specified by:
getColumnClass in interface javax.swing.table.TableModel
Overrides:
getColumnClass in class javax.swing.table.AbstractTableModel
Parameters:
column - The column to return the Class of.
Returns:
The Class of the objects in the given column.

getColumnCount

public int getColumnCount()
Returns the amount of columns in this statesTable.

Returns:
The amount of columns in this statesTable.

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
Returns:
The name of the specified column.

getRowCount

public int getRowCount()
Returns the amount of rows in this statesTable.

Returns:
The amount of rows in this statesTable.

getValueAt

public java.lang.Object getValueAt(int row,
                                   int column)
Returns the value at the requested location.

Parameters:
row - The requested row.
column - The requested column.
Returns:
The value at the requested location.

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
Parameters:
row - The specified row.
column - The specified column.
Returns:
'true' if the specified cell is editable, 'false' otherwise.

setValueAt

public void setValueAt(java.lang.Object value,
                       int row,
                       int column)
Sets the value at the specified location.

Specified by:
setValueAt in interface javax.swing.table.TableModel
Overrides:
setValueAt in class javax.swing.table.AbstractTableModel
Parameters:
value - The new value.
row - The specified row.
column - The specified column.