boolean unitListEmpty = ( 0 == lisEntities.getItemCount() ); butSaveList.setEnabled( !unitListEmpty );
butSaveList.setEnabled( localUnits ); butDeleteAll.setEnabled( localUnits );   butCustom.setEnabled(false); butMechReadout.setEnabled(false); butDelete.setEnabled(false);
    private void refreshEntities() {        lisEntities.removeAll();        int listIndex = 0;        String strTreeSet = "";        String strTreeView = "";        entityCorrespondance = new int[client.game.getNoOfEntities()];        for (Enumeration i = client.getEntities(); i.hasMoreElements();) {            Entity entity = (Entity)i.nextElement();            if(entity.hasC3i()) {                strTreeSet = "";                if(entity.calculateFreeC3Nodes() == 5) strTreeSet = "**";                strTreeView = " (" + entity.getC3NetId() + ")";            }            else if(entity.hasC3()) {                if(entity.getC3Master() == null) {                    if(entity.hasC3S())                        strTreeSet = "***";                    else                        strTreeSet = "*";                    strTreeView = "";                }                else {                    strTreeSet = "";                    if(!entity.C3MasterIs(entity)) {                        strTreeSet = ">";                        if(entity.getC3Master().getC3Master() != null && !entity.getC3Master().C3MasterIs(entity.getC3Master()))                            strTreeSet = ">>";                        strTreeView = " -> " + entity.getC3Master().getDisplayName();                    }                }            }            else {                strTreeSet = "";                strTreeView = "";            }                        if ( !client.game.getOptions().booleanOption("pilot_advantages") ) {              entity.getCrew().clearAdvantages();            }                        int crewAdvCount = entity.getCrew().countAdvantages();                        // Handle the "Blind Drop" option.            if ( !entity.getOwner().equals(client.getLocalPlayer()) &&                 client.game.getOptions().booleanOption("blind_drop") )            {                int weigth = entity.getWeightClass();                String weight = "";                switch (weigth)                {                    case Entity.WEIGHT_LIGHT   : weight = "Light";   break;                    case Entity.WEIGHT_MEDIUM  : weight = "Medium";  break;                    case Entity.WEIGHT_HEAVY   : weight = "Heavy";   break;                    case Entity.WEIGHT_ASSAULT : weight = "Assault"; break;                }                            lisEntities.add(entity.getOwner().getName()                 + " (" + entity.getCrew().getGunnery()                + "/" + entity.getCrew().getPiloting() + " pilot" + (crewAdvCount > 0 ? " <" + crewAdvCount + " advs>" : "") + ")"                + " Class: " + weight                + ((entity.getDeployRound() > 0) ? " - Deploy after round " + entity.getDeployRound() : ""));            }            else            {                lisEntities.add(strTreeSet + entity.getDisplayName()                + " (" + entity.getCrew().getGunnery()                + "/" + entity.getCrew().getPiloting() + " pilot" + (crewAdvCount > 0 ? " <" + crewAdvCount + " advs>" : "") + ")"                + " BV=" + entity.calculateBattleValue() + strTreeView                + ((entity.getDeployRound() > 0) ? " - Deploy after round " + entity.getDeployRound() : ""));            }                                    entityCorrespondance[listIndex++] = entity.getId();        }        boolean unitListEmpty = ( 0 == lisEntities.getItemCount() );        butSaveList.setEnabled( !unitListEmpty );    }