/* (non-Javadoc)
  * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
  */
 public void actionPerformed(ActionEvent ae) {
   if (ae.getSource().equals(this.okp.getOKButton())) {
     ItemManager im = getItemManager();
     String sProperty = jcbName.getSelectedItem().toString();
     im.removeProperty(sProperty);
     Properties properties = new Properties();
     properties.put(DETAIL_CONTENT, sProperty);
     Event event = new Event(EVENT_CUSTOM_PROPERTIES_REMOVE, properties);
     ObservationManager.notify(event);
     dispose();
   } else if (ae.getSource().equals(this.okp.getCancelButton())) {
     dispose();
   }
 }
Пример #2
0
  public void perform(ActionEvent evt) {
    // check modifiers to see if it is a movement inside track, between
    // tracks or between albums
    if (evt != null
        // evt == null when using hotkeys
        && (evt.getModifiers() & ActionEvent.SHIFT_MASK) == ActionEvent.SHIFT_MASK) {
      ActionManager.getAction(JajukAction.NEXT_ALBUM).actionPerformed(evt);
    } else {
      // if playing a radio, launch next radio station
      if (FIFO.getInstance().isPlayingRadio()) {
        final ArrayList<WebRadio> radios =
            new ArrayList<WebRadio>(WebRadioManager.getInstance().getWebRadios());
        int index = radios.indexOf(FIFO.getInstance().getCurrentRadio());
        if (index == radios.size() - 1) {
          index = 0;
        } else {
          index++;
        }
        final int i = index;
        new Thread() {
          public void run() {
            FIFO.getInstance().launchRadio(radios.get(i));
          }
        }.start();

      } else {
        // Playing a track
        synchronized (MUTEX) {
          new Thread() {
            public void run() {
              try {
                FIFO.getInstance().playNext();
              } catch (Exception e) {
                Log.error(e);
              }
            }
          }.start();

          // Player was paused, reset pause button when changing of
          // track
          if (Player.isPaused()) {
            Player.setPaused(false);
            ObservationManager.notify(new Event(EventSubject.EVENT_PLAYER_RESUME));
          }
        }
      }
    }
  }