void (MouseEvent e) { IdeMouseEventDispatcher.requestFocusInNonFocusedWindow(e); super.processMouseEvent(e); if (e.isConsumed()) return; boolean skipPress = checkSkipPressForEvent(e); switch (e.getID()) { case MouseEvent.MOUSE_PRESSED -> { if (skipPress || !isEnabled()) return; myMouseDown = true; myRollover = true; onMousePressed(e); ourGlobalMouseDown = true; repaint(); } case MouseEvent.MOUSE_RELEASED -> { if (skipPress || !isEnabled()) return; onMouseReleased(e); if (myRollover) { performAction(e); } repaint(); } case MouseEvent.MOUSE_ENTERED -> { if (!myMouseDown && ourGlobalMouseDown) break; myRollover = true; repaint(); onMousePresenceChanged(true); } case MouseEvent.MOUSE_EXITED -> { myRollover = false; if (!myMouseDown && ourGlobalMouseDown) break; repaint(); onMousePresenceChanged(false); } } }