RadComponent (int x, int y, @Nullable ComponentTargetFilter filter) { TreePath path = myTree.getPathForLocation(x, y); if (path != null) { RadComponent component = myTree.extractComponent(path.getLastPathComponent()); if (filter != null) { while (component != null) { if (filter.preFilter(component) && filter.resultFilter(component)) { break; } component = component.getParent(); } } return component; } return null; }