public static int getResizeMask(final @NotNull RadComponent component, final int x, final int y) {
    if (component.getParent() == null || !component.isSelected()) {
      return 0;
    }

    // only components in XY can be resized...
    /*
    if (!component.getParent().isXY()) {
      return 0;
    }
    */

    final int width = component.getWidth();
    final int height = component.getHeight();

    final Point[] points = getPoints(width, height);

    if (isInside(x, y, points[SE])) {
      return EAST_MASK | SOUTH_MASK;
    }
    else if (isInside(x, y, points[NW])) {
      return WEST_MASK | NORTH_MASK;
    }
    else if (isInside(x, y, points[N])) {
      return NORTH_MASK;
    }
    else if (isInside(x, y, points[NE])) {
      return EAST_MASK | NORTH_MASK;
    }
    else if (isInside(x, y, points[W])) {
      return WEST_MASK;
    }
    else if (isInside(x, y, points[E])) {
      return EAST_MASK;
    }
    else if (isInside(x, y, points[SW])) {
      return WEST_MASK | SOUTH_MASK;
    }
    else if (isInside(x, y, points[S])) {
      return SOUTH_MASK;
    }
    else {
      return 0;
    }
  }
public static int getResizeMask(final @NotNull RadComponent component, final int x, final int y)