src/main/java/com/spinyowl/legui/component/misc/listener/splitpanel/SplitPanelDragListener.java
@Override
  public void process(MouseDragEvent event) {
    Orientation orientation = splitPanel.getOrientation();
    float ratio = splitPanel.getRatio();
    Vector2f delta = event.getDelta();
    float d;
    if (orientation == HORIZONTAL) {
      d = delta.x;
      if (d > 0 && splitPanel.getPosition().x > Mouse.getCursorPosition().x) {
        return;
      }
      if (d < 0
          && splitPanel.getPosition().x + splitPanel.getSize().x < Mouse.getCursorPosition().x) {
        return;
      }
    } else {
      d = delta.y;
      if (d > 0 && splitPanel.getPosition().y > Mouse.getCursorPosition().y) {
        return;
      }
      if (d < 0
          && splitPanel.getPosition().y + splitPanel.getSize().y < Mouse.getCursorPosition().y) {
        return;
      }
    }
    ratio += 100 * d / getActualSpace(orientation);
    updateGrow(ratio, orientation);
    splitPanel.setRatio(ratio);
  }
/**
   * Used to handle {@link MouseDragEvent}.
   *
   * @param event event to handle.
   */
Used to handle  MouseDragEvent.
@param event event to handle.
Used to handle MouseDragEvent . @param event event to handle .
@Override
  public void process(MouseDragEvent event) {
    Orientation orientation = splitPanel.getOrientation();
    float ratio = splitPanel.getRatio();
    Vector2f delta = event.getDelta();
    float d;
    if (orientation == HORIZONTAL) {
      d = delta.x;
      if (d > 0 && splitPanel.getPosition().x > Mouse.getCursorPosition().x) {
        return;
      }
      if (d < 0
          && splitPanel.getPosition().x + splitPanel.getSize().x < Mouse.getCursorPosition().x) {
        return;
      }
    } else {
      d = delta.y;
      if (d > 0 && splitPanel.getPosition().y > Mouse.getCursorPosition().y) {
        return;
      }
      if (d < 0
          && splitPanel.getPosition().y + splitPanel.getSize().y < Mouse.getCursorPosition().y) {
        return;
      }
    }
    ratio += 100 * d / getActualSpace(orientation);
    updateGrow(ratio, orientation);
    splitPanel.setRatio(ratio);
  }
@ Override public void process ( MouseDragEvent event ) { Orientation orientation = splitPanel . getOrientation ( ) ; float ratio = splitPanel . getRatio ( ) ; Vector2f delta = event . getDelta ( ) ; float d ; if ( orientation == HORIZONTAL ) { d = delta . x ; if ( d > 0 && splitPanel . getPosition ( ) . x > Mouse . getCursorPosition ( ) . x ) { return ; } if ( d < 0 && splitPanel . getPosition ( ) . x + splitPanel . getSize ( ) . x < Mouse . getCursorPosition ( ) . x ) { return ; } } else { d = delta . y ; if ( d > 0 && splitPanel . getPosition ( ) . y > Mouse . getCursorPosition ( ) . y ) { return ; } if ( d < 0 && splitPanel . getPosition ( ) . y + splitPanel . getSize ( ) . y < Mouse . getCursorPosition ( ) . y ) { return ; } } ratio += 100 * d / getActualSpace ( orientation ) ; updateGrow ( ratio , orientation ) ; splitPanel . setRatio ( ratio ) ; }
Used to handle {@link MouseDragEvent}.
Used to handle { @link MouseDragEvent } .