public final class NationCellRenderer
extends java.lang.Object
implements javax.swing.table.TableCellRenderer
| Modifier and Type | Field and Description |
|---|---|
private javax.swing.JComboBox |
comboBox |
private Nation[] |
nations |
private java.util.List<Player> |
players |
private Player |
thisPlayer |
| Constructor and Description |
|---|
NationCellRenderer(Nation[] nations)
The default constructor.
|
| Modifier and Type | Method and Description |
|---|---|
private Player |
getPlayer(int i) |
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.
|
private final Nation[] nations
private final javax.swing.JComboBox comboBox
private java.util.List<Player> players
private Player thisPlayer
public NationCellRenderer(Nation[] nations)
nations - array of Nationpublic void setData(java.util.List<Player> players, Player owningPlayer)
players - The players that should be rendered in the table.owningPlayer - The player running the client that is displaying the table.private Player getPlayer(int i)
public java.awt.Component getTableCellRendererComponent(javax.swing.JTable table,
java.lang.Object value,
boolean isSelected,
boolean hasFocus,
int row,
int column)
getTableCellRendererComponent in interface javax.swing.table.TableCellRenderertable - 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.