Class ArmorAllocationView

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, megameklab.ui.generalUnit.ArmorLocationView.ArmorLocationListener

public class ArmorAllocationView extends BuildView implements megameklab.ui.generalUnit.ArmorLocationView.ArmorLocationListener
Panel for allocating armor to various locations on an Entity. The assignment of armor values for specific locations is delegated to ArmorLocationView. This class handles positioning of the subviews to approximate the position on the unit and tracking the total amount of armor allocated.
See Also:
  • Constructor Details

    • ArmorAllocationView

      public ArmorAllocationView(megamek.common.interfaces.ITechManager techManager, long entityType)
  • Method Details

    • addListener

      public void addListener(ArmorAllocationListener l)
    • removeListener

      public void removeListener(ArmorAllocationListener l)
    • setFromEntity

      public void setFromEntity(megamek.common.units.Entity en)
    • setEntityType

      public void setEntityType(long etype)
    • getTotalArmorWeight

      public double getTotalArmorWeight(megamek.common.units.Entity en)
      Helper function for patchwork. If used for non-patchwork, it will likely give incorrect values due to rounding up by location.
      Parameters:
      en - the current entity
      Returns:
      The total weight of all allocated armor.
    • showPatchwork

      public void showPatchwork(boolean show)
    • armorPointsChanged

      public void armorPointsChanged(int location, int front, int rear)
      Specified by:
      armorPointsChanged in interface megameklab.ui.generalUnit.ArmorLocationView.ArmorLocationListener