Beispiel #1
0
        @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);
        }
Beispiel #2
0
        @Override
        public final void onRightClick(final MouseEvent e) {
          if (!avatarLabel.isEnabled()) {
            return;
          }

          lobby.changePlayerFocus(index);
          avatarLabel.requestFocusInWindow();

          setRandomAvatar();

          if (index < 2) {
            lobby.updateAvatarPrefs();
          }
        }
Beispiel #3
0
 public void focusOnAvatar() {
   avatarLabel.requestFocusInWindow();
 }