if (GUIPreferences.getInstance().getFocus() && !(client instanceof megamek.client.bot.TestBot)) curPanel.requestFocus();
if (GUIPreferences.getInstance().getFocus() && !(client instanceof TestBot)) curPanel.requestFocus();
    private void switchPanel(int phase) {        // Clear the old panel's listeners.        if (curPanel instanceof BoardViewListener) {            bv.removeBoardViewListener((BoardViewListener) curPanel);        }        if (curPanel instanceof ActionListener) {            menuBar.removeActionListener((ActionListener) curPanel);        }        if (curPanel instanceof Distractable) {            ((Distractable) curPanel).setIgnoringEvents(true);        }        // Get the new panel.        String name = String.valueOf(phase);        curPanel = (Component) phaseComponents.get(name);        if (null == curPanel) {            curPanel = initializePanel(phase);        }        cardsMain.show(panMain, mainNames.get(name).toString());        cardsSecondary.show(panSecondary, secondaryNames.get(name).toString());        // Set the new panel's listeners        if (curPanel instanceof BoardViewListener) {            bv.addBoardViewListener((BoardViewListener) curPanel);        }        if (curPanel instanceof ActionListener) {            menuBar.addActionListener((ActionListener) curPanel);        }        if (curPanel instanceof Distractable) {            ((Distractable) curPanel).setIgnoringEvents(false);        }        if (curPanel instanceof DoneButtoned) {            JButton done = ((DoneButtoned) curPanel).getDoneButton();            this.cb.setDoneButton(done);            done.setVisible(true);        }        // Make the new panel the focus, if the Client option says so        if (GUIPreferences.getInstance().getFocus() && !(client instanceof megamek.client.bot.TestBot)) curPanel.requestFocus();    }