net.sf.freecol.client.gui.panel
Class StatisticsPanel.StatisticsModel

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

 class StatisticsPanel.StatisticsModel
extends javax.swing.table.AbstractTableModel


Field Summary
private  java.lang.String[] columnNames
           
private  java.lang.Object[][] data
           
private static int NAME_COLUMN
           
private static int VALUE_COLUMN
           
 
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
 
Constructor Summary
StatisticsPanel.StatisticsModel()
          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 setData(java.util.Map<java.lang.String,java.lang.String> statsData)
          Gives this table model the data that is being used in the table.
 
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, removeTableModelListener, setValueAt
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NAME_COLUMN

private static final int NAME_COLUMN
See Also:
Constant Field Values

VALUE_COLUMN

private static final int VALUE_COLUMN
See Also:
Constant Field Values

columnNames

private final java.lang.String[] columnNames

data

private java.lang.Object[][] data
Constructor Detail

StatisticsPanel.StatisticsModel

public StatisticsPanel.StatisticsModel()
A standard constructor.

Method Detail

setData

public void setData(java.util.Map<java.lang.String,java.lang.String> statsData)
Gives this table model the data that is being used in the table. This method should only be called to initialize the data set. To modify or extend the data set use other methods.


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.

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