void (@NotNull MouseEvent event) { PersistentList<Component> components = persistentListOf(); if (MouseEvent.MOUSE_EXITED != event.getID()) { Component parent = event.getComponent(); if (parent != null && parent.isShowing()) { Component component = getDeepestComponentAt(parent, event.getX(), event.getY()); while (component != null && !(component instanceof Window)) { if (!HoverListener.getAll(component).isEmpty()) { components = components.add(0, component); } component = component.getParent(); } } } int componentsCount = components.size(); int hierarchySize = hierarchy.size(); int index = 0; while (index < hierarchySize && index < componentsCount && components.get(index) == hierarchy.get(index).reference.get()) { index++; } while (index < hierarchySize) { hierarchy.remove(--hierarchySize).mouseExited(); } if (index == componentsCount) { // notify only the deepest component in the hover hierarchy if (index > 0) { hierarchy.get(index - 1).mouseMoved(event); } } else { while (index < componentsCount) { ComponentPoint point = new ComponentPoint(components.get(index++)); hierarchy.add(point); point.mouseEntered(event); } } }