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

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

public class VehicleTableModel
extends UnitTableModel

The VehicleTableModel that maintains a list of Vehicle objects. It maps key attributes of the Vehicle into Columns.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
 
Constructor Summary
VehicleTableModel(UnitManager unitManager)
          Constructs a VehicleTableModel object.
 
Method Summary
protected  void addUnit(Unit newUnit)
          Add a unit to the model.
 void destroy()
          Prepares the model for deletion.
 java.lang.Object getValueAt(int rowIndex, int columnIndex)
          Return the value of a Cell
protected  void removeUnit(Unit oldUnit)
          Remove a unit to the model.
 void unitUpdate(UnitEvent event)
          Catch unit update event.
 
Methods inherited from class org.mars_sim.msp.ui.standard.tool.monitor.UnitTableModel
addAll, clear, containsUnit, equals, getColumnClass, getColumnCount, getColumnName, getCountString, getName, getObject, getOrdered, getRowCount, getUnit, getUnitIndex, getUnitNumber
 
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, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.swing.table.TableModel
addTableModelListener, isCellEditable, removeTableModelListener, setValueAt
 

Constructor Detail

VehicleTableModel

public VehicleTableModel(UnitManager unitManager)
Constructs a VehicleTableModel object. It creates the list of possible Vehicles from the Unit manager.

Parameters:
unitManager - Proxy manager contains displayable Vehicles.
Method Detail

getValueAt

public java.lang.Object getValueAt(int rowIndex,
                                   int columnIndex)
Return the value of a Cell

Parameters:
rowIndex - Row index of the cell.
columnIndex - Column index of the cell.

unitUpdate

public void unitUpdate(UnitEvent event)
Catch unit update event.

Parameters:
event - the unit event.

addUnit

protected void addUnit(Unit newUnit)
Add a unit to the model.

Overrides:
addUnit in class UnitTableModel
Parameters:
newUnit - Unit to add to the model.

removeUnit

protected void removeUnit(Unit oldUnit)
Remove a unit to the model.

Overrides:
removeUnit in class UnitTableModel
Parameters:
oldUnit - Unit to remove from the model.

destroy

public void destroy()
Prepares the model for deletion.

Overrides:
destroy in class UnitTableModel