Mediators maintains a list (or stack) of {@link IMediator} instances.These mediators can be used to intercept the events in the {@link Viewport} of a {@link LienzoPanel}. Mediators are typically used for zooming or rubberbanding operations.
The mediators are processed in the order of the (internal) list. To insert a new mediator into the start of the list (at position 0), use the {@link #push(IMediator) push} method.To remove the first one, use the {@link #pop() pop} method.The {@link #add(int,IMediator) add} and {@link #remove(IMediator) remove} methods can be used for more finer grained control.
Each IMediator must implement two methods:
- {@link IMediator#handleEvent(GwtEvent) handleEvent(GwtEvent)} - acts on the event if needed, and returns true if it did
- {@link IMediator#cancel() cancel()} - terminates the current operation and resets the internal state of the mediator for future use
See the built-in mediators:
- {@link MouseBoxZoomMediator}
- {@link MouseWheelZoomMediator}
- {@link MouseSwipeZoomMediator}
@see LienzoHandlerManager
@see IMediator
@see Viewport#pushMediator(IMediator)
@see Viewport#getMediators()
@since 1.1