Interface Display<T>
-
- All Superinterfaces:
Collection<T>,Comparable<Prioritized>,Contextual,HasPluginInfo,Identifiable,Iterable<T>,List<T>,Locatable,Logged,Named,Prioritized,RichPlugin,SciJavaPlugin,Versioned
- All Known Subinterfaces:
TextDisplay
- All Known Implementing Classes:
AbstractDisplay,DefaultDisplay,DefaultTextDisplay
public interface Display<T> extends List<T>, RichPlugin, Named
A display is a particular type of plugin intended to collect objects for visualization. For example, aTextDisplaydisplaysStrings.Displays discoverable at runtime must implement this interface and be annotated with @
Pluginwith attributePlugin.type()=Display.class. While it possible to create a display merely by implementing this interface, it is encouraged to instead extendAbstractDisplay, for convenience.- Author:
- Curtis Rueden, Grant Harris
- See Also:
Plugin,DisplayService
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description booleancanDisplay(Class<?> c)Tests whether the display is capable of visualizing objects of the given class.default booleancanDisplay(Object o)Tests whether the display is capable of visualizing the given object.voidclose()Closes the display and disposes its resources.voiddisplay(Object o)Displays the given object in this display.default booleanisDisplaying(Object o)Tests whether the display is currently visualizing the given object.voidupdate()Updates and redraws the display onscreen.-
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream
-
Methods inherited from interface org.scijava.Contextual
context, getContext, setContext
-
Methods inherited from interface org.scijava.plugin.HasPluginInfo
getInfo, setInfo
-
Methods inherited from interface java.util.List
add, add, addAll, addAll, clear, contains, containsAll, equals, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray
-
Methods inherited from interface org.scijava.Locatable
getLocation
-
Methods inherited from interface org.scijava.Prioritized
compareTo, getPriority, setPriority
-
Methods inherited from interface org.scijava.plugin.RichPlugin
getIdentifier, log
-
Methods inherited from interface org.scijava.Versioned
getVersion
-
-
-
-
Method Detail
-
canDisplay
boolean canDisplay(Class<?> c)
Tests whether the display is capable of visualizing objects of the given class.- Parameters:
c- The class to check for visualization capabilities.- Returns:
- True if the display can handle certain objects of the given class; false if it cannot visualize any objects of that class.
-
canDisplay
default boolean canDisplay(Object o)
Tests whether the display is capable of visualizing the given object.
-
display
void display(Object o)
Displays the given object in this display.This method is essentially the same as
List.add(E)except that it accepts anyObjectregardless of type.- Throws:
IllegalArgumentException- if the object cannot be displayed (i.e., ifcanDisplay(Object)returns false).
-
isDisplaying
default boolean isDisplaying(Object o)
Tests whether the display is currently visualizing the given object.Note that this method may behave differently than
List.contains(java.lang.Object); in general, any timeList.contains(java.lang.Object)returns true, this method will also return true, but not vice versa. For example, in ImageJ, anImageDisplayis aDisplay<DataView>but callingisDisplayingon aDataset(which is not aDataView) will return true if theImageDisplaycurrently contains aDatasetViewthat wraps thatDataset.
-
update
void update()
Updates and redraws the display onscreen.
-
close
void close()
Closes the display and disposes its resources.
-
-