org.scijava.display
Interface Display<T>

All Superinterfaces:
Collection<T>, Comparable<Prioritized>, Contextual, HasPluginInfo, Iterable<T>, List<T>, Prioritized, RichPlugin, SciJavaPlugin
All Known Subinterfaces:
TextDisplay
All Known Implementing Classes:
AbstractDisplay, DefaultDisplay, DefaultTextDisplay

public interface Display<T>
extends List<T>, RichPlugin

A display is a particular type of plugin intended to collect objects for visualization. For example, a TextDisplay displays Strings.

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.

Author:
Curtis Rueden, Grant Harris
See Also:
Plugin, DisplayService

Method Summary
 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.
 String getName()
          Gets the name of the display.
 boolean isDisplaying(Object o)
          Tests whether the display is currently visualizing the given object.
 void setName(String name)
          Sets the name of the display.
 void update()
          Updates and redraws the display onscreen.
 
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, retainAll, set, size, subList, toArray, toArray
 
Methods inherited from interface org.scijava.Contextual
context, getContext, setContext
 
Methods inherited from interface org.scijava.Prioritized
getPriority, setPriority
 
Methods inherited from interface java.lang.Comparable
compareTo
 
Methods inherited from interface org.scijava.plugin.HasPluginInfo
getInfo, setInfo
 

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

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 any Object regardless of type.

Throws:
IllegalArgumentException - if the object cannot be displayed (i.e., if canDisplay(Object) returns false).

isDisplaying

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 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.


update

void update()
Updates and redraws the display onscreen.


close

void close()
Closes the display and disposes its resources.


getName

String getName()
Gets the name of the display.


setName

void setName(String name)
Sets the name of the display.



Copyright © 2009–2014 SciJava. All rights reserved.