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

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

public class MissionTableModel
extends javax.swing.table.AbstractTableModel
implements MissionManagerListener, MissionListener

See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
 
Constructor Summary
MissionTableModel()
           
 
Method Summary
 void addMission(Mission mission)
          Adds a new mission.
 void destroy()
          Prepares the model for deletion.
 java.lang.Class<?> getColumnClass(int columnIndex)
          Return the type of the column requested.
 int getColumnCount()
          Return the number of columns
 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 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)
          Return the value of a Cell
 void missionUpdate(MissionEvent event)
          Catch mission update event.
 void removeMission(Mission mission)
          Removes an old mission.
 
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
 

Constructor Detail

MissionTableModel

public MissionTableModel()
Method Detail

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.

addMission

public void addMission(Mission mission)
Adds a new mission.

Specified by:
addMission in interface MissionManagerListener
Parameters:
mission - the new mission.

removeMission

public void removeMission(Mission mission)
Removes an old mission.

Specified by:
removeMission in interface MissionManagerListener
Parameters:
mission - the old mission.

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.

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.

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.


getCountString

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


missionUpdate

public void missionUpdate(MissionEvent event)
Catch mission update event.

Specified by:
missionUpdate in interface MissionListener
Parameters:
event - the mission event.

getRowCount

public int getRowCount()
Specified by:
getRowCount in interface javax.swing.table.TableModel

getColumnCount

public int getColumnCount()
Return the number of columns

Specified by:
getColumnCount in interface javax.swing.table.TableModel
Returns:
column count.

getValueAt

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

Specified by:
getValueAt in interface javax.swing.table.TableModel
Parameters:
rowIndex - Row index of the cell.
columnIndex - Column index of the cell.

destroy

public void destroy()
Prepares the model for deletion.