entityCorrespondance[listIndex++] = entity.getId();
    private void refreshEntities() {        lisEntities.removeAll();        int listIndex = 0;        String strTreeSet = "";        String strTreeView = "";        boolean localUnits = false;        entityCorrespondance = new int[client.game.getNoOfEntities()];        for (Enumeration i = client.getEntities(); i.hasMoreElements();) {            Entity entity = (Entity) i.nextElement();            // Remember if the local player has units.            if (!localUnits && entity.getOwner().equals(client.getLocalPlayer())) {                localUnits = true;            }            // Reset the tree strings.            strTreeSet = "";            strTreeView = "";            // Set the tree strings based on C3 settings for the unit.            if (entity.hasC3i()) {                if (entity.calculateFreeC3Nodes() == 5)                    strTreeSet = "**";                strTreeView = " (" + entity.getC3NetId() + ")";            } else if (entity.hasC3()) {                if (entity.getC3Master() == null) {                    if (entity.hasC3S())                        strTreeSet = "***";                    else                        strTreeSet = "*";                } else if (!entity.C3MasterIs(entity)) {                    strTreeSet = ">";                    if (entity.getC3Master().getC3Master() != null                        && !entity.getC3Master().C3MasterIs(entity.getC3Master()))                        strTreeSet = ">>";                    strTreeView = " -> " + entity.getC3Master().getDisplayName();                }            }            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")                && !client.game.getOptions().booleanOption("real_blind_drop")) {                String unitClass = "";                if (entity instanceof Infantry) {                    unitClass = "Infantry";                } else if (entity instanceof Protomech) {                    unitClass = "Protomech";                } else {                    int weight = entity.getWeightClass();                    switch (weight) {                        case Entity.WEIGHT_LIGHT :                            unitClass = "Light";                            break;                        case Entity.WEIGHT_MEDIUM :                            unitClass = "Medium";                            break;                        case Entity.WEIGHT_HEAVY :                            unitClass = "Heavy";                            break;                        case Entity.WEIGHT_ASSAULT :                            unitClass = "Assault";                            break;                    }                    if (entity instanceof Tank) {                        unitClass += " Vehicle";                    }                }                lisEntities.add(                    entity.getOwner().getName()                        + " ("                        + entity.getCrew().getGunnery()                        + "/"                        + entity.getCrew().getPiloting()                        + " pilot"                        + (crewAdvCount > 0 ? " <" + crewAdvCount + " advs>" : "")                        + ")"                        + " Class: "                        + unitClass                        + ((entity.getDeployRound() > 0) ? " - Deploy after round " + entity.getDeployRound() : ""));            } else if (entity.getOwner().equals(client.getLocalPlayer())                       || (!client.game.getOptions().booleanOption("blind_drop")                       && !client.game.getOptions().booleanOption("real_blind_drop"))) {                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();        }        // Enable the "Save Unit List..." and "Delete All"        // buttons if the local player has units.        butSaveList.setEnabled(localUnits);        butDeleteAll.setEnabled(localUnits);        // Disable the "must select" buttons.        butCustom.setEnabled(false);        butMechReadout.setEnabled(false);        butDelete.setEnabled(false);    }