public interface DisplayViewer<T> extends RichPlugin, Disposable
Display viewers discoverable at runtime must implement this interface and be
annotated with @Plugin
with attribute Plugin.type()
=
DisplayViewer
.class. While it possible to create a display viewer
merely by implementing this interface, it is encouraged to instead extend
AbstractDisplayViewer
, for convenience.
Plugin
Modifier and Type | Method and Description |
---|---|
boolean |
canView(Display<?> d)
Returns true if an instance of this display viewer can view the given
display.
|
default void |
dispose()
Performs any needed cleanup of the object's services, in preparation for
the object being retired (e.g., to make garbage collection possible).
|
Display<T> |
getDisplay()
Gets the display being viewed.
|
DisplayPanel |
getPanel()
Gets the display panel that hosts the gui elements.
|
DisplayWindow |
getWindow()
Gets the window in which the view is displayed.
|
boolean |
isCompatible(UserInterface ui)
Returns true if this display viewer can be used with the given UI.
|
default void |
onDisplayActivatedEvent(DisplayActivatedEvent e)
Handles a display activated event directed at this viewer's display.
|
default void |
onDisplayDeletedEvent(DisplayDeletedEvent e)
Removes the user interface when the display is deleted.
|
default void |
onDisplayUpdatedEvent(DisplayUpdatedEvent e)
Synchronizes the user interface appearance with the display model.
|
void |
setPanel(DisplayPanel panel)
Installs the display panel.
|
void |
view(DisplayWindow w,
Display<?> d)
Begins viewing the given display.
|
default void |
view(UserInterface ui,
Display<?> d)
Begins viewing the given display.
|
getIdentifier, log
context, getContext, setContext
compareTo, getPriority, setPriority
getInfo, setInfo
getLocation
getVersion
boolean isCompatible(UserInterface ui)
boolean canView(Display<?> d)
default void view(UserInterface ui, Display<?> d)
The default behavior of this method is to ask the given
UserInterface
to create a DisplayWindow
via
UserInterface.createDisplayWindow(Display)
and then pass it to
view(DisplayWindow, Display)
. Viewers needing to customize details
of the DisplayWindow
creation can do so via this method.
ui
- The user interface with which the viewer will be associated.d
- the model for the display to show.void view(DisplayWindow w, Display<?> d)
w
- The frame / window that will contain the GUI elementsd
- the model for the display to show.DisplayWindow getWindow()
void setPanel(DisplayPanel panel)
panel
- the panel used to host the guiDisplayPanel getPanel()
default void onDisplayUpdatedEvent(DisplayUpdatedEvent e)
default void onDisplayDeletedEvent(DisplayDeletedEvent e)
default void onDisplayActivatedEvent(DisplayActivatedEvent e)
default void dispose()
Disposable
dispose
in interface Disposable
Copyright © 2015–2022 SciJava. All rights reserved.