void update() { avatarLabel.setEnabled(mayEdit); avatarLabel.setIcon( FSkin.getAvatars().get(Integer.valueOf(type == LobbySlotType.OPEN ? -1 : avatarIndex))); avatarLabel.repaintSelf(); txtPlayerName.setEnabled(mayEdit); txtPlayerName.setText(type == LobbySlotType.OPEN ? StringUtils.EMPTY : playerName); nameRandomiser.setEnabled(mayEdit); deckLabel.setVisible(mayEdit); deckBtn.setVisible(mayEdit); chkReady.setVisible(type == LobbySlotType.LOCAL || type == LobbySlotType.REMOTE); chkReady.setEnabled(mayEdit); closeBtn.setVisible(mayRemove); if (mayRemove) { radioHuman.setEnabled(mayControl); radioAi.setEnabled(mayControl); radioOpen.setEnabled(mayControl); } else { radioHuman.setVisible(mayControl); radioAi.setVisible(mayControl); radioOpen.setVisible(mayControl); } radioHuman.setSelected(type == LobbySlotType.LOCAL); radioAi.setSelected(type == LobbySlotType.AI); radioOpen.setSelected(type == LobbySlotType.OPEN); updateVariantControlsVisibility(); }
public void setAvatarIndex(final int avatarIndex0) { avatarIndex = avatarIndex0; final SkinImage icon = FSkin.getAvatars().get(avatarIndex); avatarLabel.setIcon(icon); avatarLabel.repaintSelf(); }