Class HHWEquipmentDatabaseView

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible

public class HHWEquipmentDatabaseView extends AbstractEquipmentDatabaseView
See Also:
  • Constructor Details

    • HHWEquipmentDatabaseView

      protected HHWEquipmentDatabaseView(EntitySource eSource)
  • Method Details

    • getVisibleTableColumns

      protected Collection<Integer> getVisibleTableColumns(boolean tableMode)
      Description copied from class: AbstractEquipmentDatabaseView
      This method is called to find the table columns to display when the table is first displayed and when the Table Column Mode button is pressed. The parameter tableMode changes between true and false for each press of the Table Column Mode button. Note that this method can return any dynamic result but is only called at start (when a new unit is displayed or upon unit reset) and when the Table Column Mode button is pressed.
      Specified by:
      getVisibleTableColumns in class AbstractEquipmentDatabaseView
      Parameters:
      tableMode - indicates which of two table column sets are to be shown. May be ignored, especially if useSwitchTableColumns() is overridden to return false.
      Returns:
      A Collection of columns from EquipmentTableModel that should be shown
    • addEquipment

      protected void addEquipment(megamek.common.equipment.EquipmentType equip, int count)
      Description copied from class: AbstractEquipmentDatabaseView
      Adds the given equipment to the entity a number of times equal to count. When the "Add Multiple" button is not used, count will always be 1. The "Add Multiple" button is only available when useAddMultiple() is overridden to return true. Implementing classes must provide a method that covers all entity types that could be coupled to their view.
      Specified by:
      addEquipment in class AbstractEquipmentDatabaseView
    • shouldShow

      protected boolean shouldShow(megamek.common.equipment.EquipmentType eq)
      Description copied from class: AbstractEquipmentDatabaseView
      Returns true when the given equipment should show up in the database table. This method checks if the equipment is available to the unit type at all and if the filter toggles and text filter show or hide it. This may be overridden to exclude or include equipment based on other evaluations. For example, by returning true only for equipment that is part of the unit an inventory can be created although this inventory will not show the equipment counts. Another option is to reduce the shown equipment to a predefined warehouse content such as an MHQ Campaign inventory, although here also, an equipment count is (currently) not supported.
      Overrides:
      shouldShow in class AbstractEquipmentDatabaseView
      Parameters:
      eq - The equipment type to be shown or hidden
      Returns:
      True when the equipment should be shown, false otherwise