public void dispatchEvent(XEvent xev) { if (eventLog.isLoggable(Level.FINEST)) eventLog.finest(xev.toString()); int type = xev.get_type(); if (isDisposed()) { return; } switch (type) { case VisibilityNotify: handleVisibilityEvent(xev); break; case ClientMessage: handleClientMessage(xev); break; case Expose: case GraphicsExpose: handleExposeEvent(xev); break; case ButtonPress: case ButtonRelease: handleButtonPressRelease(xev); break; case MotionNotify: handleMotionNotify(xev); break; case KeyPress: handleKeyPress(xev); break; case KeyRelease: handleKeyRelease(xev); break; case EnterNotify: case LeaveNotify: handleXCrossingEvent(xev); break; case ConfigureNotify: handleConfigureNotifyEvent(xev); break; case MapNotify: handleMapNotifyEvent(xev); break; case UnmapNotify: handleUnmapNotifyEvent(xev); break; case ReparentNotify: handleReparentNotifyEvent(xev); break; case PropertyNotify: handlePropertyNotify(xev); break; case DestroyNotify: handleDestroyNotify(xev); break; case CreateNotify: handleCreateNotify(xev); break; } }
public void handleCreateNotify(XEvent xev) { XAnyEvent xany = xev.get_xany(); if (xany.get_window() != getWindow()) { synchronized (getStateLock()) { children.add(xany.get_window()); } } }
/** Activate automatic grab on first ButtonPress, deactivate on full mouse release */ public void handleButtonPressRelease(XEvent xev) { XButtonEvent xbe = xev.get_xbutton(); final int buttonState = xbe.get_state() & (Button1Mask | Button2Mask | Button3Mask | Button4Mask | Button5Mask); switch (xev.get_type()) { case ButtonPress: if (buttonState == 0) { XAwtState.setAutoGrabWindow(this); } break; case ButtonRelease: if (isFullRelease(buttonState, xbe.get_button())) { XAwtState.setAutoGrabWindow(null); } break; } }
public void handlePropertyNotify(XEvent xev) { XPropertyEvent msg = xev.get_xproperty(); if (XPropertyCache.isCachingSupported()) { XPropertyCache.clearCache(window, XAtom.get(msg.get_atom())); } if (eventLog.isLoggable(Level.FINER)) { eventLog.log(Level.FINER, "{0}", new Object[] {String.valueOf(msg)}); } }
/** * Dispatches event to the grab Window or event source window depending on whether the grab is * active and on the event type */ static void dispatchToWindow(XEvent ev) { XBaseWindow target = XAwtState.getGrabWindow(); if (target == null || !isGrabbedEvent(ev, target)) { target = XToolkit.windowToXWindow(ev.get_xany().get_window()); } if (target != null && target.checkInitialised()) { target.dispatchEvent(ev); } }
public void handleConfigureNotifyEvent(XEvent xev) { XConfigureEvent xe = xev.get_xconfigure(); if (insLog.isLoggable(Level.FINER)) { insLog.log(Level.FINER, "Configure, {0}", new Object[] {String.valueOf(xe)}); } x = xe.get_x(); y = xe.get_y(); width = xe.get_width(); height = xe.get_height(); }
public void handleDestroyNotify(XEvent xev) { XAnyEvent xany = xev.get_xany(); if (xany.get_window() == getWindow()) { XToolkit.removeFromWinMap(getWindow(), this); if (XPropertyCache.isCachingSupported()) { XPropertyCache.clearCache(getWindow()); } } if (xany.get_window() != getWindow()) { synchronized (getStateLock()) { children.remove(xany.get_window()); } } }
static boolean isGrabbedEvent(XEvent ev, XBaseWindow target) { switch (ev.get_type()) { case ButtonPress: case ButtonRelease: case MotionNotify: case KeyPress: case KeyRelease: return true; case LeaveNotify: case EnterNotify: // We shouldn't dispatch this events to the grabbed components (see 6317481) // But this logic is important if the grabbed component is top-level (see realSync) return (target instanceof XWindowPeer); default: return false; } }
public void handleClientMessage(XEvent xev) { if (eventLog.isLoggable(Level.FINER)) { XClientMessageEvent msg = xev.get_xclient(); eventLog.finer(msg.toString()); } }
public void handleReparentNotifyEvent(XEvent xev) { if (eventLog.isLoggable(Level.FINER)) { XReparentEvent msg = xev.get_xreparent(); eventLog.finer(msg.toString()); } }