Skip to content

Commit 3c8cf82

Browse files
committed
DisplayService: flesh out createDisplay javadoc
It is important to note that calling createDisplay publishes a DisplayCreatedEvent, which triggers some actions in other services.
1 parent b6e2619 commit 3c8cf82

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

src/main/java/org/scijava/display/DisplayService.java

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@
3333

3434
import java.util.List;
3535

36+
import org.scijava.display.event.DisplayCreatedEvent;
37+
import org.scijava.display.event.DisplayDeletedEvent;
3638
import org.scijava.event.EventService;
3739
import org.scijava.object.ObjectService;
3840
import org.scijava.plugin.PluginInfo;
@@ -114,7 +116,13 @@ <DT extends Display<?>> List<PluginInfo<DT>> getDisplayPluginsOfType(
114116
boolean isUniqueName(String name);
115117

116118
/**
117-
* Creates a display for the given object.
119+
* Creates a display for the given object, publishing a
120+
* {@link DisplayCreatedEvent} to notify interested parties. In particular:
121+
* <ul>
122+
* <li>Visible UIs will respond to this event by showing the display.</li>
123+
* <li>The {@link ObjectService} will add the new display to its index, until
124+
* a corresponding {@link DisplayDeletedEvent} is later published.</li>
125+
* </ul>
118126
*
119127
* @param o The object for which a display should be created. The object is
120128
* then added to the display.
@@ -129,7 +137,13 @@ <DT extends Display<?>> List<PluginInfo<DT>> getDisplayPluginsOfType(
129137
Display<?> createDisplay(Object o);
130138

131139
/**
132-
* Creates a display for the given object.
140+
* Creates a display for the given object, publishing a
141+
* {@link DisplayCreatedEvent} to notify interested parties. In particular:
142+
* <ul>
143+
* <li>Visible UIs will respond to this event by showing the display.</li>
144+
* <li>The {@link ObjectService} will add the new display to its index, until
145+
* a corresponding {@link DisplayDeletedEvent} is later published.</li>
146+
* </ul>
133147
*
134148
* @param name The name to be assigned to the display.
135149
* @param o The object for which a display should be created. The object is

0 commit comments

Comments
 (0)