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

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

public class TradeTableModel
extends AbstractTableModel
implements UnitListener, UnitManagerListener

See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
 
Method Summary
 void destroy()
          Prepares the model for deletion.
 Class<?> getColumnClass(int columnIndex)
          Return the type of the column requested.
 int getColumnCount()
           
 String getColumnName(int columnIndex)
          Return the name of the column requested.
 String getCountString()
          Gets the model count string.
 String getGoodCategory(Good good)
           
 String getName()
          Get the name of this model.
 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()
           
 Object getValueAt(int rowIndex, int columnIndex)
           
 void unitManagerUpdate(UnitManagerEvent event)
           
 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)
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 String getCountString()
Gets the model count string.


getName

public 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 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 String getColumnName(int columnIndex)
Return the name of the column requested.

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

getColumnClass

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

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

getColumnCount

public int getColumnCount()
Specified by:
getColumnCount in interface TableModel

getRowCount

public int getRowCount()
Specified by:
getRowCount in interface TableModel

getValueAt

public Object getValueAt(int rowIndex,
                         int columnIndex)
Specified by:
getValueAt in interface TableModel

getGoodCategory

public String getGoodCategory(Good good)

unitManagerUpdate

public void unitManagerUpdate(UnitManagerEvent event)
Specified by:
unitManagerUpdate in interface UnitManagerListener


Copyright © 2009-2013. All Rights Reserved.