@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); }
@SuppressWarnings("unchecked") @Override public final void actionPerformed(final ActionEvent e) { final FComboBox<Object> cb = (FComboBox<Object>) e.getSource(); cb.requestFocusInWindow(); final Object selection = cb.getSelectedItem(); if (null != selection) { lobby.changePlayerFocus(index); 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(); } }
@Override public void focusGained(final FocusEvent e) { lobby.changePlayerFocus(index); }