RadContainer (final RadRootContainer rootContainer, final int x, final int y, int epsilon) { RadComponent component = getRadComponentAt(rootContainer, x, y); if (isNullOrRoot(component) && epsilon > 0) { // try to find component near specified location component = getRadComponentAt(rootContainer, x - epsilon, y - epsilon); if (isNullOrRoot(component)) component = getRadComponentAt(rootContainer, x - epsilon, y + epsilon); if (isNullOrRoot(component)) component = getRadComponentAt(rootContainer, x + epsilon, y - epsilon); if (isNullOrRoot(component)) component = getRadComponentAt(rootContainer, x + epsilon, y + epsilon); } if (component != null) { return component instanceof RadContainer ? (RadContainer)component : component.getParent(); } return null; }