List of usage examples for com.google.gwt.dom.client NativeEvent getRelatedEventTarget
public final EventTarget getRelatedEventTarget()
From source file:org.vectomatic.dnd.DropPanel.java
License:Open Source License
/** * Dispatches the specified event to this node * event handlers// ww w .java 2 s .c om * @param event The event to dispatch */ public void dispatch(NativeEvent event) { // dragenter and dragleave deserve special treatment // to solve issues described in: // http://www.quirksmode.org/js/events_mouse.html if ("dragenter".equals(event.getType()) || "dragleave".equals(event.getType())) { if (isChildOf((Node) event.getCurrentEventTarget().cast(), (Node) event.getRelatedEventTarget().cast())) { return; } } // This call wraps the native event into a DomEvent // and invokes fireEvent DomEvent.fireNativeEvent(event, this, (Element) event.getCurrentEventTarget().cast()); }
From source file:org.vectomatic.dom.svg.impl.DOMHelperImpl.java
License:Open Source License
/** * Central dispatching function for events emitted by DOM objects * @param event The DOM event/*ww w .j a va2s .c o m*/ * @param node The object processing the event * @param elem The object emitting the event */ public void dispatch(NativeEvent event, OMNode node, Element elem) { //Window.alert("type=" + event.getType()); switch (eventGetTypeInt(event.getType())) { // Mouseover and mouseout deserve special treatment // to solve issues described in: // http://www.quirksmode.org/js/events_mouse.html // For SVG, it seems better to test against the tree rooted at // evt.currentTarget than againt the subtree rooted at evt.target case EVT_MOUSEOVER: case EVT_MOUSEOUT: if (isChildOf((Node) event.getCurrentEventTarget().cast(), (Node) event.getRelatedEventTarget().cast())) { return; } break; } node.dispatch(event); }