private boolean isToTheLeftOrAboveTheText(InputEvent event) {
      if (event instanceof MouseEvent mouseEvent) {
        var insets = getInsets();
        if (insets == null) {
          return false;
        }
        return mouseEvent.getX() < insets.left || mouseEvent.getY() < insets.top;
      }
      return false;
    }
private boolean isToTheLeftOrAboveTheText(InputEvent event)