void ( final RadComponent component, final Rectangle rectangle, final Component coordinateOriginComponent ) { if (!(component instanceof RadRootContainer) && !component.equals(myComponent)) { final Rectangle bounds = component.getBounds(); final Point point = SwingUtilities.convertPoint(component.getDelegee().getParent(), bounds.x, bounds.y, coordinateOriginComponent); bounds.setLocation(point); if(rectangle.intersects(bounds)){ component.setSelected(true); return; } } if (component instanceof RadContainer container){ // [anton] it is very important to iterate through a STORED array because setSelected can // change order of components so iteration via getComponent(i) is incorrect final RadComponent[] components = container.getComponents(); for (RadComponent component1 : components) { markRectangle(component1, rectangle, coordinateOriginComponent); } } }