org.apache.qpid.proton.engine.Event.getEventType()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(5.0k)|赞(0)|评价(0)|浏览(120)

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

Event.getEventType介绍

暂无

代码示例

代码示例来源:origin: stackoverflow.com

public class EventDispatcher {
  private Map<Class<? extends Event>, Collection<Listener<? extends Event>>> listenersDict = new HashMap<Class<? extends Event>, Collection<Listener<? extends Event>>>();

  public void registerListener(Listener<? extends Event> listener) {
    Class<? extends Event> eventType = listener.getEventType();
    Collection<Listener<? extends Event>> listeners = listenersDict.get(eventType);

    if(listeners == null) {
      listeners = new ArrayList<Listener<? extends Event>>();
      listenersDict.put(eventType, listeners);
    }
    listeners.add(listener);
  }

  public void dispatch(Event event) {
    Class<? extends Event> eventType = event.getEventType();
    Collection<Listener<? extends Event>> listeners = listenersDict.get(eventType);

    if(listeners != null) {
      for(Listener<? extends Event> listener : listeners) {
        if (listener.getEventType() == eventType) {
          listener.onEvent(event);
        }
      }
    }
  }
}

代码示例来源:origin: stackoverflow.com

class CellEventDispatcher implements EventDispatcher {

  private final EventDispatcher original;

  public CellEventDispatcher(EventDispatcher original) {
    this.original = original;
  }

  @Override
  public Event dispatchEvent(Event event, EventDispatchChain tail) {
    if (event.getEventType().equals(MouseEvent.MOUSE_PRESSED) || 
       event.getEventType().equals(ContextMenuEvent.ANY)){
      event.consume();
    }
    if(event instanceof KeyEvent && event.getEventType().equals(KeyEvent.KEY_PRESSED)){
      if((((KeyEvent)event).getCode().equals(KeyCode.LEFT) || 
         ((KeyEvent)event).getCode().equals(KeyCode.RIGHT))){
        event.consume();
      }
    }
    return original.dispatchEvent(event, tail);
  }
}

代码示例来源:origin: org.apache.qpid/proton-j

@Override
public boolean quiesced() {
  Event event = collector.peek();
  if (event == null) return true;
  if (collector.more()) return false;
  return event.getEventType() == Type.REACTOR_QUIESCED;
}

代码示例来源:origin: com.microsoft.azure.iot/proton-j-azure-iot

@Override
public boolean quiesced() {
  Event event = collector.peek();
  if (event == null) return true;
  if (collector.more()) return false;
  return event.getEventType() == Type.REACTOR_QUIESCED;
}

代码示例来源:origin: stackoverflow.com

if (event instanceof MouseEvent){
  MouseEvent m = (MouseEvent)event;
  if (event.getEventType().equals(MouseEvent.MOUSE_CLICKED) || 
    event.getEventType().equals(MouseEvent.MOUSE_PRESSED)) {
    Point2D origin=new Point2D(m.getX(),m.getY());
    allowDrag=!(origin.getX()<limit.getX() && origin.getY()<limit.getY());
  if (event.getEventType().equals(MouseEvent.MOUSE_DRAGGED)) {
    if(!allowDrag){
      event.consume();
if (event instanceof KeyEvent && event.getEventType().equals(KeyEvent.KEY_PRESSED)){
  KeyEvent k= (KeyEvent)event;

代码示例来源:origin: stackoverflow.com

@Override
 protected void onStart() {
   super.onStart();
   //   mAuth.addAuthStateListener(mAuthLitsener);
   FirebaseRecyclerAdapter<Event,EventViewHolder> firebaseRecyclerAdapter_ = new FirebaseRecyclerAdapter<Event, GraduationListActivity.EventViewHolder>(Event.class,
       R.layout.item_event_view,
       GraduationListActivity.EventViewHolder.class,
       queryRef) {
     @Override
     protected void populateViewHolder(GraduationListActivity.EventViewHolder viewHolder, final Event model, final int position) {
       final String key_post = getRef(position).getKey();
       viewHolder.setEventLocation(model.getEventlocation());
       viewHolder.setEventName(model.getEventName());
       viewHolder.setEventType(model.getEventType());
       viewHolder.mView.setOnClickListener(new View.OnClickListener() {
         @Override
         public void onClick(View v) {
           // Toast.makeText(EventViewActivity.this,"This is : "+position,Toast.LENGTH_LONG).show();
           Intent loadMainActivity = new Intent(GraduationListActivity.this,MainActivity.class);
           loadMainActivity.putExtra(EventViewHolder.KEY_PARTY_NAME, model.getEventName());
           startActivity(loadMainActivity);
         }
       });
     }
   };
   mRecyclerview_event_view.setAdapter(firebaseRecyclerAdapter_);
 }

代码示例来源:origin: com.microsoft.azure.iot/proton-j-azure-iot

dispatch(event, global);
if (event.getEventType() == Type.CONNECTION_FINAL) {
  children.remove(event.getConnection());
this.previous = event.getEventType();
previous = this.previous;
collector.pop();

代码示例来源:origin: org.apache.qpid/proton-j

dispatch(event, global);
if (event.getEventType() == Type.CONNECTION_FINAL) {
  children.remove(event.getConnection());
this.previous = event.getEventType();
previous = this.previous;
collector.pop();

代码示例来源:origin: stackoverflow.com

public class EventTable {
public void setEvent(Event e) {
 int x = 0;
 int type = e.getEventType();

 columns = e.getFields();
 Event[] savedEvents = e.getSavedEvents();
 for(Event ev : savedEvents) {
 tempdata[x][0] = ev.getFormattedDate()[0];
 switch(type) {
  case EVENTTYPE.WEIGHT:
  tempdata[x][1] = ev.getWeight();
  tempdata[x][2] = ev.getReps();
  break;
  case EVENTTYPE.TIMED:
  tempdata[x][1] = ev.getTimeInHMS();
  break;
  case EVENTTYPE.REP:
  tempdata[x][1] = ev.getReps();
  break;
 }
 x++;
 }
}
}

代码示例来源:origin: stackoverflow.com

System.out.printf("%05d %s: %s\n", count++, name, e.getEventType().getName());

相关文章