In the simplest case all user input only affects a single UnfoldingMap. For instance, a user clicks and drags the mouse, so that the map gets panned. In this case, the {@link MouseHandler}, a {@link MapEventBroadcaster}, reacts to the user's mouse-dragging, and creates a PanMapEvent with the respective geo-location to pan to. That event is fired, and send via the EventDispatcher to the only listener, the single map.
In other cases, applications can set up more sophisticated behaviors. For instance, in an overview+detail setting with a large detail map and a small overview map, the small map shall only show an overview but not be interactive itself. For this case, the MouseHandler is created for the large map, but with a scope of both maps. The EventDispatcher is initiated with both maps listening to pan-events. Thus, any panning on the large overview map also affects the small detail map.
See the OverviewAndDetailMapApp and the ComplexMapEventApp in the examples section for this.
Your application then can create EventDispatcher to connect broadcasters and listeners, and customize the event handling in an application.
EventDispatcher
interface which it uses to deliver events to interested listeners. By removing the actual dispatching of events from the internals of the Connection, applications may provide their own event dispatch implementations for their Connection
objects which better suit how those applications work.
@author Oran Kelly
@version $Id: EventDispatcher.java 255 2006-03-09 09:34:37Z orank $
@see ie.omk.smpp.event.SimpleEventDispatcher
Mouse events are dispatched to their "containing" node (the GraphicsNode corresponding to the mouse event coordinate). Searches for containment are performed from the EventDispatcher's "root" node.
@author Thierry Kormann @version $Id: EventDispatcher.java,v 1.3 2002/03/06 09:06:39 vhardy Exp $Mouse events are dispatched to their "containing" node (the GraphicsNode corresponding to the mouse event coordinate). Searches for containment are performed from the EventDispatcher's "root" node.
@author Bill Haneman @author Thierry Kormann @version $Id: EventDispatcher.java,v 1.9 2005/03/27 08:58:34 cam Exp $Event listeners register with a debug target to handle specific event requests. A debug target forwards event listeners and requests to its event dispatcher. As events are received from the underlying VM, those listeners that registered to handle the specific events are notified.
Events are processed in event sets. It is possible that one event can trigger more than one event request to be processed. In such cases all event requests triggered by that one event are processed, and each event listener votes on whether the thread in which the event occurred should be resumed. A thread is only resumed in if all event handlers agree that the thread should be resumed.
Clients may implement this interface.
@since 3.1java.awt.Robot
to generate native events. It is an option in the Robot dispatch model to wait for the managed component's event queue to empty before dispatching events. Timeouts used:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|