top bar

Version 2.0 API Events

This page documents the various events that the 2.0 API exposes, and what you need to subscribe to to access those events.

Global events

These events are posted to the EventManager. You can subscribe to them via mm.events().registerForEvents().

  • DatastoreClosingEvent: a Datastore was closed.
  • DisplayAboutToShowEvent: a DisplayWindow is just about to show its GUI, which happens once there's at least one image for it to display.
  • NewDisplayEvent: a new DisplayWindow was created. This is posted before that display's GUI becomes available.

In addition to the above, the various events made available in 1.4 are still present:

  • PropertiesChangedEvent: A Device Adapter has notified the core that at least one device property has changed. Note that not all property changes result in notifications; the adapter must be specifically coded to send them.
  • PropertyChangedEvent: As above, but for a specific property.
  • ConfigGroupChangedEvent: a config group has changed which preset it is using.
  • SystemConfigurationLoadedEvent: a new config file has been loaded.
  • PixelSizeChangedEvent: the pixel size has changed.
  • StagePositionChangedEvent: a Z positioner has moved.
  • XYStagePositionChangedEvent: an XY positioner has moved.
  • ExposureChangedEvent: the exposure time has changed.
  • SLMExposureChangedEvent: the exposure time of an SLM device has changed.

Display events

These events are specific to a single DisplayWindow, and can be accessed via DisplayWindow.registerForEvents. If you do register for a DisplayWindow's events, then you should remember to call DisplayWindow.unregisterForEvents if the object that is registered is discarded; otherwise, the DisplayWindow will keep a reference to your object, and errors may occur when the window attempts to send events to it.

  • DisplayDestroyedEvent: the display has been closed and can no longer be used.
  • NewDisplaySettingsEvent: the DisplaySettings for a display have been updated.
  • NewImagePlusEvent: the ImagePlus object used for drawing the images on the display has been replaced.
  • PixelsSetEvent: the display has just finished drawing image pixels to the user's monitor.
  • RequestToCloseEvent: the display wishes to close. If nobody has subscribed to this event, then the display will assume it has permission to close and will close itself. Calling DisplayManager.manage() will cause MicroManager to listen for this event for all displays for the managed Datastore.
  • RequestToDrawEvent: client code would like the display to change the image(s) it is drawing.

Datastore events

These events are specific to a single Datastore, and can be accessed via Datastore.registerForEvents. As with DisplayWindows, if you have an object listening to Datastore events, and that object is discarded, you should make certain to unregister it first.

  • DatastoreFrozenEvent: the Datastore's freeze method has been called, and the contents of the Datastore may no longer be modified.
  • DatastoreSavedEvent: the Datastore has been saved to disk in some format.
  • NewImageEvent: a new Image has been added to the Datastore.
  • NewSummaryMetadataEvent: new SummaryMetadata has been set for the Datastore.


© Micro-Manager : Vale Lab, UCSF 2006-2011 | All Rights Reserved | Contact