src/main/java/com/spinyowl/legui/system/handler/CursorPosEventHandler.java
private void handle(Component component, Context context, Frame frame) {
    if (component.isEmpty()) {
      if ((Mouse.MouseButton.MOUSE_BUTTON_LEFT.isPressed()
          || Mouse.MouseButton.MOUSE_BUTTON_RIGHT.isPressed()) &&
          component == context.getFocusedGui()) {
        Vector2f delta = Mouse.getCursorPosition().sub(Mouse.getCursorPositionPrev());
        EventProcessorProvider.getInstance()
            .pushEvent(new MouseDragEvent(component, context, frame, delta));
      }
    } else {
      List<Component> childComponents = component.getChildComponents();
      for (Component child : childComponents) {
        handle(child, context, frame);
      }
    }
  }
/**
   * Used to handle event for specific component.
   *
   * @param component component.
   * @param context   context.
   * @param frame     frame.
   */
Used to handle event for specific component.
@param component component.
@param context   context.
@param frame     frame.
Used to handle event for specific component . @param component component . @param context context . @param frame frame .
private void handle(Component component, Context context, Frame frame) {
    if (component.isEmpty()) {
      if ((Mouse.MouseButton.MOUSE_BUTTON_LEFT.isPressed()
          || Mouse.MouseButton.MOUSE_BUTTON_RIGHT.isPressed()) &&
          component == context.getFocusedGui()) {
        Vector2f delta = Mouse.getCursorPosition().sub(Mouse.getCursorPositionPrev());
        EventProcessorProvider.getInstance()
            .pushEvent(new MouseDragEvent(component, context, frame, delta));
      }
    } else {
      List<Component> childComponents = component.getChildComponents();
      for (Component child : childComponents) {
        handle(child, context, frame);
      }
    }
  }
private void handle ( Component component , Context context , Frame frame ) { if ( component . isEmpty ( ) ) { if ( ( Mouse . MouseButton . MOUSE_BUTTON_LEFT . isPressed ( ) || Mouse . MouseButton . MOUSE_BUTTON_RIGHT . isPressed ( ) ) && component == context . getFocusedGui ( ) ) { Vector2f delta = Mouse . getCursorPosition ( ) . sub ( Mouse . getCursorPositionPrev ( ) ) ; EventProcessorProvider . getInstance ( ) . pushEvent ( new MouseDragEvent ( component , context , frame , delta ) ) ; } } else { List < Component > childComponents = component . getChildComponents ( ) ; for ( Component child : childComponents ) { handle ( child , context , frame ) ; } } }
Used to handle event for specific component.
Used to handle event for specific component .