public interface DisplayWindow extends DataViewer, java.io.Closeable
It is not expected that third-party code implement this interface. If you
want to provide your own custom display then you should implement DataViewer
instead.
Modifier and Type | Method and Description |
---|---|
void |
addOverlay(Overlay overlay)
Add a graphical overlay.
|
void |
adjustZoom(double factor)
Multiply the current zoom ratio of the image canvas by the provided
factor.
|
void |
autostretch()
Performs a one-shot autoscaling of intensities.
|
void |
close()
Close this display window unconditionally.
|
void |
displayStatusString(java.lang.String status)
Display a custom string in the window.
|
DisplayWindow |
duplicate()
Create a new display window for the same data provider as this one.
|
java.awt.Window |
getAsWindow()
Deprecated.
use
getWindow() instead |
ij.ImagePlus |
getImagePlus()
Deprecated.
Directly accessing the
ImagePlus of an MMStudio
display window will generally result in very fragile code. Consider
accessing image data through DataViewer.getDataProvider() . For drawing
overlay graphics, see addOverlay(org.micromanager.display.overlay.Overlay) . |
double |
getMagnification()
Deprecated.
use
getZoom() instead |
java.util.List<Overlay> |
getOverlays()
Get the overlays attached to this display.
|
java.awt.Window |
getWindow()
Get the
java.awt.Window used for this image display. |
double |
getZoom()
Get the current zoom ratio of the display.
|
boolean |
isFullScreen()
Tell whether full screen mode is currently enabled.
|
void |
removeOverlay(Overlay overlay)
Remove a graphical overlay.
|
boolean |
requestToClose()
Close this display window, giving its owner a chance to cancel closing.
|
void |
setCustomTitle(java.lang.String title)
Add a custom extra string to the title of this display.
|
void |
setFullScreen(boolean enable)
Enable or disable full screen mode.
|
void |
setMagnification(double ratio)
Deprecated.
use
setZoom(double) instead |
void |
setZoom(double ratio)
Set the zoom ratio for this display.
|
void |
show()
DisplayWindows are not shown by default.
|
void |
toFront()
Raise this display window to the front.
|
void |
toggleFullScreen()
Deprecated.
use
setFullScreen(boolean) instead |
addListener, compareAndSetDisplayPosition, compareAndSetDisplayPosition, compareAndSetDisplaySettings, getDataProvider, getDatastore, getDisplayedImages, getDisplayPosition, getDisplaySettings, getName, isClosed, isVisible, registerForEvents, removeListener, setDisplayedImageTo, setDisplayPosition, setDisplayPosition, setDisplaySettings, unregisterForEvents
void displayStatusString(java.lang.String status)
The string will remain displayed until this method is called again to change it.
Calls are ignored if the display has closed.
This method can be called from any thread.
status
- String to display in the window.double getZoom()
If the display has closed, the returned value is undefined.
This method can be called from any thread. However, you should call it from the Swing/AWT event dispatch thread if you want to correctly synchronize with other user interface changes.
@Deprecated double getMagnification()
getZoom()
insteadgetZoom()
.void setZoom(double ratio)
Calls are ignored if the display has closed.
This method can be called from any thread. However, you should call it from the Swing/AWT event dispatch thread if you want to correctly synchronize with other user interface changes.
ratio
- zoom ratio to set (1.0 = actual size)@Deprecated void setMagnification(double ratio)
setZoom(double)
insteadsetZoom(double)
.ratio
- Magnification ratiovoid adjustZoom(double factor)
This is equivalent to setZoom(factor * getZoom())
if called on
the Swing/AWT event dispatch thread.
Calls are ignored if the display has closed.
This method can be called from any thread. However, you should call it from the Swing/AWT event dispatch thread if you want to correctly synchronize with other user interface changes.
factor
- the factor to zoom in byvoid autostretch()
The intensity range of the currently displayed image is used to set the intensity scaling range for all displayed channels.
Calls are ignored if the display has closed.
This method can be called from any thread. However, you should call it from the Swing/AWT event dispatch thread if you want to correctly synchronize with other user interface changes.
void addOverlay(Overlay overlay)
This method can be called from any thread. However, you should call it from the Swing/AWT event dispatch thread if you want to correctly synchronize with other user interface changes.
overlay
- the overlay to addjava.lang.NullPointerException
- if overlay
is nullremoveOverlay(org.micromanager.display.overlay.Overlay)
,
getOverlays()
void removeOverlay(Overlay overlay)
This method can be called from any thread. However, you should call it from the Swing/AWT event dispatch thread if you want to correctly synchronize with other user interface changes.
overlay
- the overlay to removeaddOverlay(org.micromanager.display.overlay.Overlay)
java.util.List<Overlay> getOverlays()
This method can be called from any thread. However, you should call it from the Swing/AWT event dispatch thread if you want to correctly synchronize with other user interface changes.
addOverlay(org.micromanager.display.overlay.Overlay)
@Deprecated ij.ImagePlus getImagePlus()
ImagePlus
of an MMStudio
display window will generally result in very fragile code. Consider
accessing image data through DataViewer.getDataProvider()
. For drawing
overlay graphics, see addOverlay(org.micromanager.display.overlay.Overlay)
.ImagePlus
object used by the display window.
Note that the ImagePlus
may be replaced with a new one during the
lifetime of the display window.
It is recommended that this method be called on the Swing/AWT event dispatch thread. If you call it from another thread, make sure that your thread is not obstructing the event dispatch thread (i.e. the event dispatch thread is not waiting for your thread to finish something).
ImagePlus
used by the window, which may be a
CompositeImage
, or null
if none has been created or if
the display has closed.boolean requestToClose()
For example, the owner may prompt the user to save the data associated with this display. Special display windows may perform other actions.
Calls are ignored if the display has already closed.
void close()
This will skip such actions as prompting the user to save the data. Special display windows may skip other special actions.
Calls are ignored if the display has already closed.
This method can be called from any thread. However, you should call it from the Swing/AWT event dispatch thread if you want to correctly synchronize with other user interface changes. In particular, the display may not have closed yet at the moment this method returns if called on another thread.
close
in interface java.lang.AutoCloseable
close
in interface java.io.Closeable
void setFullScreen(boolean enable)
Calls are ignored if the display has closed.
This method can be called from any thread. However, you should call it from the Swing/AWT event dispatch thread if you want to correctly synchronize with other user interface changes.
enable
- whether to enable or disable full screen modeboolean isFullScreen()
It is recommended that this method be called on the Swing/AWT event dispatch thread. If you call it from another thread, make sure that your thread is not obstructing the event dispatch thread (i.e. the event dispatch thread is not waiting for your thread to finish something).
false
if the
display has closed@Deprecated void toggleFullScreen()
setFullScreen(boolean)
insteadCalls are ignored if the display has closed.
DisplayWindow duplicate()
This method can be called from any thread. However, you should call it from the Swing/AWT event dispatch thread if you want to correctly synchronize with other user interface changes.
void toFront()
Calls are ignored if the display has closed.
This method can be called from any thread. However, you should call it from the Swing/AWT event dispatch thread if you want to correctly synchronize with other user interface changes.
java.awt.Window getWindow() throws java.lang.IllegalStateException
java.awt.Window
used for this image display.
You should not access the contents of the returned window, but you can set its on-screen position and size, etc.
If the display is in full screen mode, this method returns the original (hidden) window, not the window used for full-screen display.
It is recommended that this method be called on the Swing/AWT event dispatch thread. If you call it from another thread, make sure that your thread is not obstructing the event dispatch thread (i.e. the event dispatch thread is not waiting for your thread to finish something).
java.awt.Window
used by this image displayjava.lang.IllegalStateException
- if the display has closed@Deprecated java.awt.Window getAsWindow()
getWindow()
insteadjava.awt.Window
used for this image display.java.awt.Window
used by this image display, or
null
if the display has been closedvoid setCustomTitle(java.lang.String title)
The usual format for the window title is
"#number: name (zoom ratio) (saved status)".
If you call this method, then the name part will be replaced by your
custom title. You can call this method with a null argument to revert to
the default title, which is what DataViewer.getName()
returns.
Calls are ignored if the display has closed.
This method can be called from any thread.
title
- a custom window title, or null
to revert to the
defaultvoid show()