Class MekTableModel

java.lang.Object
javax.swing.table.AbstractTableModel
megamek.client.ui.panels.phaseDisplay.lobby.MekTableModel
All Implemented Interfaces:
Serializable, TableModel

public class MekTableModel extends AbstractTableModel
See Also:
  • Field Details

    • COL_UNIT

      public static final int COL_UNIT
    • COL_PILOT

      public static final int COL_PILOT
    • COL_PLAYER

      public static final int COL_PLAYER
    • COL_BV

      public static final int COL_BV
    • N_COL

      public static final int N_COL
    • DOT_SPACER

      public static final String DOT_SPACER
      See Also:
  • Constructor Details

  • Method Details

    • getValueAt

      public Object getValueAt(int row, int col)
    • getRowCount

      public int getRowCount()
    • clearData

      public void clearData()
      Clears all saved data of the model including the entities.
    • refreshCells

      public void refreshCells()
      Rebuilds the display content of the table cells from the present entity list. Used when the GUI scale changes.
    • addUnit

      public void addUnit(InGameObject entity)
      Adds the given entity to the table and builds the display content.
    • getTooltip

      public String getTooltip(int row, int col)
      Returns the tooltip for the given row and column from the tooltip cache.
    • getColumnName

      public String getColumnName(int column)
      Returns the column header for the given column. The header text is HTML and scaled according to the GUI scale.
      Specified by:
      getColumnName in interface TableModel
      Overrides:
      getColumnName in class AbstractTableModel
    • getEntityAt

      public InGameObject getEntityAt(int row)
      Returns the entity of the given table row.
    • getRenderer

      public MekTableModel.Renderer getRenderer()
      Returns the subclassed cell renderer for all columns except the force column.
    • getColumnCount

      public int getColumnCount()
    • getColumnClass

      public Class<?> getColumnClass(int c)
      Specified by:
      getColumnClass in interface TableModel
      Overrides:
      getColumnClass in class AbstractTableModel