public interface Display<T> extends List<T>, RichPlugin, Named
TextDisplay
displays String
s.
Displays discoverable at runtime must implement this interface and be
annotated with @Plugin
with attribute Plugin.type()
=
Display
.class. While it possible to create a display merely by
implementing this interface, it is encouraged to instead extend
AbstractDisplay
, for convenience.
Plugin
,
DisplayService
Modifier and Type | Method and Description |
---|---|
boolean |
canDisplay(Class<?> c)
Tests whether the display is capable of visualizing objects of the given
class.
|
boolean |
canDisplay(Object o)
Tests whether the display is capable of visualizing the given object.
|
void |
close()
Closes the display and disposes its resources.
|
void |
display(Object o)
Displays the given object in this display.
|
boolean |
isDisplaying(Object o)
Tests whether the display is currently visualizing the given object.
|
void |
update()
Updates and redraws the display onscreen.
|
add, add, addAll, addAll, clear, contains, containsAll, equals, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, retainAll, set, size, subList, toArray, toArray
context, getContext, setContext
getPriority, setPriority
compareTo
getInfo, setInfo
boolean canDisplay(Class<?> c)
c
- The class to check for visualization capabilities.boolean canDisplay(Object o)
void display(Object o)
This method is essentially the same as List.add(E)
except that it accepts
any Object
regardless of type.
IllegalArgumentException
- if the object cannot be displayed (i.e.,
if canDisplay(Object)
returns false).boolean isDisplaying(Object o)
Note that this method may behave differently than List.contains(java.lang.Object)
; in
general, any time List.contains(java.lang.Object)
returns true, this method will also
return true, but not vice versa. For example, in ImageJ, an
ImageDisplay
is a Display<DataView>
but calling
isDisplaying
on a Dataset
(which is not a DataView
)
will return true if the ImageDisplay
currently contains a
DatasetView
that wraps that Dataset
.
void update()
void close()
Copyright © 2009–2015 SciJava. All rights reserved.