org.jflux.api.core.Listener.handleEvent()方法的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(5.5k)|赞(0)|评价(0)|浏览(158)

本文整理了Java中org.jflux.api.core.Listener.handleEvent()方法的一些代码示例,展示了Listener.handleEvent()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Listener.handleEvent()方法的具体详情如下:
包路径:org.jflux.api.core.Listener
类名称:Listener
方法名:handleEvent

Listener.handleEvent介绍

[英]Handles an input event of type T
[中]处理T类型的输入事件

代码示例

代码示例来源:origin: org.jflux/org.jflux.api.common.rk

@Override
public void handleEvent(Msg event) {
  for(Listener<Msg> l : myListeners){
    l.handleEvent(event);
  }
}

代码示例来源:origin: org.jflux/org.jflux.api.core

/**
 * Forwards event to all Listeners
 * @param e event to forward
 */
@Override
public void notifyListeners(E e){
  for(Listener<E> l : myListeners){
    l.handleEvent(e);
  }
}

代码示例来源:origin: org.jflux/org.jflux.api.messaging.rk

/**
 * Notifies listeners of a Message
 * @param message 
 */
protected void fireMessageEvent(Msg message){
  for(Listener<Msg> listener : myListeners){
    listener.handleEvent(message);
  }
}

代码示例来源:origin: org.robokind/org.robokind.api.speech

/**
 * Notifies listeners of a VisemeEvent.
 * @param event VisemeEvent to send to listeners
 */
public void handleVisemeEvent(VisemeEvent event) {
  for(Listener<VisemeEvent> l : myListeners){
    l.handleEvent(event);
  }
}

代码示例来源:origin: org.jflux/org.jflux.api.messaging.rk

/**
 * Notifies listeners of a Message
 * @param message 
 */
protected void fireMessageEvent(Msg message){
  for(Listener<Msg> listener : myListeners){
    listener.handleEvent(message);
  }
}

代码示例来源:origin: org.jflux/org.jflux.impl.services.rk

@Override
public void stop(){
  if(myStopListener != null && myService != null){
    myStopListener.handleEvent(myService);
  }
  myService = null;
}

代码示例来源:origin: org.cogchar/org.cogchar.bundle.demo.convo

@Override public void run() {
    if(myInputListener == null){
      return;
    }
    myInputListener.handleEvent(prompt);
  }
}, sleep, TimeUnit.MILLISECONDS);

代码示例来源:origin: org.jflux/org.jflux.api.messaging.rk

/**
 * Notifies listeners of a Message being sent.
 * @param message Message being sent
 */
protected void fireMessageEvent(Msg message){
  for(Listener<Msg> listener : myListeners){
    listener.handleEvent(message);
  }
}

代码示例来源:origin: org.robokind/org.robokind.api.speech

/**
 * Notifies listeners of a SpeechEvent.
 * @param ev SpeechEvent to send to listeners
 */
public void fireSpeechEvent(SpeechEventList<SpeechEvent> ev){
  for(Listener<SpeechEventList<SpeechEvent>> listener: mySpeechEventListeners){
    listener.handleEvent(ev);
  }
}

代码示例来源:origin: org.cogchar/org.cogchar.bundle.demo.convo

public void updatetPollInterval(){
  String str = txtCogbotPollInterval.getText();
  try{
    Long interval = Long.parseLong(str);
    interval = Math.max(interval, 1);
    myCogbotPollIntervalSetter.handleEvent(interval);
  }catch(NumberFormatException ex){
    theLogger.log(Level.WARNING, 
        "Invalid Poll Interval, not a number: " + str, ex);
  }
}

代码示例来源:origin: org.cogchar/org.cogchar.bundle.demo.convo

public boolean connect(){
  String ip = txtBrokerAddress.getText();
  String dest = txtDestination.getText();
  myIpSetter.handleEvent(ip);
  myDestSetter.handleEvent(dest);
  boolean val = myConnector.connect();
  txtBrokerAddress.setEnabled(!val);
  txtDestination.setEnabled(!val);
  return val;
}

代码示例来源:origin: org.jflux/org.jflux.api.core

/**
 * Runs data through the ListenerChain
 * @param input the data
 */
@Override
public void handleEvent(A input) {
  B b = myAdapter.adapt(input);
  myInnerListener.handleEvent(b);
}

代码示例来源:origin: org.robokind/org.robokind.impl.motion.dynamixel

private boolean read(int i, byte packetSize, 
    final Listener<DynamixelPacket[]> callback){
  final DynamixelPacket[] packets = 
      DynamixelMultiReader.readPackets(myController, i, packetSize);
  if(callback != null){
    callback.handleEvent(packets);
  }
  if(packets == null || packets.length != i){
    return false;
  }
  return true;
}

代码示例来源:origin: org.robokind/org.robokind.impl.motion.dynamixel

private boolean read(int i, byte packetSize, 
    final Listener<DynamixelPacket[]> callback){
  final DynamixelPacket[] packets = readPackets(myController, i, packetSize);
  if(callback != null){
    callback.handleEvent(packets);
  }
  if(packets == null || packets.length != i){
    return false;
  }
  return true;
}

代码示例来源:origin: org.cogchar/org.cogchar.bundle.bind.robokind

private static void set(Configuration<String> conf, String key, String val){
    conf.getPropertySetter(String.class, key).handleEvent(val);
  }
}

代码示例来源:origin: org.cogchar/org.cogchar.bundle.bind.mechio

private static void set(Configuration<String> conf, String key, String val){
    conf.getPropertySetter(String.class, key).handleEvent(val);
  }
}

代码示例来源:origin: org.cogchar/org.cogchar.bundle.bind.cogbot

public static <T> void setValue(Class<T> clazz, String key, T val){
  defaultConfiguration().getPropertySetter(clazz, key).handleEvent(val);
}

代码示例来源:origin: org.jflux/org.jflux.impl.services.rk

@Override
protected void handleChange(
    String name, Object dependency, 
    Map<String, Object> availableDependencies) {
  if(myChangeListeners == null){
    return;
  }
  Listener<DependencyChange> listener = myChangeListeners.adapt(name);
  if(listener == null){
    return;
  }
  DependencyChange change = 
      new DependencyChange(this, dependency, availableDependencies);
  listener.handleEvent(change);
}

代码示例来源:origin: org.cogchar/org.cogchar.bundle.bind.cogbot

public static <T> void setOrCreateValue(Class<T> clazz, String key, T val){
    Configuration<String> conf = defaultConfiguration();
    Listener<T> l = conf.getPropertySetter(clazz, key);
    if(l == null){
      if(conf instanceof DefaultConfiguration){
        ((DefaultConfiguration)conf).addProperty(clazz, key, val);
        l = conf.getPropertySetter(clazz, key);
      }
    }
    if(l != null){
      l.handleEvent(val);
    }
  }    
}

代码示例来源:origin: org.jflux/org.jflux.impl.registry.osgi

@Override public void serviceChanged(ServiceEvent se) {
    if(se == null || se.getServiceReference() == null){
      return;
    }
    RegistryEvent e = new BasicRegistryEvent(
        se.getType(), new OSGiReference(se.getServiceReference()));
    listener.handleEvent(e);
  }};
myListenerMap.put(listener, l);

相关文章