Пример #1
0
 @Override
 public boolean onEnvironmentEvent(EnvironmentEvent event) {
   NullCheck.notNull(event, "event");
   if (event.getType() != EnvironmentEvent.Type.REGULAR) return false;
   switch (event.getCode()) {
     case REFRESH:
       refresh();
       return true;
     case INTRODUCE:
       return onAnnounce();
     case ANNOUNCE_LINE:
       return onAnnounceLine();
     case OK:
       return onOk(event);
     case LISTENING_FINISHED:
       if (event instanceof ListeningFinishedEvent)
         return onListeningFinishedEvent((ListeningFinishedEvent) event);
       return false;
     case MOVE_HOT_POINT:
       if (event instanceof MoveHotPointEvent) return onMoveHotPoint((MoveHotPointEvent) event);
       return false;
     default:
       return region.onEnvironmentEvent(event, hotPointX, hotPointY);
   }
 }
Пример #2
0
 @Override
 public boolean onAreaQuery(AreaQuery query) {
   NullCheck.notNull(query, "query");
   switch (query.getQueryCode()) {
     case AreaQuery.BEGIN_LISTENING:
       if (query instanceof BeginListeningQuery)
         return onBeginListeningQuery((BeginListeningQuery) query);
       return false;
     default:
       return region.onAreaQuery(query, hotPointX, hotPointY);
   }
 }