|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.swing.table.AbstractTableModel
org.mars_sim.msp.ui.standard.tool.monitor.UnitTableModel
public abstract class UnitTableModel
The UnitTableModel that maintains a table model of Units objects. It is only a partial implementation of the TableModel interface.
Field Summary |
---|
Fields inherited from class javax.swing.table.AbstractTableModel |
---|
listenerList |
Constructor Summary | |
---|---|
protected |
UnitTableModel(java.lang.String name,
java.lang.String suffix,
java.lang.String[] names,
java.lang.Class[] types)
Constructs a UnitTableModel object. |
Method Summary | |
---|---|
protected void |
addAll(java.util.Collection<Unit> newUnits)
Adds a collection of units to the model. |
protected void |
addUnit(Unit newUnit)
Add a unit to the model. |
protected void |
clear()
Clears out units from the model. |
protected boolean |
containsUnit(Unit unit)
Checks if unit is in table model already. |
void |
destroy()
Prepares the model for deletion. |
boolean |
equals(java.lang.Object o)
|
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 the model. |
java.lang.Object |
getObject(int row)
Get the unit at the specified row. |
boolean |
getOrdered()
Is this model already ordered according to some external criteria. |
int |
getRowCount()
Get the number of rows in the model. |
protected Unit |
getUnit(int index)
Get the unit at the specified row. |
protected int |
getUnitIndex(Unit unit)
Gets the index of the row a given unit is at. |
protected int |
getUnitNumber()
Gets the number of units in the model. |
protected void |
removeUnit(Unit oldUnit)
Remove a unit to the model. |
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, getValueAt, isCellEditable, removeTableModelListener, setValueAt |
Methods inherited from interface org.mars_sim.msp.simulation.UnitListener |
---|
unitUpdate |
Constructor Detail |
---|
protected UnitTableModel(java.lang.String name, java.lang.String suffix, java.lang.String[] names, java.lang.Class[] types)
name
- Name of the model.suffix
- A string to add to the status message.names
- Names of the columns displayed.types
- The Classes of the individual columns.Method Detail |
---|
protected void addUnit(Unit newUnit)
newUnit
- Unit to add to the model.protected void removeUnit(Unit oldUnit)
oldUnit
- Unit to remove from the model.protected void addAll(java.util.Collection<Unit> newUnits)
newUnits
- the units to add.protected void clear()
protected boolean containsUnit(Unit unit)
unit
- the unit to check.
protected int getUnitNumber()
public int getColumnCount()
getColumnCount
in interface javax.swing.table.TableModel
public java.lang.Class<?> getColumnClass(int columnIndex)
getColumnClass
in interface javax.swing.table.TableModel
getColumnClass
in class javax.swing.table.AbstractTableModel
columnIndex
- Index of column.
public java.lang.String getColumnName(int columnIndex)
getColumnName
in interface javax.swing.table.TableModel
getColumnName
in class javax.swing.table.AbstractTableModel
columnIndex
- Index of column.
public java.lang.String getName()
public int getRowCount()
getRowCount
in interface javax.swing.table.TableModel
public boolean getOrdered()
protected Unit getUnit(int index)
index
- Index of the row.
protected int getUnitIndex(Unit unit)
unit
- the unit to find.
public java.lang.Object getObject(int row)
row
- Indexes of Unit to retrieve.
public java.lang.String getCountString()
public void destroy()
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |