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.
|
Display<?> |
createDisplay(String name,
Object o)
Creates a display for the given object.
|
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 ). |
EventService |
getEventService() |
ObjectService |
getObjectService() |
PluginService |
getPluginService() |
boolean |
isUniqueName(String name)
Checks whether the given name is already taken by an existing display.
|
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.
|
void |
setActiveDisplay(Display<?> display)
Set the active display.
|
dispose, getContext, initialize, registerEventHandlers, setContext, toString
compareTo, getInfo, getPriority, setInfo, setPriority
context
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
initialize, registerEventHandlers
context, getContext, setContext
getPriority, setPriority
compareTo
getInfo, setInfo
dispose
public EventService getEventService()
getEventService
in interface DisplayService
public ObjectService getObjectService()
getObjectService
in interface DisplayService
public PluginService getPluginService()
getPluginService
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
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
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.protected void onEvent(WinClosedEvent event)
protected void onEvent(WinActivatedEvent event)
protected void onEvent(DisplayDeletedEvent evt)
Copyright © 2009–2015 SciJava. All rights reserved.