Class WeaponAmmoChoice
java.lang.Object
megamek.client.ui.dialogs.customMek.WeaponAmmoChoice
A panel representing the option to choose a particular ammo bin for an individual weapon.
-
Constructor Summary
ConstructorsConstructorDescriptionWeaponAmmoChoice(WeaponMounted weapon, Entity entity, JPanel parentPanel, GBC2 gbc) Constructor -
Method Summary
Modifier and TypeMethodDescriptionvoidCommon functionality that applies the panel's current ammo bin choice to the panel's weapon.voidrefreshAmmoBinName(Mounted<?> ammoBin, AmmoType selectedAmmoType) Refreshes a single item in the ammo type combo box to display the correct ammo type name.voidWorker function that refreshes the combo box with "up-to-date" ammo names.
-
Constructor Details
-
WeaponAmmoChoice
Constructor- Parameters:
weapon- The mounted weapon. Assumes that the weapon uses ammo.
-
-
Method Details
-
refreshAmmoBinNames
public void refreshAmmoBinNames()Worker function that refreshes the combo box with "up-to-date" ammo names. -
refreshAmmoBinName
Refreshes a single item in the ammo type combo box to display the correct ammo type name. Because the underlying ammo bin hasn't been updated yet, we carry out the name swap "in-place".- Parameters:
ammoBin- The ammo bin whose ammo type has probably changed.selectedAmmoType- The new ammo type.
-
applyChoice
public void applyChoice()Common functionality that applies the panel's current ammo bin choice to the panel's weapon.
-