Exemplo n.º 1
0
  /**
   * Calls the actionPerformed method of all the registered callbacks.
   *
   * <p>
   */
  public void notifyUCallbackListeners() {
    for (Enumeration e = tab.elements(); e.hasMoreElements(); ) {
      UCallbackListener listener = (UCallbackListener) tab.get(e.nextElement());

      listener.actionPerformed(null);
    }
  }
Exemplo n.º 2
0
  /**
   * Calls the actionPerformed method of a registered callback associated with the given event.
   *
   * <p>
   *
   * @param event The event associated with the registered callback.
   */
  public void notifyUCallbackListener(URBIEvent event) {
    UCallbackListener listener = null;
    try {
      listener = (UCallbackListener) tab.get(event.getTag());
    } catch (Exception e) {
      // TODO Auto-generated catch block
      // e.printStackTrace();
    }

    if (listener != null) {
      listener.actionPerformed(event);
    } else if (event.getTimestamp() != 0)
      System.out.println("[" + event.getTimestamp() + ":" + event.getTag() + "] " + event.getCmd());
  }