@Override
		public void eventDispatched(AWTEvent e, JLayer<? extends JComponent> layer) {

			boolean block = !layer.isEnabled();

			if (block) {
				if (e instanceof FocusEvent) {
					return;
				}
				else if (e instanceof MouseEvent) {
					((MouseEvent) e).consume();
					return;
				}
				else if (e instanceof KeyEvent) {
					((KeyEvent) e).consume();
					return;
				}
			}

			super.eventDispatched(e, layer);
		}
A factory to create JLayer instances to provide the L&amp;F and functionality of a 
disabled panel -- the component assumes a disabled color, and selection via mouse and
keyboard is prevented. As this is simply a layer in the UI stack, previous states of 
components is maintained and unmodified.
Ghidra/Framework/Docking/src/main/java/docking/DisabledComponentLayerFactory.java