@Override public final void onLeftClick(final MouseEvent e) { if (!avatarLabel.isEnabled()) { return; } final FLabel avatar = (FLabel) e.getSource(); lobby.changePlayerFocus(index); avatar.requestFocusInWindow(); final AvatarSelector aSel = new AvatarSelector(playerName, avatarIndex, lobby.getUsedAvatars()); for (final FLabel lbl : aSel.getSelectables()) { lbl.setCommand( new UiCommand() { @Override public void run() { setAvatarIndex(Integer.valueOf(lbl.getName().substring(11))); aSel.setVisible(false); } }); } aSel.setVisible(true); aSel.dispose(); if (index < 2) { lobby.updateAvatarPrefs(); } lobby.firePlayerChangeListener(index); }
@Override public final void onRightClick(final MouseEvent e) { if (!avatarLabel.isEnabled()) { return; } lobby.changePlayerFocus(index); avatarLabel.requestFocusInWindow(); setRandomAvatar(); if (index < 2) { lobby.updateAvatarPrefs(); } }
public void focusOnAvatar() { avatarLabel.requestFocusInWindow(); }