} else if (ev.getActionCommand().equalsIgnoreCase("custom_mech")) { if (lisEntities.getSelectedIndex() != -1) { Entity entity = client.game.getEntity(entityCorrespondance[lisEntities.getSelectedIndex()]); boolean editable = entity.getOwnerId() == client.getLocalPlayer().getId();  CustomMechDialog cmd = new CustomMechDialog(client.frame, entity, editable); cmd.show(); if (editable && cmd.isOkay()) {   client.sendUpdateEntity(entity); } }
    public void actionPerformed(ActionEvent ev) {        if (ev.getActionCommand().equalsIgnoreCase("ready")) {            client.sendReady(!client.getLocalPlayer().isReady());            refreshReadyButton();        } else if (ev.getActionCommand().equalsIgnoreCase("load_mech")) {            // add (load) mech            FileDialog fd = new FileDialog(client.frame,                                            "Select a .mep file...",                                           FileDialog.LOAD);            fd.setDirectory("data" + File.separator + "mep");            fd.show();            if (fd.getFile() == null) {                return;            }            // read the file            File file = new File(fd.getDirectory(), fd.getFile());            MepFile mf = new MepFile(file);            if (!file.exists()) {                // error reading file                new AlertDialog(client.frame, "Open", "Error: could not read file or file not found.").show();            } else {                Mech mech = mf.getMech();                if (mech == null) {                    // error making mech                    new AlertDialog(client.frame, "Open", "Error: could not make mech from file (possibly not 3025.)").show();                } else {                    mech.setOwner(client.getLocalPlayer());                    client.sendAddEntity(mech);                }            }        } else if (ev.getActionCommand().equalsIgnoreCase("delete_mech")) {            // delete mech            if (lisEntities.getSelectedIndex() != -1) {                client.sendDeleteEntity(entityCorrespondance[lisEntities.getSelectedIndex()]);            }        } else if (ev.getActionCommand().equalsIgnoreCase("change_board")) {            // board settings             //client.gameSettings.boardWidth = Integer.parseInt(tfdBoardW.getText());            //client.gameSettings.boardHeight = Integer.parseInt(tfdBoardH.getText());            client.gameSettings.sheetWidth = Integer.parseInt(tfdSheetW.getText());            client.gameSettings.sheetHeight = Integer.parseInt(tfdSheetH.getText());            client.sendGameSettings();        } else if (ev.getActionCommand().startsWith("starting_pos_")) {            // starting position            client.getLocalPlayer().setStartingPos(Integer.parseInt(ev.getActionCommand().substring(13)));            client.sendPlayerInfo();        }    }