Interface DisplayManager
- All Superinterfaces:
EventPublisher
This interface declares generic display-related methods. You can access
a class instance that implements this interface by calling mm.display().
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddViewer(DataViewer viewer) Register a DataViewer with the Display Manager.Generates a blank channelDisplaySettings Builder with all null values.booleancloseAllDisplayWindows(boolean shouldPromptToSave) Close all open image windows.booleancloseDisplaysFor(DataProvider provider) Given a DataProvider, close any open DisplayWindows for that DataProvider.Generates a blank componentSettings Builder with all null values.createDisplay(DataProvider dataProvider) Create a new DisplayWindow for the specified DataProvider and return it.createDisplay(DataProvider dataProvider, DisplayWindowControlsFactory factory) Create a new DisplayWindow for the specified DataProvider and return it.createDisplay(DataProvider provider, DisplayWindowControlsFactory factory, DisplaySettings displaySettings) Create a new DisplayWindow for the specified DataProvider and return it.Provide an ImagceExporter for generating image sequences.booleanDeprecated.voidcreateInspectorForDataViewer(DataViewer display) Create a new Inspector window that shows information for the specified DataViewer, or for the topmost window if the DataViewer is null.Generate a "blank" DisplaySettings.Builder with all null values.displaySettingsFromProfile(String profileKey) Restore DisplaySettings from the UserProfile using the profile key.Returns the currently active data viewer.Return all DataViewers that Micro-Manager knows about.Return all active DisplayWindows.getContrastSettings(Integer[] contrastMins, Integer[] contrastMaxes, Double[] gammas, Boolean isVisible) Deprecated.getContrastSettings(Integer contrastMin, Integer contrastMax, Double gamma, Boolean isVisible) Deprecated.Deprecated.UsegetActiveDataViewer()insteadgetDisplays(DataProvider dataProvider) Return all associated DisplayWindows for the DataProvider.getDisplays(Datastore store) Deprecated.replaced bygetDisplays(DataProvider)Deprecated.- use displaySettingsBuilder() insteaddefault booleangetIsManaged(DataProvider provider) Deprecated.useisManaged(DataProvider)insteadReturn a list of all DataProviders that MicroManager is managing (see the manage() method for more information).Deprecated.UsePropertyMaps.builder()insteadDeprecated.use displaySettingsBuilder() insteadbooleanisManaged(DataProvider provider) Returns true if the DataProvider is being managed by MicroManager.loadDisplays(Datastore store) Load saved DisplayWindows for the given Datastore, which is assumed to represent data that is saved on disk.voidmanage(DataProvider store) Request that MicroManager manage the specified DataProvider for you.voidShow a dialog to the user giving them a prompt to close all open windows, and allowing them to decide whether or not to be prompted to save each unsaved open window (or simply cancel the entire action).booleanpromptToSave(Datastore store, DisplayWindow display) Display a prompt for the user to save their data.voidremoveViewer(DataViewer viewer) Cause Micro-Manager to stop tracking a DataViewer that was previously added with addViewer().Create a new Datastore with an associated DisplayWindow that will display the provided Image.Methods inherited from interface EventPublisher
registerForEvents, unregisterForEvents
-
Method Details
-
show
Create a new Datastore with an associated DisplayWindow that will display the provided Image. The Datastore will use RAM-based storage, and will not be managed by Micro-Manager by default (see the manage() method, below).- Parameters:
image- The Image to display.- Returns:
- The Datastore created to hold the Image.
-
getStandardDisplaySettings
Deprecated.use displaySettingsBuilder() insteadThis was mean to retrieve a DisplaySettings holding the values the user had saved as their default values. Since there is no UI to save settings as the default, this function was never used in the UI- Returns:
- Blank DisplaySettings
-
displaySettingsFromProfile
Restore DisplaySettings from the UserProfile using the profile key. Returns null if the profile does not contain the requested DisplaySettings.- Parameters:
profileKey- The key in the UserProfile to use for the DisplaySettings.- Returns:
- DisplaySettings with the values from the UserProfile or null if the UserProfile did not contain DisplaySettings under the provided key.
-
getDisplaySettingsBuilder
Deprecated.- use displaySettingsBuilder() insteadGenerate a "blank" DisplaySettings.Builder with all null values.- Returns:
- A DisplaySettingsBuilder with no pre-set values.
-
displaySettingsBuilder
DisplaySettings.Builder displaySettingsBuilder()Generate a "blank" DisplaySettings.Builder with all null values.- Returns:
- A DisplaySettingsBuilder with no pre-set values.
-
channelDisplaySettingsBuilder
ChannelDisplaySettings.Builder channelDisplaySettingsBuilder()Generates a blank channelDisplaySettings Builder with all null values.- Returns:
- a blank ChannelDisplaySettings Builder
-
componentDisplaySettingsBuilder
ComponentDisplaySettings.Builder componentDisplaySettingsBuilder()Generates a blank componentSettings Builder with all null values.- Returns:
- a blank componentSettings builder
-
getContrastSettings
@Deprecated DisplaySettings.ContrastSettings getContrastSettings(Integer contrastMin, Integer contrastMax, Double gamma, Boolean isVisible) Deprecated.UseDisplaySettings.getAllChannelSettings()instead.Generate a ContrastSettings object with the provided values. This version of the method is to be used for single-component images.- Parameters:
contrastMin- The highest pixel intensity corresponding to black.contrastMax- The lowest pixel intensity corresponding to full intensity.gamma- The gamma curve parameter.isVisible- Whether or not this channel is visible in the display when the display is showing multiple channels simultaneously.- Returns:
- a DisplaySettings.ContrastSettings object, whose properties are all length-1 arrays with the provided values.
-
getContrastSettings
@Deprecated DisplaySettings.ContrastSettings getContrastSettings(Integer[] contrastMins, Integer[] contrastMaxes, Double[] gammas, Boolean isVisible) Deprecated.Generate a ContrastSettings object with the provided values. This version of the method is to be used for multi-component (e.g. RGB) images.- Parameters:
contrastMins- Array with the highest pixel intensity corresponding to black, for each component.contrastMaxes- Array with the lowest pixel intensity corresponding to full intensity, for each component.gammas- Array with the gamma curve parameters. NOTE: for now this parameter is not used to control display of multi-component images.isVisible- Whether or not this channel is visible in the display when the display is showing multiple channels simultaneously.- Returns:
- a DisplaySettings.ContrastSettings object.
-
getPropertyMapBuilder
Deprecated.UsePropertyMaps.builder()insteadGenerate a "blank" PropertyMap.PropertyMapBuilder with empty mappings.- Returns:
- A PropertyMapBuilder with no pre-set values.
-
createDisplay
Create a new DisplayWindow for the specified DataProvider and return it.- Parameters:
dataProvider- The DataProvider whose data should be displayed.- Returns:
- The created DisplayWindow.
-
createDisplay
Create a new DisplayWindow for the specified DataProvider and return it. This version allows you to add your own custom controls to the display that will appear underneath the axis scrollbars.- Parameters:
dataProvider- The DataProvider whose data should be displayed.factory- A ControlsFactory used to create custom controls for the DisplayWindow. May be null.- Returns:
- The created DisplayWindow.
-
createDisplay
DisplayWindow createDisplay(DataProvider provider, DisplayWindowControlsFactory factory, DisplaySettings displaySettings) Create a new DisplayWindow for the specified DataProvider and return it. This version allows you to specify the DisplaySettings to use for the DisplayWindow. Set the DisplayWindowControlsFactory to null if you do not use custom controls.- Parameters:
provider- The DataProvider whose data should be displayed.factory- A ControlsFactory used to create custom controls for the DisplayWindow. May be null.displaySettings- The initial DisplaySettings to use for the DisplayWindow.- Returns:
- The created DisplayWindow.
-
createInspectorForDataViewer
Create a new Inspector window that shows information for the specified DataViewer, or for the topmost window if the DataViewer is null.- Parameters:
display- The DataViewer the inspector should show information on, or null to show information on the topmost window.
-
createFirstInspector
Deprecated.Ensure that the "default" Inspector window exists and is visible. This Inspector window is normally created when the first Micro-Manager DisplayWindow is created, but it can be created earlier by calling this method. Note that once the default Inspector has been created, this method will not do anything, even if that Inspector is later closed.- Returns:
- true if an inspector window is created, false otherwise.
-
addViewer
Register a DataViewer with the Display Manager. This makes Micro-Manager aware of the viewer, so that it may be used by Micro-Manager's widgets (chiefly, the Inspector Window). Use removeViewer() to remove a viewer that has been added by this method.- Parameters:
viewer- The new DataViewer that should be tracked.
-
removeViewer
Cause Micro-Manager to stop tracking a DataViewer that was previously added with addViewer().- Parameters:
viewer- The DataViewer that should no longer be tracked.- Throws:
IllegalArgumentException- if the viewer is not currently tracked.
-
loadDisplays
Load saved DisplayWindows for the given Datastore, which is assumed to represent data that is saved on disk. DisplayWindow settings are saved in a separate display settings file; one new DisplayWindow will be created for every entry in that file. If no file is found then a single default DisplayWindow will be created, as per createDisplay() above.- Parameters:
store- The Datastore to load display settings for.- Returns:
- The list of DisplayWindows that were created by this method.
- Throws:
IOException- Most likely indicating that a file could not be read.
-
manage
Request that MicroManager manage the specified DataProvider for you. In brief: if you want users to receive a prompt to save their data when the last display for a DataProvider you created is closed, then use this method. Specifically, this method does the following things: - Add the DataProvider to the list returned by getDataProviders(). - Find all currently-existing DisplayWindows for this DataProvider and associate them (thus, getDisplays() for this DataProvider will return the displays) - When the last DisplayWindow for the DataProvider is closed: -- If the DataProvider has not been saved, prompt the user to save (and if they cancel, closing the DisplayWindow is halted) -- The DataProvider is frozen, which may have side-effects like finalizing writing of image data to disk -- The DataProvider is removed from the list returned by getDatastores(). By default, new DataProvider created by the createNewDatastore() method are not managed, which means you are responsible for ensuring that they are properly closed and saved. DataProvider created by MicroManager itself (e.g. by running an MDA) are automatically managed.- Parameters:
store- The DataProvider to manage.
-
getManagedDataProviders
List<DataProvider> getManagedDataProviders()Return a list of all DataProviders that MicroManager is managing (see the manage() method for more information).- Returns:
- A list of all DataProviders that Micro-Manager is managing.
-
isManaged
Returns true if the DataProvider is being managed by MicroManager.- Parameters:
provider- The DataProvider whose management status is under question.- Returns:
- Whether or not Micro-Manager is managing the DataProvider.
-
getIsManaged
Deprecated.useisManaged(DataProvider)insteadReturns true if the DataProvider is being managed by MicroManager.- Parameters:
provider- The DataProvider whose management status is under question.- Returns:
- Whether or not Micro-Manager is managing the DataProvider.
-
getDisplays
Deprecated.replaced bygetDisplays(DataProvider)Return all associated DisplayWindows for the Datastore. Returns null if the Datastore is not managed.- Parameters:
store- Datastore of interest to the caller- Returns:
- A list of all DisplayWindows Micro-Manager knows are associated with the specified Datastore, or null.
-
getDisplays
Return all associated DisplayWindows for the DataProvider. Returns null if the DataProvider is not managed.- Parameters:
dataProvider- DataProvider of interest to the caller- Returns:
- A list of all DisplayWindows Micro-Manager knows are associated with the specified Datastore, or null.
-
getCurrentWindow
Deprecated.UsegetActiveDataViewer()insteadReturn the DisplayWindow whose window is front-most. This window is not guaranteed to have focus as there may be other non-DisplayWindow windows on top of it. Returns null if there is no openDisplayWindow.- Returns:
- The front-most
DisplayWindow, or null.
-
getActiveDataViewer
DataViewer getActiveDataViewer()Returns the currently active data viewer. The active data viewer is the data viewer that last became active among those currently visible. A data viewer may become active because its window became active (if the viewer is windowed), or because the window containing it became active (if the viewer is a subcomponent of a larger window).- Returns:
- the active data viewer, or null if no data viewer is registered.
-
getAllImageWindows
List<DisplayWindow> getAllImageWindows()Return all active DisplayWindows. Note this is specifically Micro- Manager DisplayWindows; it doesn't include ImageJ's ImageWindows or any other data-representation windows.- Returns:
- A list of all DisplayWindows that Micro-Manager knows about.
-
getAllDataViewers
List<DataViewer> getAllDataViewers()Return all DataViewers that Micro-Manager knows about. This includes the results of getAllImageWindows, as well as any extant DataViewers that have been registered with Micro-Manager via the addViewer method.- Returns:
- List with all DataViewers that Micro-Manager knows about
-
promptToSave
Display a prompt for the user to save their data. This is the same prompt that is generated when the last DisplayWindow for a managed Datastore is closed.- Parameters:
store- The Datastore to save.display- The DisplayWindow over which to show the prompt.- Returns:
- true if saving was successful or the user explicitly declined to save; false if the user cancelled or if saving failed.
- Throws:
IOException- Can be thrown when file IO causes an exception.
-
createExporter
ImageExporter createExporter()Provide an ImagceExporter for generating image sequences.- Returns:
- an ImageExporter instance.
-
closeDisplaysFor
Given a DataProvider, close any open DisplayWindows for that DataProvider. If the DataProvider is managed, then the user may receive a prompt to save their data, which they have the option to cancel.- Parameters:
provider- DataProvider for which displays should be closed- Returns:
- True if all windows were closed; false otherwise (e.g. because the user canceled saving).
-
promptToCloseWindows
void promptToCloseWindows()Show a dialog to the user giving them a prompt to close all open windows, and allowing them to decide whether or not to be prompted to save each unsaved open window (or simply cancel the entire action). Assuming the user does not cancel, this method will then call closeAllDisplayWindows. -
closeAllDisplayWindows
boolean closeAllDisplayWindows(boolean shouldPromptToSave) Close all open image windows.- Parameters:
shouldPromptToSave- If true, then any open windows for Datastores that have not been saved will show a prompt to save, and if the user chooses not to save a file, then the process of closing windows will be halted. If false, then all windows will be closed regardless of whether or not the data they show has been saved, with no prompting of the user whatsoever. Note that the corresponding File menu option to close all open windows does prompt the user to ensure they are absolutely certain they want to close all open windows without prompts to save; this API call does not have that prompt.- Returns:
- true if all windows are closed; false if any window did not close.
-
DisplaySettings.getAllChannelSettings()instead.