public final class DefaultDisplayService extends AbstractService implements DisplayService
Displays.| Constructor and Description |
|---|
DefaultDisplayService() |
| Modifier and Type | Method and Description |
|---|---|
Display<?> |
createDisplay(Object o)
Creates a display for the given object, publishing a
DisplayCreatedEvent to notify interested parties. |
Display<?> |
createDisplay(String name,
Object o)
Creates a display for the given object, publishing a
DisplayCreatedEvent to notify interested parties. |
Display<?> |
createDisplayQuietly(Object o)
Creates a display for the given object, without publishing a
DisplayCreatedEvent. |
EventService |
eventService() |
Display<?> |
getActiveDisplay()
Gets the currently active display (of any Display type).
|
<D extends Display<?>> |
getActiveDisplay(Class<D> displayClass)
Gets the most recently active display (of the specified Display type).
|
Display<?> |
getDisplay(String name)
Gets a display by its name.
|
<D extends Display<?>> |
getDisplayPlugin(Class<D> pluginClass)
Gets the display plugin of the given class, or null if none.
|
PluginInfo<Display<?>> |
getDisplayPlugin(String className)
Gets the display plugin of the given class name, or null if none.
|
List<PluginInfo<Display<?>>> |
getDisplayPlugins()
Gets the list of known display plugins.
|
<D extends Display<?>> |
getDisplayPluginsOfType(Class<D> type)
Gets the list of display plugins of the given type (e.g.,
ImageDisplay.class). |
List<Display<?>> |
getDisplays()
Gets a list of all available displays.
|
List<Display<?>> |
getDisplays(Object o)
Gets a list of displays currently visualizing the given object.
|
<D extends Display<?>> |
getDisplaysOfType(Class<D> type)
Gets a list of all available displays of the given type (e.g.,
ImageDisplay.class). |
boolean |
isUniqueName(String name)
Checks whether the given name is already taken by an existing display.
|
ObjectService |
objectService() |
protected void |
onEvent(DisplayDeletedEvent evt)
Removes a display from the display list when it is deleted
|
protected void |
onEvent(WinActivatedEvent event)
Sets the display to active when its window is activated.
|
protected void |
onEvent(WinClosedEvent event)
Deletes the display when display window is closed.
|
PluginService |
pluginService() |
void |
setActiveDisplay(Display<?> display)
Set the active display.
|
getContext, setContext, toStringgetInfo, getPriority, setInfo, setPrioritycontextclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetEventService, getObjectService, getPluginServiceinitialize, registerEventHandlersgetIdentifier, logcontext, getContext, setContextcompareTo, getPriority, setPrioritygetInfo, setInfogetLocationgetVersiondisposepublic EventService eventService()
eventService in interface DisplayServicepublic ObjectService objectService()
objectService in interface DisplayServicepublic PluginService pluginService()
pluginService in interface DisplayServicepublic Display<?> getActiveDisplay()
DisplayServicegetActiveDisplay in interface DisplayServicepublic <D extends Display<?>> D getActiveDisplay(Class<D> displayClass)
DisplayServicegetActiveDisplay in interface DisplayServicepublic void setActiveDisplay(Display<?> display)
DisplayServicesetActiveDisplay in interface DisplayServicepublic List<PluginInfo<Display<?>>> getDisplayPlugins()
DisplayServicegetDisplayPlugins in interface DisplayServicepublic <D extends Display<?>> PluginInfo<Display<?>> getDisplayPlugin(Class<D> pluginClass)
DisplayServicegetDisplayPlugin in interface DisplayServicepublic PluginInfo<Display<?>> getDisplayPlugin(String className)
DisplayServicegetDisplayPlugin in interface DisplayServicepublic <D extends Display<?>> List<PluginInfo<D>> getDisplayPluginsOfType(Class<D> type)
DisplayServiceImageDisplay.class).getDisplayPluginsOfType in interface DisplayServicepublic List<Display<?>> getDisplays()
DisplayServicegetDisplays in interface DisplayServicepublic <D extends Display<?>> List<D> getDisplaysOfType(Class<D> type)
DisplayServiceImageDisplay.class).getDisplaysOfType in interface DisplayServicepublic Display<?> getDisplay(String name)
DisplayServicegetDisplay in interface DisplayServicepublic List<Display<?>> getDisplays(Object o)
DisplayServicegetDisplays in interface DisplayServicepublic boolean isUniqueName(String name)
DisplayServiceisUniqueName in interface DisplayServicename - The name to check.public Display<?> createDisplay(Object o)
DisplayServiceDisplayCreatedEvent to notify interested parties. In particular:
ObjectService will add the new display to its index, until
a corresponding DisplayDeletedEvent is later published.
To create a Display without publishing an event, see
DisplayService.createDisplayQuietly(java.lang.Object).
createDisplay in interface DisplayServiceo - The object for which a display should be created. The object is
then added to the display.Display<?> containing the given object. The
Display is typed with ? rather than T matching the Object because
it is possible for the Display to be a collection of some other
sort of object than the one being added. For example, ImageDisplay
is a Display<DataView> with the DataView wrapping a
Dataset, yet the ImageDisplay supports adding Datasets directly,
taking care of wrapping them in a DataView as needed.public Display<?> createDisplay(String name, Object o)
DisplayServiceDisplayCreatedEvent to notify interested parties. In particular:
ObjectService will add the new display to its index, until
a corresponding DisplayDeletedEvent is later published.
To create a Display without publishing an event, see
DisplayService.createDisplayQuietly(java.lang.Object).
createDisplay in interface DisplayServicename - The name to be assigned to the display.o - The object for which a display should be created. The object is
then added to the display.Display<?> containing the given object. The
Display is typed with ? rather than T matching the Object because
it is possible for the Display to be a collection of some other
sort of object than the one being added. For example, ImageDisplay
is a Display<DataView> with the DataView wrapping a
Dataset, yet the ImageDisplay supports adding Datasets directly,
taking care of wrapping them in a DataView as needed.public Display<?> createDisplayQuietly(Object o)
DisplayServiceDisplayCreatedEvent. Hence, the display will not be automatically
shown or tracked.createDisplayQuietly in interface DisplayServiceo - The object for which a display should be created. The object is
then added to the display.Display<?> containing the given object. The
Display is typed with ? rather than T matching the Object because
it is possible for the Display to be a collection of some other
sort of object than the one being added. For example, ImageDisplay
is a Display<DataView> with the DataView wrapping a
Dataset, yet the ImageDisplay supports adding Datasets directly,
taking care of wrapping them in a DataView as needed.protected void onEvent(WinClosedEvent event)
protected void onEvent(WinActivatedEvent event)
protected void onEvent(DisplayDeletedEvent evt)
Copyright © 2015–2022 SciJava. All rights reserved.