void (final MouseEvent e) { final RadComponent component = FormEditingUtil.getRadComponentAt(myEditor.getRootContainer(), e.getX(), e.getY()); LOG.assertTrue(component != null); // Dragger final RadComponent oldDraggerHost = FormEditingUtil.getDraggerHost(myEditor); RadComponent newDraggerHost = null; for (RadComponent c = component; c != null && !(c instanceof RadRootContainer); c = c.getParent()) { if (c.isSelected()) { newDraggerHost = c; break; } } boolean keepOldHost = false; if (oldDraggerHost != null && oldDraggerHost.isSelected()) { final Point p = SwingUtilities.convertPoint(oldDraggerHost.getDelegee(), 0, 0, e.getComponent()); final int deltaX = e.getX() - p.x; final int deltaY = e.getY() - p.y; if( deltaX > -DRAGGER_SIZE && deltaX < oldDraggerHost.getWidth() && deltaY > -DRAGGER_SIZE && deltaY < oldDraggerHost.getHeight() ){ keepOldHost = true; newDraggerHost = null; } } boolean shouldRepaint = false; if (oldDraggerHost != null && !keepOldHost && oldDraggerHost != newDraggerHost){ oldDraggerHost.setDragger(false); shouldRepaint = true; } if (newDraggerHost != null){ newDraggerHost.setDragger(true); shouldRepaint = true; } if (shouldRepaint) { myEditor.repaintLayeredPane(); } }