/**
* Sets up the player info (team, camo) panel
*/
private void setupPlayerInfo() {
Player player = client.getLocalPlayer();
panPlayerInfo = new Panel();
labPlayerInfo = new Label(Messages
.getString("ChatLounge.labPlayerInfo")); //$NON-NLS-1$
lisPlayerInfo = new List(5);
lisPlayerInfo.addItemListener(new ItemListener() {
public void itemStateChanged(ItemEvent e) {
butRemoveBot.setEnabled(false);
Client c = getPlayerListSelected(lisPlayerInfo);
refreshCamos();
if (c == null) {
lisPlayerInfo.select(-1);
return;
}
if (c instanceof BotClient) {
butRemoveBot.setEnabled(true);
}
choTeam.select(c.getLocalPlayer().getTeam());
}
});
butAddBot = new Button(Messages.getString("ChatLounge.butAddBot")); //$NON-NLS-1$
butAddBot.setActionCommand("add_bot"); //$NON-NLS-1$
butAddBot.addActionListener(this);
butRemoveBot = new Button(Messages.getString("ChatLounge.butRemoveBot")); //$NON-NLS-1$
butRemoveBot.setEnabled(false);
butRemoveBot.setActionCommand("remove_bot"); //$NON-NLS-1$
butRemoveBot.addActionListener(this);
labTeam = new Label(
Messages.getString("ChatLounge.labTeam"), Label.RIGHT); //$NON-NLS-1$
labCamo = new Label(
Messages.getString("ChatLounge.labCamo"), Label.RIGHT); //$NON-NLS-1$
choTeam = new Choice();
setupTeams();
choTeam.addItemListener(this);
butCamo = new ImageButton();
butCamo.setLabel(Messages.getString("ChatLounge.noCamo")); //$NON-NLS-1$
butCamo.setPreferredSize(84, 72);
butCamo.setActionCommand("camo"); //$NON-NLS-1$
butCamo.addActionListener(this);
camoDialog.addItemListener(new CamoChoiceListener(camoDialog, butCamo,
butOptions.getBackground(), this));
refreshCamos();
// If we have a camo pattern, use it. Otherwise set a background.
Image[] images = (Image[]) camoDialog.getSelectedObjects();
if (null != images) {
butCamo.setImage(images[0]);
} else {
butCamo
.setBackground(PlayerColors
.getColor(player.getColorIndex()));
}
butInit = new Button(Messages.getString("ChatLounge.butInit")); //$NON-NLS-1$
butInit.setEnabled(true);
butInit.setActionCommand("custom_init"); //$NON-NLS-1$