Package megameklab.ui.util
Class CriticalTableModel
java.lang.Object
javax.swing.table.AbstractTableModel
megameklab.ui.util.CriticalTableModel
- All Implemented Interfaces:
Serializable,TableModel
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassCell editor for the size column -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intmegamek.common.units.Entitystatic final intFields inherited from class javax.swing.table.AbstractTableModel
listenerList -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddCrit(megamek.common.equipment.Mounted<?> mount) intgetColumnName(int col) List<megamek.common.equipment.Mounted<?>> getCrits()intgetValueAt(int row, int col) voidinitColumnSizes(JTable table) booleanisCellEditable(int row, int col) voidvoidvoidremoveCrit(int location) voidremoveCrits(int... locs) Remove a collection of crits specified by the given list of indices.voidremoveMounted(int row) voidsetValueAt(Object aValue, int rowIndex, int columnIndex) voidupdateUnit(megamek.common.units.Entity unit) Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getColumnClass, getListeners, getTableModelListeners, removeTableModelListener
-
Field Details
-
unit
public megamek.common.units.Entity unit -
NAME
public static final int NAME- See Also:
-
TONNAGE
public static final int TONNAGE- See Also:
-
CRITS
public static final int CRITS- See Also:
-
HEAT
public static final int HEAT- See Also:
-
LOCATION
public static final int LOCATION- See Also:
-
SIZE
public static final int SIZE- See Also:
-
EQUIPMENT
public static final int EQUIPMENT- See Also:
-
N_COLS
public static final int N_COLS- See Also:
-
N_COLS_WEAPON_TABLE
public static final int N_COLS_WEAPON_TABLE- See Also:
-
EQUIPMENT_TABLE
public static final int EQUIPMENT_TABLE- See Also:
-
WEAPON_TABLE
public static final int WEAPON_TABLE- See Also:
-
BUILD_TABLE
public static final int BUILD_TABLE- See Also:
-
-
Constructor Details
-
CriticalTableModel
public CriticalTableModel(megamek.common.units.Entity unit, int tableType)
-
-
Method Details
-
getColumnCount
public int getColumnCount() -
updateUnit
public void updateUnit(megamek.common.units.Entity unit) -
refreshModel
public void refreshModel() -
initColumnSizes
-
getRowCount
public int getRowCount() -
getColumnName
- Specified by:
getColumnNamein interfaceTableModel- Overrides:
getColumnNamein classAbstractTableModel
-
isCellEditable
public boolean isCellEditable(int row, int col) - Specified by:
isCellEditablein interfaceTableModel- Overrides:
isCellEditablein classAbstractTableModel
-
getValueAt
-
setValueAt
- Specified by:
setValueAtin interfaceTableModel- Overrides:
setValueAtin classAbstractTableModel
-
getRenderer
-
addCrit
public void addCrit(megamek.common.equipment.Mounted<?> mount) -
removeCrit
public void removeCrit(int location) -
removeCrits
public void removeCrits(int... locs) Remove a collection of crits specified by the given list of indices.- Parameters:
locs- An array of indices that specifies the crits to remove
-
removeAllCrits
public void removeAllCrits() -
removeMounted
public void removeMounted(int row) -
getCrits
-