public final class DefaultDisplayService extends AbstractService implements DisplayService
Display
s.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, toString
getInfo, getPriority, setInfo, setPriority
context
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getEventService, getObjectService, getPluginService
initialize, registerEventHandlers
getIdentifier, log
context, getContext, setContext
compareTo, getPriority, setPriority
getInfo, setInfo
getLocation
getVersion
dispose
public EventService eventService()
eventService
in interface DisplayService
public ObjectService objectService()
objectService
in interface DisplayService
public PluginService pluginService()
pluginService
in interface DisplayService
public Display<?> getActiveDisplay()
DisplayService
getActiveDisplay
in interface DisplayService
public <D extends Display<?>> D getActiveDisplay(Class<D> displayClass)
DisplayService
getActiveDisplay
in interface DisplayService
public void setActiveDisplay(Display<?> display)
DisplayService
setActiveDisplay
in interface DisplayService
public List<PluginInfo<Display<?>>> getDisplayPlugins()
DisplayService
getDisplayPlugins
in interface DisplayService
public <D extends Display<?>> PluginInfo<Display<?>> getDisplayPlugin(Class<D> pluginClass)
DisplayService
getDisplayPlugin
in interface DisplayService
public PluginInfo<Display<?>> getDisplayPlugin(String className)
DisplayService
getDisplayPlugin
in interface DisplayService
public <D extends Display<?>> List<PluginInfo<D>> getDisplayPluginsOfType(Class<D> type)
DisplayService
ImageDisplay.class
).getDisplayPluginsOfType
in interface DisplayService
public List<Display<?>> getDisplays()
DisplayService
getDisplays
in interface DisplayService
public <D extends Display<?>> List<D> getDisplaysOfType(Class<D> type)
DisplayService
ImageDisplay.class
).getDisplaysOfType
in interface DisplayService
public Display<?> getDisplay(String name)
DisplayService
getDisplay
in interface DisplayService
public List<Display<?>> getDisplays(Object o)
DisplayService
getDisplays
in interface DisplayService
public boolean isUniqueName(String name)
DisplayService
isUniqueName
in interface DisplayService
name
- The name to check.public Display<?> createDisplay(Object o)
DisplayService
DisplayCreatedEvent
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 DisplayService
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<?> createDisplay(String name, Object o)
DisplayService
DisplayCreatedEvent
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 DisplayService
name
- 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)
DisplayService
DisplayCreatedEvent
. Hence, the display will not be automatically
shown or tracked.createDisplayQuietly
in interface DisplayService
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.protected void onEvent(WinClosedEvent event)
protected void onEvent(WinActivatedEvent event)
protected void onEvent(DisplayDeletedEvent evt)
Copyright © 2015–2022 SciJava. All rights reserved.