Interface EventManager
public interface EventManager
This interface provides access to the application-wide EventBus, on which
the events in the org.micromanager.events package are posted.
-
Method Summary
Modifier and TypeMethodDescriptionvoidPost an event on the EventBus, so that subscribers for that event can be notified.voidregisterForEvents(Object obj) Register the specified object to receive events.voidUn-register the provided object from the EventBus, so that it will no longer receive event notifications.
-
Method Details
-
registerForEvents
Register the specified object to receive events. Any public void methods in the object that a) are marked with a @Subscribe annotation, and b) take a single event from the org.micromanager.events package as their only argument will be invoked with the appropriate event object when those events occur.- Parameters:
obj- The object that should be subscribed to receive event notifications.
-
unregisterForEvents
Un-register the provided object from the EventBus, so that it will no longer receive event notifications. You should make certain to do this when objects are disposed of (e.g. if they are attached to a window that is being closed). Failure to do so can result in errors when the event is published to an invalid object.- Parameters:
obj- The object that should no longer receive event notifications.
-
post
Post an event on the EventBus, so that subscribers for that event can be notified.- Parameters:
event- The event object to be posted.
-