src/main/java/com/spinyowl/legui/component/misc/listener/component/TabKeyEventListener.java
private Component findNextInParent(Component component, Component parent, Component next) {
    if (parent == null) {
      return next;
    }

    List<Component> childComponents = parent.getChildComponents();
    childComponents.sort(comparator);

    int index = childComponents.indexOf(component);
    if (index != childComponents.size() - 1) {
      for (int i = index + 1; i < childComponents.size(); i++) {
        Component child = childComponents.get(i);
        if (child.isVisible()) {
          if (isFF(child)) {
            return child;
          } else if (!child.isEmpty()) {
            Component cnext = findNextInChildComponents(child.getChildComponents(), next);
            if (next != cnext) {
              return cnext;
            }
          }
        }
      }
      next = findNextInParent(parent, parent.getParent(), next);
    } else {
      next = findNextInParent(parent, parent.getParent(), next);
    }

    return next;
  }
/**
   * Used to find next component in parent (in neighbors).
   *
   * @param component current component.
   * @param parent    parent component.
   * @param next      current next component.
   * @return next component.
   */
Used to find next component in parent (in neighbors).
@param component current component.
@param parent    parent component.
@param next      current next component.
@return next component.
Used to find next component in parent ( in neighbors ) . @param component current component . @param parent parent component . @param next current next component . @return next component .
private Component findNextInParent(Component component, Component parent, Component next) {
    if (parent == null) {
      return next;
    }
    List<Component> childComponents = parent.getChildComponents();
    childComponents.sort(comparator);
    int index = childComponents.indexOf(component);
    if (index != childComponents.size() - 1) {
      for (int i = index + 1; i < childComponents.size(); i++) {
        Component child = childComponents.get(i);
        if (child.isVisible()) {
          if (isFF(child)) {
            return child;
          } else if (!child.isEmpty()) {
            Component cnext = findNextInChildComponents(child.getChildComponents(), next);
            if (next != cnext) {
              return cnext;
            }
          }
        }
      }
      next = findNextInParent(parent, parent.getParent(), next);
    } else {
      next = findNextInParent(parent, parent.getParent(), next);
    }
    return next;
  }
private Component findNextInParent ( Component component , Component parent , Component next ) { if ( parent == null ) { return next ; } List < Component > childComponents = parent . getChildComponents ( ) ; childComponents . sort ( comparator ) ; int index = childComponents . indexOf ( component ) ; if ( index != childComponents . size ( ) - 1 ) { for ( int i = index + 1 ; i < childComponents . size ( ) ; i ++ ) { Component child = childComponents . get ( i ) ; if ( child . isVisible ( ) ) { if ( isFF ( child ) ) { return child ; } else if ( ! child . isEmpty ( ) ) { Component cnext = findNextInChildComponents ( child . getChildComponents ( ) , next ) ; if ( next != cnext ) { return cnext ; } } } } next = findNextInParent ( parent , parent . getParent ( ) , next ) ; } else { next = findNextInParent ( parent , parent . getParent ( ) , next ) ; } return next ; }
Used to find next component in parent (in neighbors).
Used to find next component in parent ( in neighbors ) .