org.mars_sim.msp.ui.standard.tool.monitor
Class TradeTableModel

java.lang.Object
  extended by javax.swing.table.AbstractTableModel
      extended by org.mars_sim.msp.ui.standard.tool.monitor.TradeTableModel
All Implemented Interfaces:
java.io.Serializable, javax.swing.table.TableModel, UnitListener

public class TradeTableModel
extends javax.swing.table.AbstractTableModel
implements UnitListener

See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
 
Method Summary
 void destroy()
          Prepares the model for deletion.
 java.lang.Class<?> getColumnClass(int columnIndex)
          Return the type of the column requested.
 int getColumnCount()
           
 java.lang.String getColumnName(int columnIndex)
          Return the name of the column requested.
 java.lang.String getCountString()
          Gets the model count string.
 java.lang.String getGoodCategory(Good good)
           
 java.lang.String getName()
          Get the name of this model.
 java.lang.Object getObject(int row)
          Return the object at the specified row indexes.
 boolean getOrdered()
          Has this model got a natural order that the model conforms to.
 int getRowCount()
           
 java.lang.Object getValueAt(int rowIndex, int columnIndex)
           
 void unitUpdate(UnitEvent event)
          Catch unit update event.
 
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, isCellEditable, removeTableModelListener, setValueAt
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.swing.table.TableModel
addTableModelListener, isCellEditable, removeTableModelListener, setValueAt
 

Method Detail

unitUpdate

public void unitUpdate(UnitEvent event)
Description copied from interface: UnitListener
Catch unit update event.

Specified by:
unitUpdate in interface UnitListener
Parameters:
event - the unit event.

destroy

public void destroy()
Prepares the model for deletion.


getCountString

public java.lang.String getCountString()
Gets the model count string.


getName

public java.lang.String getName()
Get the name of this model. The name will be a description helping the user understand the contents.

Returns:
Descriptive name.

getObject

public java.lang.Object getObject(int row)
Return the object at the specified row indexes.

Parameters:
row - Index of the row object.
Returns:
Object at the specified row.

getOrdered

public boolean getOrdered()
Has this model got a natural order that the model conforms to. If this value is true, then it implies that the user should not be allowed to order.


getColumnName

public java.lang.String getColumnName(int columnIndex)
Return the name of the column requested.

Specified by:
getColumnName in interface javax.swing.table.TableModel
Overrides:
getColumnName in class javax.swing.table.AbstractTableModel
Parameters:
columnIndex - Index of column.
Returns:
name of specified column.

getColumnClass

public java.lang.Class<?> getColumnClass(int columnIndex)
Return the type of the column requested.

Specified by:
getColumnClass in interface javax.swing.table.TableModel
Overrides:
getColumnClass in class javax.swing.table.AbstractTableModel
Parameters:
columnIndex - Index of column.
Returns:
Class of specified column.

getColumnCount

public int getColumnCount()
Specified by:
getColumnCount 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

getGoodCategory

public java.lang.String getGoodCategory(Good good)