if(AmmoType.T_ATM == wtype.getAmmoType()) {  AmmoType atype = (AmmoType) mounted.getLinked().getType(); System.err.println( "The ammo is " + atype.getInternalName() ); if(atype.hasFlag(AmmoType.F_ATM_ER)) { wMinR.setText("4"); wShortR.setText("1 - 9"); wMedR.setText("10 - 18"); wLongR.setText("19 - 27"); } else if(atype.hasFlag(AmmoType.F_ATM_HE)) { wMinR.setText("---"); wShortR.setText("1 - 3"); wMedR.setText("4 - 6"); wLongR.setText("7 - 9"); }   }
    public void displaySelected() {        // short circuit if not selected        if(weaponList.getSelectedIndex() == -1) {            m_chAmmo.removeAll();            m_chAmmo.setEnabled(false);            wNameR.setText("");            wHeatR.setText("--");            wDamR.setText("--");            wMinR.setText("---");            wShortR.setText("---");            wMedR.setText("---");            wLongR.setText("---");            return;        }        Mounted mounted = (Mounted)weapons.elementAt(weaponList.getSelectedIndex());        WeaponType wtype = (WeaponType)mounted.getType();        // update weapon display        wNameR.setText(mounted.getDesc());        wHeatR.setText(wtype.getHeat() + "");        if(wtype.getDamage() == WeaponType.DAMAGE_MISSILE) {            wDamR.setText("Missile");        } else if(wtype.getDamage() == WeaponType.DAMAGE_VARIABLE) {            wDamR.setText("Variable");        } else if(wtype.getDamage() == WeaponType.DAMAGE_SPECIAL) {            wDamR.setText("Special");        } else {            wDamR.setText(new Integer(wtype.getDamage()).toString());        }                    // update range        if(wtype.getMinimumRange() > 0) {            wMinR.setText(Integer.toString(wtype.getMinimumRange()));        } else {            wMinR.setText("---");        }        if(wtype.getShortRange() > 1) {            wShortR.setText("1 - " + wtype.getShortRange());        } else {            wShortR.setText("" + wtype.getShortRange());        }        if(wtype.getMediumRange() - wtype.getShortRange() > 1) {            wMedR.setText((wtype.getShortRange() + 1) + " - " + wtype.getMediumRange());        } else {            wMedR.setText("" + wtype.getMediumRange());        }        if(wtype.getLongRange() - wtype.getMediumRange() > 1) {            wLongR.setText((wtype.getMediumRange() + 1) + " - " + wtype.getLongRange());        } else {            wLongR.setText("" + wtype.getLongRange());        }                // update ammo selector        boolean bOwner = (client.getLocalPlayer() == entity.getOwner());        m_chAmmo.removeAll();        if (wtype.getAmmoType() == AmmoType.T_NA || !bOwner) {            m_chAmmo.setEnabled(false);        }        else {            m_chAmmo.setEnabled(true);            vAmmo = new Vector();            int nCur = -1;            int i = 0;            for (Enumeration j = entity.getAmmo(); j.hasMoreElements();) {                Mounted mountedAmmo = (Mounted)j.nextElement();                AmmoType atype = (AmmoType)mountedAmmo.getType();                if (mountedAmmo.isDestroyed() || mountedAmmo.getShotsLeft() <= 0 || mountedAmmo.isDumping()) {                    continue;                }                if (atype.getAmmoType() == wtype.getAmmoType() && atype.getRackSize() == wtype.getRackSize()) {                    vAmmo.addElement(mountedAmmo);                    if (mounted.getLinked() == mountedAmmo) {                        nCur = i;                    }                    i++;                }            }            for (int x = 0, n = vAmmo.size(); x < n; x++) {                m_chAmmo.add(formatAmmo((Mounted)vAmmo.elementAt(x)));            }            if (nCur == -1) {                m_chAmmo.setEnabled(false);            }            else {                m_chAmmo.select(nCur);            }        }    }