protected void dispatchEvent(AWTEvent event) { try { super.dispatchEvent(event); } catch (Throwable e) { doLogging(event, e); doOutOfMemory(event, e, oumErrorHandler); } }
protected void dispatchEvent(AWTEvent event) { try { super.dispatchEvent(event); } catch (Throwable e) { doLogging(event, e); doOutOfMemory(event, e, oumErrorHandler); } }
@Override protected void dispatchEvent(AWTEvent event) { if (event instanceof PaintEvent) logger.info("Dispatch [PAINT]: "+event); else if (event instanceof MouseEvent) logger.info("Dispatch [MOUSE]: "+event); else if (event instanceof InvocationEvent) { logger.info("Dispatch [INVOC]: "+event); } else logger.warn("Dispatch [UNKNO]: " + event); super.dispatchEvent(event); }
@Override protected void dispatchEvent(AWTEvent arg0) { try { super.dispatchEvent(arg0); } catch (NullPointerException e) { /* On multi monitor environment the java.awt.Component#findUnderMouseInWindow method can throw a NullPointerException. * See https://bugs.java.com/bugdatabase/view_bug.do?bug_id=6840067 */ LOGGER.warn("NullPointerException on dispatchEvent " + arg0 + ". Possible awt bug.", e); } catch (Exception e) { LOGGER.error("Uncaught exception was thrown", e); Thread.getDefaultUncaughtExceptionHandler().uncaughtException(Thread.currentThread(), e); } }
@Override protected void dispatchEvent(AWTEvent newEvent) { try { super.dispatchEvent(newEvent); } catch (Throwable t) { handleThrowable(t); } }
@Override protected void dispatchEvent(AWTEvent event) { // Block all input event if (event instanceof InputEvent) { ((InputEvent) event).consume(); } else if (event.getClass().getName().endsWith("ComponentWorkRequest")) { // hack to avoid nullPoinetrException in repaint } else { super.dispatchEvent(event); } }
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException at com.aramco.ecc.licenseoptimizer.gui.Worker.run(Worker.java:23) at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209) at java.awt.EventQueue.dispatchEvent(EventQueue.java:597) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161) at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
@Override protected void dispatchEvent(AWTEvent newEvent) { try { super.dispatchEvent(newEvent); } catch (Throwable t) { handleThrowable(t); } }
@Override protected void dispatchEvent(AWTEvent event) { if (event instanceof KeyEvent) { KeyStroke ks = KeyStroke.getKeyStrokeForEvent((KeyEvent) event); Action action = hotkeyActionMap.get(ks); if (action != null && action.isEnabled()) { action.actionPerformed(null); return; } } super.dispatchEvent(event); } });
protected void dispatchEvent(final AWTEvent evt) { try { super.dispatchEvent(evt); } catch (final Exception e) { log.error(e.getLocalizedMessage(), e); showErrorDialog(e); } catch (final Error e) { log.error(e.getLocalizedMessage(), e); showErrorDialog(e); } } }
@Override protected void dispatchEvent(AWTEvent event) { try { super.dispatchEvent(event); } catch (Throwable thr) { thr.printStackTrace(); // TODO logging String message = thr.getMessage(); if (message == null || message.isEmpty()) { message = I18n.get("FATAL: ")+thr.getClass(); } JOptionPane.showMessageDialog(null, message, I18n.get("ERROR"), JOptionPane.ERROR_MESSAGE); } }
@Override protected void dispatchEvent(AWTEvent event) { eq = Thread.currentThread(); boolean scheduled = false; try { scheduled = tick("dispatchEvent"); // NOI18N super.dispatchEvent(event); } finally { if (scheduled) { done(); } } }
/** * Overrides EventQueue.dispatchEvent to call our pre and post hooks either * side of the system's event dispatch code. */ @Override protected void dispatchEvent(AWTEvent event) { preDispatchEvent(); super.dispatchEvent(event); postDispatchEvent(); }
/** * Overrides EventQueue.dispatchEvent to call our pre and post hooks either * side of the system's event dispatch code. */ @Override protected void dispatchEvent(AWTEvent event) { preDispatchEvent(); super.dispatchEvent(event); postDispatchEvent(); }
protected void dispatchEvent(AWTEvent e) { synchronized(this) { if (!installed) { installed = true; String name = Thread.currentThread().getName(); Thread.currentThread().setName(name + " (abbot FileDialogTester)"); } } // Ignore FileDialogPeer events while disposing the dialog if (e.paramString().indexOf("FileDialogPeer") != -1) { Log.debug("ignoring peer event: " + e); // Nothing else to handle, restore the original queue dispose(); } else { super.dispatchEvent(e); } } }
/** * Dispatch native drag/drop events the same way non-native drags are reported. Enter/Exit are reported with the * appropriate source, while drag and release events use the drag source as the source. * * @param e an AWT event. */ @Override protected void dispatchEvent(AWTEvent e) { // TODO: implement enter/exit events // TODO: change source to drag source, not mouse under if (nativeDnd.isNativeDragAndDrop(e)) { MouseEvent mouseEvent = (MouseEvent) e; Component target = getDeepestComponentAt(mouseEvent.getComponent(), mouseEvent.getX(), mouseEvent.getY()); if (target != mouseEvent.getSource()) { mouseEvent = convertMouseEvent(mouseEvent.getComponent(), mouseEvent, target); } relayDndEvent(mouseEvent); } super.dispatchEvent(e); }
/** Dispatch native drag/drop events the same way non-native drags * are reported. Enter/Exit are reported with the appropriate source, * while drag and release events use the drag source as the source.<p> * TODO: implement enter/exit events * TODO: change source to drag source, not mouse under */ protected void dispatchEvent(AWTEvent e) { Log.debug("dispatch " + e); if (e.getClass().getName().indexOf("SunDropTargetEvent") != -1) { MouseEvent me = (MouseEvent)e; Component target = SwingUtilities.getDeepestComponentAt(me.getComponent(), me.getX(), me.getY()); if (target != me.getSource()) { Log.debug("Change drag event target"); me = SwingUtilities.convertMouseEvent(me.getComponent(), me, target); } Log.debug("relay " + me); relayDnDEvent(me); } super.dispatchEvent(e); } }
/** * {@inheritDoc} */ @Override protected void dispatchEvent(AWTEvent event) { waitTimer.startTimer(event.getSource()); try { super.dispatchEvent(event); } finally { waitTimer.stopTimer(); } } }
/** * {@inheritDoc} */ @Override protected void dispatchEvent(AWTEvent event) { waitTimer.startTimer(event.getSource()); try { super.dispatchEvent(event); } finally { waitTimer.stopTimer(); } } }
@Override protected void dispatchEvent(AWTEvent event) { try { super.dispatchEvent(event); } catch (StackOverflowError soe) { log.error(soe, soe); optionPane.setTitle(I18N.getString("MapToolEventQueue.stackOverflow.title")); //$NON-NLS-1$ optionPane.setDetails(I18N.getString("MapToolEventQueue.stackOverflow")); displayPopup(); } catch (Throwable t) { log.error(t, t); optionPane.setTitle(I18N.getString("MapToolEventQueue.unexpectedError")); //$NON-NLS-1$ optionPane.setDetails(toString(t)); try { displayPopup(); } catch (Throwable thrown) { // Displaying the error message using the JideOptionPane has just failed. // Fallback to standard swing dialog. log.error(thrown, thrown); JOptionPane.showMessageDialog(null, toString(thrown), I18N.getString("MapToolEventQueue.unexpectedError"), JOptionPane.ERROR_MESSAGE); } } }