Beispiel #1
0
  @Override
  public void onEvent(ConsoleState state, Event.Key kev) {
    // System.out.println("WindowChildren OnEvent.Key " + kev.key);
    super.onEvent(state, kev);
    if (active_ != null) active_.onEvent(state, kev);

    if (kev.state == Event.State.RELEASED) {
      switch (kev.key) {
        case TAB:
          if (children_.isEmpty()) {
            setActive(state, null);
          } else {
            Window current = active_;
            boolean found = false;
            int i = active_ != null ? children_.indexOf(active_) + 1 : 0;
            while (!found) {
              if (i >= children_.size()) {
                if (current == null) break;
                else i = 0;
              }
              Window active = children_.get(i);
              found = setActive(state, active);
              if (active == current) break;
              ++i;
            }
          }
          break;
      }
    }
  }
Beispiel #2
0
 public int indexOf(Object o) {
   return adapter.indexOf(o);
 }