if (ce != null) { ce.setSelected(false);
Entity oldSelected = client.game.getEntity(cen); if (oldSelected != null) { oldSelected.setSelected(false);
    public synchronized void selectEntity(int en) {        final Entity ce = client.game.getEntity(en);                        // hmm, sometimes this gets called when there's no ready entities?        if (ce == null) {            System.err.println("MovementDisplay: tried to select non-existant entity: " + en); //$NON-NLS-1$            return;        }        // okay...        if (ce != null) {            ce.setSelected(false);        }        this.cen = en;        ce.setSelected(true);        clearAllMoves();        updateButtons();        // Update the menu bar.        clientgui.getMenuBar().setEntity( ce );                clientgui.getBoardView().highlight(ce.getPosition());        clientgui.getBoardView().select(null);        clientgui.getBoardView().cursor(null);        clientgui.mechD.displayEntity(ce);        clientgui.mechD.showPanel("movement"); //$NON-NLS-1$        if (!clientgui.bv.isMovingUnits()) {            clientgui.bv.centerOnHex(ce.getPosition());        }    }