private void updateRangeDisplayForAmmo(Mounted mAmmo){
  if (!(mAmmo.getType() instanceof AmmoType)) {
    return;
  }
  AmmoType atype=(AmmoType)mAmmo.getType();
  if (atype.getAmmoType() == AmmoType.T_ATM) {
    if (atype.getMunitionType() == AmmoType.M_EXTENDED_RANGE) {
      wMinR.setText("4");
      wShortR.setText("1 - 9");
      wMedR.setText("10 - 18");
      wLongR.setText("19 - 27");
      wExtR.setText("28 - 36");
    }
 else     if (atype.getMunitionType() == AmmoType.M_HIGH_EXPLOSIVE) {
      wMinR.setText("---");
      wShortR.setText("1 - 3");
      wMedR.setText("4 - 6");
      wLongR.setText("7 - 9");
      wExtR.setText("10 - 12");
    }
 else {
      wMinR.setText("4");
      wShortR.setText("1 - 5");
      wMedR.setText("6 - 10");
      wLongR.setText("11 - 15");
      wExtR.setText("16 - 20");
    }
  }
 else   if (atype.getAmmoType() == AmmoType.T_MML) {
    if (atype.hasFlag(AmmoType.F_MML_LRM)) {
      wMinR.setText("6");
      wShortR.setText("1 - 7");
      wMedR.setText("8 - 14");
      wLongR.setText("15 - 21");
      wExtR.setText("21 - 28");
    }
 else {
      wMinR.setText("---");
      wShortR.setText("1 - 3");
      wMedR.setText("4 - 6");
      wLongR.setText("7 - 9");
      wExtR.setText("10 - 12");
    }
  }
 else   if (atype.getAmmoType() == AmmoType.T_IATM) {
    if (atype.getMunitionType() == AmmoType.M_EXTENDED_RANGE) {
      wMinR.setText("4");
      wShortR.setText("1 - 9");
      wMedR.setText("10 - 18");
      wLongR.setText("19 - 27");
      wExtR.setText("28 - 36");
    }
 else     if (atype.getMunitionType() == AmmoType.M_HIGH_EXPLOSIVE) {
      wMinR.setText("---");
      wShortR.setText("1 - 3");
      wMedR.setText("4 - 6");
      wLongR.setText("7 - 9");
      wExtR.setText("10 - 12");
    }
 else     if (atype.getMunitionType() == AmmoType.M_IATM_IIW) {
      wMinR.setText("4");
      wShortR.setText("1 - 5");
      wMedR.setText("6 - 10");
      wLongR.setText("11 - 15");
      wExtR.setText("16 - 20");
    }
 else     if (atype.getMunitionType() == AmmoType.M_IATM_IMP) {
      wMinR.setText("---");
      wShortR.setText("1 - 3");
      wMedR.setText("4 - 6");
      wLongR.setText("7 - 9");
      wExtR.setText("10 - 12");
    }
 else {
      wMinR.setText("4");
      wShortR.setText("1 - 5");
      wMedR.setText("6 - 10");
      wLongR.setText("11 - 15");
      wExtR.setText("16 - 20");
    }
  }
  if (mAmmo.isHotLoaded()) {
    wMinR.setText("---");
  }
  onResize();
}

private void updateRangeDisplayForAmmo ( Mounted mAmmo ) { if ( ! ( mAmmo . getType ( ) instanceof AmmoType ) ) { return ; } AmmoType atype = ( AmmoType ) mAmmo . getType ( ) ; if ( atype . getAmmoType ( ) == AmmoType . T_ATM ) { if ( atype . getMunitionType ( ) == AmmoType . M_EXTENDED_RANGE ) { wMinR . setText ( "4" ) ; wShortR . setText ( "1 - 9" ) ; wMedR . setText ( "10 - 18" ) ; wLongR . setText ( "19 - 27" ) ; wExtR . setText ( "28 - 36" ) ; } else if ( atype . getMunitionType ( ) == AmmoType . M_HIGH_EXPLOSIVE ) { wMinR . setText ( "---" ) ; wShortR . setText ( "1 - 3" ) ; wMedR . setText ( "4 - 6" ) ; wLongR . setText ( "7 - 9" ) ; wExtR . setText ( "10 - 12" ) ; } else { wMinR . setText ( "4" ) ; wShortR . setText ( "1 - 5" ) ; wMedR . setText ( "6 - 10" ) ; wLongR . setText ( "11 - 15" ) ; wExtR . setText ( "16 - 20" ) ; } } else if ( atype . getAmmoType ( ) == AmmoType . T_MML ) { if ( atype . hasFlag ( AmmoType . F_MML_LRM ) ) { wMinR . setText ( "6" ) ; wShortR . setText ( "1 - 7" ) ; wMedR . setText ( "8 - 14" ) ; wLongR . setText ( "15 - 21" ) ; wExtR . setText ( "21 - 28" ) ; } else { wMinR . setText ( "---" ) ; wShortR . setText ( "1 - 3" ) ; wMedR . setText ( "4 - 6" ) ; wLongR . setText ( "7 - 9" ) ; wExtR . setText ( "10 - 12" ) ; } } else if ( atype . getAmmoType ( ) == AmmoType . T_IATM ) { if ( atype . getMunitionType ( ) == AmmoType . M_EXTENDED_RANGE ) { wMinR . setText ( "4" ) ; wShortR . setText ( "1 - 9" ) ; wMedR . setText ( "10 - 18" ) ; wLongR . setText ( "19 - 27" ) ; wExtR . setText ( "28 - 36" ) ; } else if ( atype . getMunitionType ( ) == AmmoType . M_HIGH_EXPLOSIVE ) { wMinR . setText ( "---" ) ; wShortR . setText ( "1 - 3" ) ; wMedR . setText ( "4 - 6" ) ; wLongR . setText ( "7 - 9" ) ; wExtR . setText ( "10 - 12" ) ; } else if ( atype . getMunitionType ( ) == AmmoType . M_IATM_IIW ) { wMinR . setText ( "4" ) ; wShortR . setText ( "1 - 5" ) ; wMedR . setText ( "6 - 10" ) ; wLongR . setText ( "11 - 15" ) ; wExtR . setText ( "16 - 20" ) ; } else if ( atype . getMunitionType ( ) == AmmoType . M_IATM_IMP ) { wMinR . setText ( "---" ) ; wShortR . setText ( "1 - 3" ) ; wMedR . setText ( "4 - 6" ) ; wLongR . setText ( "7 - 9" ) ; wExtR . setText ( "10 - 12" ) ; } else { wMinR . setText ( "4" ) ; wShortR . setText ( "1 - 5" ) ; wMedR . setText ( "6 - 10" ) ; wLongR . setText ( "11 - 15" ) ; wExtR . setText ( "16 - 20" ) ; } } if ( mAmmo . isHotLoaded ( ) ) { wMinR . setText ( "---" ) ; } onResize ( ) ; }
update the range display for the selected ammo .
