net.sf.freecol.client.gui.panel
Class NationCellRenderer

java.lang.Object
  extended by net.sf.freecol.client.gui.panel.NationCellRenderer
All Implemented Interfaces:
javax.swing.table.TableCellRenderer

public final class NationCellRenderer
extends java.lang.Object
implements javax.swing.table.TableCellRenderer

A table cell renderer that should be used to display the chosen nation in a table. It is being used in the players table (StartGamePanel).


Constructor Summary
NationCellRenderer(Nation[] nations)
          The default constructor.
 
Method Summary
 java.awt.Component getTableCellRendererComponent(javax.swing.JTable table, java.lang.Object value, boolean isSelected, boolean hasFocus, int row, int column)
          Returns the component used to render the cell's value.
 void setData(java.util.List<Player> players, Player owningPlayer)
          Gives this table model the data that is being used in the table.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NationCellRenderer

public NationCellRenderer(Nation[] nations)
The default constructor.

Method Detail

setData

public void setData(java.util.List<Player> players,
                    Player owningPlayer)
Gives this table model the data that is being used in the table.

Parameters:
players - The players that should be rendered in the table.
owningPlayer - The player running the client that is displaying the table.

getTableCellRendererComponent

public java.awt.Component getTableCellRendererComponent(javax.swing.JTable table,
                                                        java.lang.Object value,
                                                        boolean isSelected,
                                                        boolean hasFocus,
                                                        int row,
                                                        int column)
Returns the component used to render the cell's value.

Specified by:
getTableCellRendererComponent in interface javax.swing.table.TableCellRenderer
Parameters:
table - The table whose cell needs to be rendered.
value - The value of the cell being rendered.
hasFocus - Indicates whether or not the cell in question has focus.
row - The row index of the cell that is being rendered.
column - The column index of the cell that is being rendered.
Returns:
The component used to render the cell's value.